6

I'm interested in how two peer-to-peer clients can join each other in a mesh network like Bitcoin clients can.

So when I fire up Bitcoin, how is my client joining all the others? How does it find the very first peer (who probably knows where others are)?

Thanks!

Cody Smith
  • 2,732
  • 3
  • 31
  • 43

1 Answers1

8

Bitcoin clients use several methods to locate other clients. The primary method is a list of nodes from a previous connection to the network. The works very well for everything but your first connection or a connection after a very long period of disconnection.

For the case where you have no previous known IPs or they aren't usable, the primary fallback method is by DNS seeds. Several host names (such as dnsseed.bluematt.me) are maintained that resolve to a list of IP addresses known to be running nodes. Should that fail, the client has a list of IP addresses believed to point to stable nodes hard-coded into it.

One method that used to be used, but that has since been abandoned, was having the clients locate each other using an IRC server. That worked similar to a BitTorrent tracker.

Once you are connected to the network, you will begin to receive lists of IP addresses and ports of known clients.

Source: https://bitcoin.stackexchange.com/questions/3536/how-bitcoin-clients-find-each-other

Community
  • 1
  • 1
Stasik
  • 2,568
  • 1
  • 25
  • 44
  • The reason I ask is because I am interested in how a truly peer-to-peer (without a central authority) mesh network could be created in such a way that it could not be taken down. – Cody Smith Nov 13 '13 at 14:24
  • 2
    Well, the decisions behind the design of current mesh architectures are truly pragmatic. If you want to build up something that can not *theoretically* be taken down, you will probably end up in scanning all possible ips around your own one. – Stasik Nov 13 '13 at 14:27