How should I go about building a public decentralized application?

I want to create a fully decentralized p2p app that is not related to in any way crypto currency.

Some features it would need to have are:

  1. Any node on the network could have it’s own private data and data accessible to any participant on the network.
  2. The ability to query all or a set of nodes and filter them based on tags associated with the nodes.
  3. A node on the network should be able to form a private, encrypted communication channel with any other node on the network. (private meaning that there is no record of any sort on the network)

For the purposes of this project 1 node = 1 user.

At the moment. there is no need for a single global state of the network, but all nodes should be capable of collecting and caching data from each other without being on the same local network.

Do you have any tools, tips and/or tricks that could help me develop this in elixir, or is there a better option for making such a thing? Also I would find architectural advice to be helpful since I’m relatively new to making software in elixir.

1 Like

If it is acceptable or desirable that peers are running client-side in the browser, check WebRTC. It is a browser standard, not related to Elixir, implemented by all modern browsers. Although it was originally conceived for real-time media like video chats, it is not limited to it, and comes with all it takes to establish P2P connections between browsers. With WebRTC data channels you can exchange arbitrary data with mandatory encryption and tunable performance vs. reliability trade-off.

I don’t know if it would meet your requirements, but delving through it is also a good exercise in understanding the design and challenges of P2P networks.

For an introduction on P2P with WebRTC, you can check out my talk at the OpenFest 2019: Going Peer-to-Peer with WebRTC (there are many great talk and articles on the topic, so forgive my shameless plug here :slight_smile:)