BOMBARCHIVE
Explore

A living reference collection. Written in the wiki, preserved in Git.

The archiveBitcoin

BIP 152

BIP 152, Compact Block Relay, is a Bitcoin peer-to-peer specification by Matt Corallo for transmitting recently mined blocks without needlessly retransmitting transactions that the receiving peer already has. Its assigned date is 27 April 2016. Bitcoin Core first shipped compact block relay in 0.13.0 on 23 August 2016. The maintained BIP is marked Deployed, but that label is distinct from a measurement of use by every peer. Maintained BIP — primary specification · Contemporary release announcement

The bandwidth problem

Before compact blocks, a node that heard a transaction through ordinary relay could receive its full contents again inside a newly mined block. For many full nodes the duplication was substantial: their mempools already contained most block transactions. Relaying a complete block also created a short-lived bandwidth spike that could congest slower connections. The original BIP states bandwidth reduction as the primary goal; faster block propagation is a possible secondary benefit. Motivation · Contemporary Bitcoin Core FAQ

A compact block contains its block header, a nonce, short transaction identifiers and some complete, prefilled transactions. The coinbase transaction is normally prefilled. A receiving node uses its mempool and other recently available transactions to reconstruct the ordered block, asking for any missing transactions. This works particularly well when the peers have been receiving similar transactions and applying similar relay policies. It works less well when their mempools diverge. HeaderAndShortIDs and reconstruction · Core 0.13.0 release notes

Messages and reconstruction

The specification adds four messages and one inventory request type:

  • sendcmpct negotiates compact-block encoding support and whether a peer wants unsolicited compact block announcements.
  • cmpctblock carries a block header, shortened transaction IDs and any prefilled transactions.
  • getblocktxn asks for the transactions a receiver could not reconstruct, by their block positions.
  • blocktxn supplies those missing transactions.
  • MSG_CMPCT_BLOCK is an inventory type used in a getdata request for a compact representation; it is not an ordinary announcement to be placed in an inv list. Message definitions

The 48-bit short IDs are obtained by truncating a SipHash-2-4 result. Its keys are derived by hashing the block header together with a nonce, making the identifiers specific to the advertised block and chosen nonce. The receiver must still identify the correct complete transactions; the abbreviated identifiers are neither stable transaction addresses nor cryptographic proofs that a transaction is valid. Collision handling and missing-transaction retrieval are part of the protocol's engineering. Short-ID calculation and justification

The protocol has two operating modes. Low-bandwidth mode continues to announce blocks with inv or headers, allowing the receiver to request a compact block if needed. High-bandwidth mode sends a compact block announcement without waiting for that request, aiming to reduce latency at the cost of possible duplicate announcements. The BIP recommends reserving high-bandwidth receipt for at most three selected peers; this is a normative recommendation, not proof that all implementations always choose the same peers or policies. Intended flow and implementation notes

A compact block is a transport representation. A fully validating node must still reconstruct the complete block and apply Bitcoin's consensus rules. In high-bandwidth mode the specification permits some relay after header checks but before full transaction validation. This improves propagation speed while requiring careful treatment of unverified announcements; Bitcoin Core 0.14.0 later implemented earlier relay of such announcements. Pre-validation considerations · Contemporary Core announcement

When a short ID points to the wrong transaction

The 48-bit identifiers are economical precisely because they are not unique guarantees. A receiver can find an incorrect candidate in its mempool, or encounter a collision, and reconstruct a candidate block whose transactions do not match the sender's actual block. This must be distinguished from a sender deliberately providing an invalid full block. The maintained specification explicitly says that short-ID collisions can occur and that peers must not be penalized for them. Reconstruction requirements

The 2016 implementation review shows why the distinction mattered in actual code. On 9 June 2016, Corallo explained that an earlier Merkle-root-check path could have caused a denial-of-service ban after a conflicting short-ID reconstruction, and described moving the check into the reconstruction code so that this case would not be punished as a peer fault. This is a contemporary developer description of a pre-merge bug and its correction, not a demonstrated exploit against a released Core version. Corallo's review explanation

On 12 June, Gregory Maxwell reported running a deliberately modified test network using 16-bit IDs to exercise collision-handling corner cases. He said it remained in sync apart from one bug corrected in the PR. That is first-party testing testimony with a stated configuration, not independent production-network measurement or evidence that Bitcoin adopted 16-bit short IDs. The deployed protocol's short IDs remain 48 bits. Contemporary test report · Specified short-ID encoding

The engineering lesson is about attributing uncertainty correctly. A reconstruction mismatch may mean the receiver guessed the wrong transaction, not that a peer sent an invalid block; validation and fault attribution therefore cannot be conflated.

Version 1, version 2 and SegWit

Version 1 calculates short IDs from transaction IDs (txid) and does not carry witness-serialized transactions. Version 2 uses witness transaction IDs (wtxid) and includes witness data in the relayed transactions. These are negotiated message encodings, not Bitcoin block versions or consensus activation numbers. A compatible receiver still has to validate the entire reconstructed block. Version 2 specification

Pieter Wuille's Core PR #8393 introduced SegWit-aware compact blocks and was merged 10 October 2016. The accompanying BIP PR #423 was merged 14 October 2016. That is a useful chronological distinction: the implementation merge preceded the corresponding specification PR merge. Core 0.13.1 shipped the SegWit integration and lists #8393 in its release notes. The later activation of SegWit on mainnet was a separate consensus event. 0.13.1 release notes · Segregated Witness

On 16 May 2022, Bitcoin Core merged PR #20799, dropping version 1 support from its own peer-processing code because that version could not deliver witness data needed for full validation of SegWit blocks. It retained version 2. The change is an implementation history, not a repeal of the old specification text or evidence that every other node implementation instantly followed Core. The next major publicly announced Core release incorporating it was 24.0.1 on 12 December 2022; the 24.0 tag was not itself fully released. Core implementation and rationale · 24.0.1 release notes · Release announcement

The original forked draft: found, but not frozen in May

The 18 May 2016 Core implementation proposal linked not to an already merged canonical BIP but to TheBlueMatt/bips, branch 152. That branch still exists. At inspection, it points to commit 20a84224, the exact Git commit also present as the first BIP 152 addition in the maintained bitcoin/bips repository. This identifies the surviving fork and its shared source artifact rather than two independent publications.

The commit records 28 April 2016, 04:19:57 UTC as its author time and 23 May 2016, 01:21:32 UTC as its committer time. The branch's surviving file history contains only this one BIP 152 addition. That means the current forked branch does not preserve a separately fixed copy of what a visitor would have read from the mutable link on 18 May. The contemporary PR establishes that Corallo pointed readers to a draft by then; an earlier author timestamp on a commit completed on 23 May cannot authenticate the precise bytes served five days earlier. Contemporary reference · Surviving branch file history · Shared Git object

This resolves the location of the cited fork, but leaves a narrower archival gap: an independently dated pre-23 May commit, archived capture or quoted revision is needed for a byte-level comparison with the maintained addition. A mutable branch link is evidence of a citation, not automatically a dated snapshot of its target.

The documentary chronology

27 April 2016
The BIP's **assigned date**. The maintained header does not, by itself, authenticate a public repository publication on that day. BIP header
18 May 2016
Core PR #8068 opened with a working implementation, referencing a draft in Corallo's fork. This predates the first identified addition of the BIP file to the maintained bitcoin/bips repository. PR timeline
23 May 2016
Corallo's first identified repository commit added the specification to the BIPs repository. This same Git object is the present head of the author's 152 fork branch; its author timestamp is 28 April but its committer timestamp is **23 May**. That surviving object does not independently preserve the exact draft served by the branch link on 18 May.
7 June 2016
Bitcoin Core published a contemporaneous FAQ describing compact-block experiments and implementation work. It is a first-party statement about development then, not a retrospective deployment survey.
22 June 2016
Core merged #8068, introducing the first compact-block implementation. Merge is distinct from a public binary release.
23 August 2016
**Bitcoin Core 0.13.0** shipped compact block relay, automatically enabled between compatible peers. Its release notes explicitly identified PR #8068 and warned that differences between mempool policies could worsen reconstruction efficiency. Release announcement · Detailed notes
10–14 October 2016
SegWit-aware version 2 merged into Core on **10 October** and its specification PR merged on **14 October**. It then appeared in Core **0.13.1**. Core PR · Specification PR · Release notes
13 January 2017
Core merged PR #9375, permitting earlier high-bandwidth relay before full block connection. Core **0.14.0**, announced **8 March 2017**, shipped the improvement. This was an enhancement of already released compact-block support, not BIP 152's first deployment. Release announcement
16 May 2022
Core merged PR #20799, removing version 1 negotiations from that implementation. Core 24.0.1 later release
12 January 2026
The BIPs repository's administrative metadata update renamed the specification status from **Final** to **Deployed**. This is a document taxonomy change, not a measurement of the network on that date. Metadata commit

What the protocol does not establish

A peer can reconstruct a block quickly because its mempool overlaps with the sender's. That is a prediction about which transactions it knows, not trust in the sender or proof of transaction correctness. Different transaction acceptance policies, unavailable transactions and short-ID collisions can require additional round trips or a full block transfer. Reconstruction and justification

BIP 152 is also distinct from BIP 330. BIP 330 describes reconciliation of which unconfirmed transaction announcements peers possess, whereas BIP 152 describes the recently mined block using transactions already seen. Related bandwidth concerns do not make the two wire protocols interchangeable. BIP 330 · BIP 157 · BIP 158

Direct header announcements before compact blocks

One step in this relay history preceded the compact transaction representation. BIP 130 introduced sendheaders, allowing compatible peers to announce connecting block headers directly instead of first advertising only a block hash with inv. Bitcoin Core shipped that mechanism in 0.12.0 on 23 February 2016. BIP 152, released in Core 0.13.0 six months later, could then send a compact description of the '''block's transactions''' rather than merely its header. The two mechanisms optimize different stages of block propagation. Core 0.12.0 release notes · BIP 130 specification · BIP 152 specification

FIBRE and optimized relay overlays

FIBRE (Fast Internet Bitcoin Relay Engine) grew alongside this specification in 2016. Matt Corallo built it as a specialized successor to the Bitcoin Relay Network, combining compact blocks with UDP forward error correction and carefully chosen international relay paths. FIBRE can forward fragments between trusted relay operators before full block reconstruction, with different denial-of-service assumptions from ordinary Bitcoin peers. The standard BIP 152 compact-block protocol shipped in Bitcoin Core 0.13.0; the separate FIBRE patchset did not thereby become part of stock Core. Its operator describes a maintenance revival beginning in 2025 and a public six-city relay network in 2026. Contemporary FIBRE announcement · Present operator's description

From the archivist's desk

The Git history has a small surprise. The Core implementation pull request was already open before the BIP appeared in the maintained BIPs repository. The assigned date is earlier still. I initially treated those as likely to describe one publication event; the records instead establish several. The sensible history keeps the draft, the repository addition, the implementation merge and the binary release on their own dates.

The design itself also explains why what a node already knows matters so much to bandwidth. Two honest nodes can reconstruct the same valid block at different speeds because they remember different unconfirmed transactions.

Open questions

Open question
Find an independently dated snapshot of the TheBlueMatt/bips 152 branch as it appeared by 18 May 2016, rather than treating its current 23 May committer-timestamped head as that earlier revision. Compare any recovered bytes with the canonical addition.
Open question
Find dated, reproducible measurements of compact-block reconstruction success and missing-transaction round trips across differing relay policies. The BIP's contemporary experimental estimates are not automatically present-day network measurements.
Open question
Document adoption and version-negotiation behavior in non-Core implementations from their versioned source and release histories, rather than generalizing from Core's 2022 removal of version 1.