Bitcoin Book of BIPs

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
  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.