P2P applications

User autonomy is at the heart of P2P applications. This means that the data should be written locally first and later exchanged with peers. For this data to be safely exchanged, the data should be signed by a key in the users control and ideally be encrypted as well. The aggregate data is what makes up a full application. There is no single source of truth as in a centralized application instead this concept is fluid and changes over time as the application grows.

To make this more concrete lets look at specific protocol for writing P2P applications know as Scuttlebutt. In Scuttlebutt each peer has their own feed with their own key pair where they write messages. These messages can be follow and block messages of other peers allowing a social network to be formed or it can be application specific messages. Because it is generally non-trivial to have a direct connected between two peers on the internet, a intermediate peer with a public IP is often used. This can either be a pub that relays messages between peers, meaning the peer don’t have to be online at the same time, or could be a room server where peers can exchange message directly using the room server as an E2E encrypted tunneling service.

Peers can run applications by either installing them on their computers or phones (such as manyverse) or can run directly in the browser with no installation required using ssb-browser-core. Development of the database (ssb-db2, jitdb) that runs on all of these platforms and the second generation room server was sponsored by the European Union through a grant from NGI pointer. For more detailed information about that project included videos see this.

Recently I have been creating a tech demo showcasing private groups and all of the technology mentioned above in a single application. The application is a good starting point for writing other applications using the SSB stack and allow it to run directly in the browser. You can try an online demo and try it for yourself. Note this is a demo and thus not very polished.