BIP 31, Pong message, is Mike Hearn's 2012 extension to the Bitcoin peer-to-peer protocol. It added a 64-bit nonce to the ping message and a corresponding pong reply, letting a connected node check whether its peer was still responding and, when a nonce was chosen for measurement, estimate round-trip latency. Bitcoin-Qt/bitcoind 0.6.1 released the feature on 4 May 2012 using network protocol version 60001. BIP 31 — specification · Bitcoin-Qt 0.6.1 announcement — contemporary release record
The provenance of the implementation is more complicated than the specification's single implementation link suggests. Hearn's original PR #932 did not merge. Jeff Garzik adapted that work in PR #1081, which merged on 17 April 2012. The original PR remained open until 8 May, four days after the release. These are separate records of one feature, not two deployed pong protocols. Original proposal — direct repository record · Merged implementation — direct repository record
Why Bitcoin needed an answer to ping
Before this extension, Bitcoin already had a ping command, but a recipient was not required to reply to it. That made the command a weak test of whether a connection was genuinely usable. In the March 2012 discussion, Matt Corallo asked why Bitcoin had a ping that did not visibly accomplish anything; Pieter Wuille confirmed the value of checking whether a connection was alive. These are contemporary developer observations, not performance measurements.
The BIP described three recurring problems:
- Sleeping devices. A laptop or mobile device could wake with a TCP connection that appeared to remain established even though the path no longer worked.
- Overloaded peers. A node occupied with blockchain download or other work might be slow to process network messages. A live socket did not guarantee a responsive application.
- Peer selection. A client choosing a source for large downloads could benefit from knowing relative network latency, rather than selecting arbitrarily.
These are motivations in Hearn's specification. They do not demonstrate that the first Bitcoin Core release automatically ranked all peers by measured latency.
The wire change
The BIP uses the version negotiated in the peer handshake to decide which form of ping to send.
- Protocol version greater than 60000
pingcontains an unsigned 64-bitnonce; the receiving node answers withpongcontaining the same value. A randomly selected nonce lets the requester match a response to the proper request even if several pings overlap.
- Protocol version 60000 or below
- The earlier form of
pingcarries no nonce and expects nopong. Nodes using the new feature must preserve that compatibility boundary.
- Nonce zero
- The specification allows a sender that never overlaps pings to use zero rather than generating a random value for each request. Zero is not evidence that a round-trip measurement was performed.
The actual 2012 implementation provides a revealing limit. PR #1081 sends ping with nonce 0 as a periodic keepalive; its code comment says the sender did not yet use the nonce value for measurement. The receiving handler could already echo any supplied nonce. Thus support for the mechanism and a particular application's use of latency measurements should not be conflated. Merged diff — direct code record · Bitcoin 0.6.1 protocol constants
The version check concerns the negotiated peer-to-peer protocol number, not the human-facing software release label. BIP 14 had already separated protocol versioning from client versioning. In the original PR discussion on 12 March 2012, Wuille explicitly reminded Hearn of that separation when the proposal initially tried to raise the protocol number by a large increment. Wuille's contemporary reply · BIP 14 specification
The 2012 development record
pong and initially proposed changing the network protocol version to 70000. Reviewers questioned the version jump and whether the proposal needed a BIP. The PR ultimately closed **without merging**.Created, and later metadata changes do not by themselves prove the exact date of number assignment. PR conversation · 2026 field-label changeBIP: 32. The second, at 21:34 UTC, corrected that internal header to 31, crediting Wuille for catching the typo. This is a short-lived editorial inconsistency, **not evidence of two independently deployed features**.60000 feature threshold and introduced an explicit BIP0031_VERSION constant. This merge added code, but the software's own PROTOCOL_VERSION still required a separate bump to make the feature available to its new peers.PROTOCOL_VERSION = 60001, the nonce-bearing ping, and pong. This is the first identified tagged release delivering BIP 31 in the reference client. Original release notes · Tagged sourceA draft with the wrong number and an obsolete version threshold
The 16 April 2012 preserved draft had two features that differ from the maintained text: its internal header still said BIP: 32, and its proposed negotiation rule used version 70000 or above rather than the eventual greater than 60000 condition. A subsequent commit fixed the header. The archived 6 July 2012 wiki revision, imported into the Git repository in October 2013, already states the 60000 threshold.
The original proposed condition therefore should not be quoted as the shipped protocol. The surviving commits bound the specification's revision history, but BOMB has not reconstructed the precise wiki edit that first changed the threshold. The tagged 0.6.1 source and release note independently establish the deployed 60001 behaviour.
The maintained BIP's Implementation section still links #932, a valuable reference to Hearn's original proposal but not the merged change. Bitcoin Core's implementation ledger instead names #1081 and version 0.6.1. Both links belong in the history, with their different roles made explicit.
Where ping and pong fit
A peer's ability to answer a ping is one small part of operating Bitcoin's network.
- Bitcoin peer discovery describes how a node first obtains candidate addresses. Discovery does not establish that a connection is still responsive.
- BIP 35 followed with a
mempoolrequest and protocol version 60002. It concerns a peer's local unconfirmed transaction inventory, not the liveness of the connection carrying that request. - BIP 130 and BIP 152 address dissemination of new blocks; BIP 133 addresses fee-filtered transaction announcements. They optimize content exchange after a connection exists.
- BIP 324 encrypts the transport; it does not turn a successful
ponginto evidence of identity or chain correctness.
The 2012 code permits a response to serve as a measurement, but no ping response proves the other side's ledger state, storage capacity or future reliability. This distinction remains relevant for software that selects peers to request historical block, inscription or Bitmap data.
Open research
Recover the specific 2012 Bitcoin Wiki edit that changed the draft's proposed
>=70000 threshold to the shipped >60000 rule, rather than relying only on the April draft and the later archived revision.Trace when Bitcoin Core began actively measuring and using peer
ping/pong round-trip latency, as distinct from the nonce-zero keepalive that initially shipped in 0.6.1.Primary records
- Maintained BIP 31 specification.
- Mike Hearn's original proposal and March–May 2012 discussion.
- Jeff Garzik's merged implementation and April 2012 discussion.
- Draft filename correction, 16 April 2012.
- Draft header correction, 16 April 2012.
- Bitcoin-Qt/bitcoind 0.6.1 release announcement, 4 May 2012.
- Versioned protocol constants.
- Bitcoin Core BIP implementation ledger.