Home › Browse › BIP 35

BIP 35: mempool message

In plain English: Adds a "mempool" message that lets a node ask a peer for the unconfirmed transactions it is holding. This helps lightweight wallets and freshly started nodes learn quickly about payments still waiting to be confirmed.

Status
Deployed
Type
Specification
Layer
Peer Services
Authors
Jeff Garzik
Assigned
Last changed
Topics
Network, Mempool
Source
bip-0035.mediawiki on GitHub · Markdown

Abstract

Make a network node's transaction memory pool accessible via a new "mempool" message. Extend the existing "getdata" message behavior to permit accessing the transaction memory pool.

Motivation

Several use cases make it desirable to expose a network node's transaction memory pool:

  1. SPV clients, wishing to obtain zero-confirmation transactions sent or received.
  1. Miners, to avoid missing lucrative fees, downloading existing network transactions after a restart.
  1. Remote network diagnostics.

Specification

  1. The mempool message is defined as an empty message where pchCommand == "mempool"
  1. Upon receipt of a "mempool" message, the node will respond with an "inv" message containing MSG_TX hashes of all the transactions in the node's transaction memory pool, if any.
  1. The typical node behavior in response to an "inv" is "getdata". However, the reference Satoshi implementation ignores requests for transaction hashes outside that which is recently relayed. To support "mempool", an implementation must extend its "getdata" message support to querying the memory pool.
  1. Feature discovery is enabled by checking two "version" message attributes:
    1. Protocol version >= 60002
    1. NODE_NETWORK bit set in nServices

Note that existing implementations drop "inv" messages with a vector size > 50000.

Backward compatibility

Older clients remain 100% compatible and interoperable after this change.

Implementation

https://github.com/bitcoin/bitcoin/pull/1641

Related proposals

  • BIP 14: Protocol Version and User Agent: Deployed. Separates the version of the Bitcoin network protocol from the version of any one program, and adds a "user agent" label identifying the software a node runs. As alternative clients appeared, this…
  • BIP 31: Pong message: Deployed. Adds a "pong" reply that a node sends back when it receives a "ping" containing a random number. This lets software reliably tell whether a connection to another node is still alive.
  • BIP 33: Stratized Nodes: Closed. Proposed specialized node roles so lightweight clients could rely on full nodes that serve them only the data they need. It aimed to keep Bitcoin usable for ordinary users as the blockchain grew too…
  • BIP 36: Custom Services: Closed. Proposed a way for nodes to announce custom or optional services during their initial handshake without using up the small set of standard service flags. It would have made it easier to add new…
  • BIP 37: Connection Bloom filtering: Deployed. Lets lightweight wallets hand a full node a Bloom filter (a compact, approximate summary of what they care about) so they receive only relevant transactions. This made phone wallets practical,…
  • BIP 60: Fixed Length "version" Message (Relay-Transactions Field): Closed. Proposed making the "relay transactions" flag a fixed, always-present part of the initial handshake message rather than an optional extra. The optional field, introduced by BIP 37, made message…