Peer discovery and handshakes
Terms used in this lesson
- P2P
- Peer-to-peer: nodes communicate directly with other nodes rather than through one central server.
- DNS
- Domain Name System: a naming service Bitcoin can use during peer discovery without trusting it to validate chain data.
- TCP
- Transmission Control Protocol: the reliable network connection over which a traditional Bitcoin peer session can exchange messages.
- NODE_NETWORK
- A Bitcoin peer service flag claiming that the peer can provide complete block data under the protocol's service rules.
- Proof-of-work target
- The maximum header-hash value accepted for a block; lowering it makes valid hashes harder to find.
Nodes discover peers, negotiate services, and exchange inventory without a central network registry.
Loading lesson visuals...
Learn the idea
Bitcoin's peer-to-peer (P2P) network has no central peer directory. A node can learn addresses from configured seeds, Domain Name System (DNS) seeds, prior address records, or connected peers. A Transmission Control Protocol (TCP) connection becomes a Bitcoin peer session after each side sends a version message and acknowledges the other's version with a version acknowledgement (verack) message. Those messages exchange protocol version, service claims, time, and synchronization information.
Obtain candidate addresses
A fresh node queries seed sources for initial routable peers, while an established node uses its locally stored and peer-supplied address manager.
Inspect every idea above to open it.
Starting height is only a hint. The node downloads and validates headers and blocks, and chainwork selects among valid branches.
The questions unlock after every required learning activity
Inspect every guided idea, open the worked example, rebuild its mechanism, and complete the deterministic lesson tool. Your progress is saved automatically.