Peer discovery using Blockstack

Slack user jjosephs had a great idea regarding peer discovery and blockstack. Here’s an excerpt of our conversation in slack:

jjosephs:

Is there currently, or is there planned, a means of peer discovery for apps that utilize Blockstack? It’d be a very useful, and necessary function for many apps.

@larry:

When you say peer discovery, do you mean a mechanism for finding all of the users that use a particular app? Or connecting to a particular user using an app by entering their Blockstack ID?

jjosephs:

I mean both, ideally, but a particular user would be a start. For example, imagine a user-to-user chat app using WebRTC. Right now it would require a signalling server to set up the peer-to-peer communication, but it would be nice to have that as a native function in Blockstack. Finding all users of a particular app would also be interesting. Obviously these should be opt-in.

This is handled by the Atlas network. Each Blockstack node participates in the Atlas network, and builds a 100% replica of all of the names’ zone files. The zone files are used to bootstrap app-specific peer discovery.

Each Atlas zone file gives you 4KB of “scratch space” to store whatever discovery information you want. For example, your zone file today contains URLs to signed replicas of your profile (used by Onename), as well as a public key (used to sign off-chain data). As another example, I just added support for looking up Tor .onion addresses using Blockstack names by writing the .onion address to the Blockstack name’s zone file (PoC here: https://github.com/jcnelson/blockstack-tor).

You’d be able to build a p2p chat app in Blockstack simply by having each app user write their preferred signaling server’s URL into their zone files. We’re working on native support for this here: https://github.com/jcnelson/hermes.

3 Likes