Author

Topic: How do clients and miners know who is on the network? (Read 1072 times)

donator
Activity: 1218
Merit: 1079
Gerald Davis
From the code, I gather it has a list of initial seed nodes to download updated lists from. I assume that it is important for the integrity of the network that these hardcoded seed nodes are not compromised or can't easily become subject to persecution from hostile goverments / agents.

Not really.  They could all be taken down tomorrow and existing nodes would be unaffected.  New nodes would have difficulty bootstraping but that could be worked around temporarily by having new users manually adding known nodes to the config file.  All a new node needs is a few nodes to connect to as part of the connection handshake involves both nodes sharing their list of known nodes.   So if you known 3 or 4 nodes, you soon know thousands.  All networks have to be bootstrapped in some way.  Of course the goal would be to ensure there are enough bootstraps (both in dns seeds and hardcoded nodes) to make disrupt nearly impossible.

In addition to the dns seeds there is a list of very active high uptime nodes which are hardcoded to the client
https://github.com/bitcoin/bitcoin/blob/b8d9058a4d1ce28eefa65aa3339bcc52b3c014e9/src/chainparams.cpp#L21

This list is updated from version to version.  Peers are monitored to find the ones with the most connections, uptime, and synced bandwidth.  This ensures that even if the dns seeds are offline, new nodes can always find a few reliable, well connected nodes.  Maintain good uptime and large number of inbound connections and you might find your node on that list.

As for miners.  Nodes don't advertising if they are mining or not.  The network doesn't treat miners any different than other nodes.  You don't (normally) send transaction to a miner.  You just relay them to your peers who relay them to their peers, etc.  Within a few hops every node knows of the new transactions.
newbie
Activity: 33
Merit: 0
Thank you all very much. All responses have been very useful.

From what I see,  although the network is decentralized, the initial list of nodes has to come from somewhere. From the code, I gather it has a list of initial seed nodes to download updated lists from. I assume that it is important for the integrity of the network that these hardcoded seed nodes are not compromised or can't easily become subject to persecution from hostile goverments / agents.

The link to the Satoshi Client Node Discovery also gives very good ideas. Thanks.

Using WebRTC?

Yes.
newbie
Activity: 24
Merit: 0
I'm looking into developing a javascript client p2p network.

Using WebRTC?
full member
Activity: 140
Merit: 107
There is a DNS seed. here are the code parts:

https://github.com/bitcoin/bitcoin/blob/334bd22e75b1955b3dfefbf4f5e065afdbc46ae4/src/net.cpp#L1197
https://github.com/bitcoin/bitcoin/blob/b8d9058a4d1ce28eefa65aa3339bcc52b3c014e9/src/chainparams.cpp#L143

In the beginning there was an IRC channel. torrent is different in that there are many torrents, and not every node has all torrents. whereas in bitcoin every node has the one and only blockchain. it's true that bitcoin is quite similar to torrent.

a correction: in bitcoin there are only nodes (fully P2P). there is no concept of a miner per se.

there were some recent changes to make this not reliant on DNS.

see also:
https://github.com/bitcoin/bitcoin/pull/3875
http://bitcoin.stackexchange.com/questions/14410/how-does-bitcoin-find-peers
http://getaddr.bitnodes.io/
legendary
Activity: 3794
Merit: 1375
Armory Developer
There were plans to change that so im not sure if that was changed yet but at first the bitcoin core client would retrieve peers from a freenode irc channel.
newbie
Activity: 33
Merit: 0
I'm looking into developing a javascript client p2p network. Most P2P networks I've looked into need to communicate with a connection broker in order to discover what other clients are in the network. Even bittorrent clients, need tracker servers.

How is it that the bitcoin network resolves this?

How does a client know what IPs to download the blockchain from?

How do miners know the IPs of other miners in the network?


If you can point me in the right direction to look up this information I would be most thankful
Jump to: