Skip to main content

Retransmisión de bloques compactos | Bitcoin Glossary | Mapping Bitcoin

Retransmisión de bloques compactos

network

Also known as: BIP152, compact blocks, cmpctblock

Protocolo BIP152 que acelera la propagación de bloques enviando solo los identificadores cortos de transacciones ya conocidas por los nodos.

Overview

Compact block relay, specified in BIP 152, is a peer-to-peer protocol optimization introduced in Bitcoin Core 0.13.0 (2016) that dramatically reduces the bandwidth and time required to propagate new blocks across the Bitcoin network. Instead of transmitting a full block (which can be up to 4 MB of weight data), a node sends a compact block message containing the block header, shortened transaction identifiers, and only the transactions the receiving node is unlikely to already have.

The key insight behind compact block relay is that by the time a block is mined, most of the transactions it contains have already been broadcast across the network and sit in each node's mempool. There is no need to send these transactions again inside the block; instead, the sending node transmits short 6-byte identifiers that the receiving node uses to look up the full transactions from its own mempool. Only genuinely new or missing transactions need to be transmitted in full.

How It Works

Traditional Block Relay:
  Miner → Full block (1-4 MB) → Each peer → Full block → Their peers...
  Latency: seconds to tens of seconds

Compact Block Relay:
  1. Miner sends "cmpctblock" message:
     ┌─────────────────────────────────────┐
     │ Block Header            (80 bytes)  │
     │ Short TX IDs (6 bytes each × ~3000) │
     │ Prefilled TXs (coinbase + unknown)  │
     │ Total: ~20-30 KB (vs 1-4 MB)       │
     └─────────────────────────────────────┘

  2. Receiving node reconstructs block:
     - Matches short IDs to mempool transactions
     - If any transactions are missing:
       → Sends "getblocktxn" request for missing TXs
       → Sender replies with "blocktxn" message
     - Assembles and validates complete block

  3. Typical case (>95% of transactions in mempool):
     → Block reconstructed with zero round trips
     → Propagation in milliseconds instead of seconds

Low-Bandwidth and High-Bandwidth Modes

BIP152 defines two operating modes:

Low-bandwidth mode (default): A node requests compact blocks after receiving the standard block announcement (inv or headers message). This adds one round trip but avoids receiving unsolicited data. Nodes can have multiple low-bandwidth compact block peers.

High-bandwidth mode: A node asks a peer to send compact blocks immediately upon discovery, without waiting for an announcement. This eliminates one round trip at the cost of potentially receiving duplicate compact blocks from multiple peers. Nodes typically designate up to three high-bandwidth compact block peers, chosen based on which peers have historically delivered blocks fastest.

Low-bandwidth mode:
  Peer A → "I have block X" → Node → "Send compact" → Peer A → cmpctblock
  (1 extra round trip)

High-bandwidth mode:
  Peer A → cmpctblock (immediately)
  (0 extra round trips, may receive duplicates)

Impact on Network Health

Compact block relay has been one of the most impactful network-layer improvements to Bitcoin. Faster block propagation provides several benefits:

Reduced orphan rate: When blocks propagate faster, the probability of two miners finding blocks at nearly the same time — resulting in one block being orphaned — decreases. This makes mining fairer, especially for smaller miners and pools.

Reduced centralization pressure: Before compact blocks, larger mining pools had an inherent advantage because they could begin mining on their own blocks instantly. Smaller miners had to wait for the full block to propagate before they could start mining the next block. By reducing propagation time to near-zero, compact blocks level the playing field.

Mitigates selfish mining: Faster propagation reduces the timing advantage that a selfish miner can exploit by withholding blocks and releasing them strategically.

Lower bandwidth requirements: Nodes consume roughly 90-99% less bandwidth for block relay, making it more feasible to run a full node on limited internet connections.

  • Block Propagation — the broader topic of how blocks spread across the network
  • Block — the data structure that compact block relay optimizes the transmission of
  • Mempool — the local transaction pool that enables compact block reconstruction
  • Full Node — nodes that benefit from reduced bandwidth via compact blocks
  • BIP — Bitcoin Improvement Proposal, the process through which BIP152 was specified
  • Selfish Mining — an attack mitigated by faster block propagation