Peer-to-Peer Network
Bitcoin nodes do not share a server. They share a gossip protocol. This chapter is that protocol as it exists now: how peers introduce themselves, how they keep the connection alive, how they announce blocks and transactions, and how light clients ask for less than the full chain.
The early documents are small and still in use — version and user agent, ping/pong, the mempool message, bloom filters and the service bit that opts into them, the reject message. Then the chapter moves into the performance work that followed: headers-first announcements, fee filters, SegWit inventory, compact blocks, compact client-side filters, and pruned-node service bits.
The last three are the modern network. BIP 155 lets peers advertise addresses that are not IPv4. BIP 324 encrypts the transport so a listener on the wire cannot trivially see which transactions you relay. BIP 339 relays by witness transaction id. BIP 434 is how peers negotiate optional features without inventing a new handshake every time.
Bloom filters (BIP 37) are deployed and still specified here, even though most new light clients use compact filters instead. I left them in because the service bits and the historical clients still refer to them.
In this chapter:
- BIP 14 — Protocol Version and User Agent
- BIP 31 — Pong message
- BIP 35 — mempool message
- BIP 37 — Connection Bloom filtering
- BIP 61 — Reject P2P message
- BIP 111 — NODE_BLOOM service bit
- BIP 130 — sendheaders message
- BIP 133 — feefilter message
- BIP 144 — Segregated Witness (Peer Services)
- BIP 152 — Compact Block Relay
- BIP 155 — addrv2 message
- BIP 157 — Client Side Block Filtering
- BIP 158 — Compact Block Filters for Light Clients
- BIP 159 — NODE_NETWORK_LIMITED service bit
- BIP 324 — Version 2 P2P Encrypted Transport Protocol
- BIP 339 — WTXID-based transaction relay
- BIP 434 — Peer Feature Negotiation
BIP: 14
Layer: Peer Services
Title: Protocol Version and User Agent
Authors: Amir Taaki <genjix@riseup.net>
Patrick Strateman <bitcoin-bips@covertinferno.org>
Status: Deployed
Type: Specification
Assigned: 2011-11-10
Discussion: 2011-11-02: https://gnusha.org/pi/bitcoindev/1320268981.72296.YahooMailNeo@web121003.mail.ne1.yahoo.com/
2011-11-10: https://gnusha.org/pi/bitcoindev/1320959761.36702.YahooMailNeo@web121014.mail.ne1.yahoo.com/
In this document, bitcoin will be used to refer to the protocol while Satoshi will refer to the current client in order to prevent confusion.