Erlay

A Bitcoin relay improvement that reconciles transaction sets instead of re-announcing everything, cutting bandwidth sharply.

Basically

Erlay is a proposed Bitcoin improvement that cuts the bandwidth used to share new transactions by about 40%. Nodes compare their transaction lists instead of sending the same announcements to every peer.

Key Takeaways

  • Erlay is a proposed change to how Bitcoin nodes share unconfirmed transactions. It replaces redundant flooding with efficient set reconciliation to cut transaction relay bandwidth by approximately 40%.
  • Erlay uses the Minisketch library to encode compact "sketches" of each node's mempool contents. Peers can compute exactly which transactions they are missing without exchanging full lists.
  • Erlay decouples bandwidth cost from peer count. Nodes can maintain more connections without proportional overhead, strengthening network resilience against eclipse attacks and partitioning.

What Is Erlay?

Erlay is a Bitcoin protocol improvement defined in BIP 330. It changes how unconfirmed transactions spread across the peer-to-peer network. Today, a node announces each new transaction's ID to every connected peer, a process called flooding, and most of these announcements are redundant because most peers already know about the transaction.

Erlay replaces most flooding with periodic set reconciliation. A node announces new transactions to only a small subset of peers, then periodically reconciles its transaction set with the remaining peers using compact sketches. The result is dramatically less bandwidth consumed for the same level of transaction propagation.

Gleb Naumenko, Pieter Wuille, Gregory Maxwell, Alexandra Fedorova, and Ivan Beschastnikh authored the proposal. Researchers presented the underlying work at ACM CCS 2019. The BIP was published in November 2019.

How It Works

Erlay splits transaction relay into two distinct phases. These are a limited fanout phase and a reconciliation phase.

Phase 1: Limited Fanout

A node directly announces the transaction ID to a small number of peers when it receives a new transaction. The typical group is one outbound connection plus roughly 10% of inbound connections. The transaction begins propagating quickly and reaches a broad set of nodes within a few hops.

Phase 2: Set Reconciliation

Nodes do not send individual announcements to all remaining peers. Each node maintains a per-connection "reconciliation set", the list of transaction IDs it has received since the last reconciliation round with that peer. Periodically, two peers exchange compact sketches of their reconciliation sets and compute the symmetric difference to identify which transactions one has that the other lacks.

The reconciliation process follows these steps. Peers exchange sketches, compute the symmetric difference, and identify the transactions that one has and the other lacks.

The Minisketch Library

Minisketch is an open-source library at the core of Erlay. It implements the PinSketch algorithm, a BCH-code-based secure sketch. Sketch size scales with the number of differences between two sets, not the total set size, so if two peers differ by only 5 transactions out of thousands, the sketch needed to identify those 5 differences is tiny.

Sketch size is calculated as b × c bits, where b is the element bit-width and c is the capacity, the expected number of differences. Sketch creation runs at approximately 5 nanoseconds per element per capacity, so the computational overhead is negligible. Minisketch is roughly 49x faster than the reference PinSketch implementation.

Bandwidth Comparison

Transaction relay bandwidth currently scales as O(nodes × connections) under the flooding model. Every peer connection adds a near-full copy of all transaction announcements. Erlay reduces this to approximately O(nodes), because reconciliation sketch sizes depend on set differences rather than total peer count.

Erlay saves approximately 40% of total transaction relay bandwidth at the current default of 8 outbound connections. Increasing outbound connections to 32, which Erlay makes practical, would raise savings to approximately 75%. Estimates suggest this translates to roughly 100 MB per day per node.

Why It Matters

Transaction relay is one of the largest bandwidth consumers for full nodes. As the Bitcoin network grows and transaction volumes increase, the cost of flooding becomes an increasingly significant barrier to running a node, especially for users with limited bandwidth or data caps.

Erlay directly addresses this by making transaction propagation far more efficient. Its practical benefits extend beyond raw bandwidth savings:

Layer-2 protocols built on Bitcoin need efficient base-layer transaction relay because channel opens, closes, and on-chain settlements all rely on timely transaction propagation. A stronger base layer with broader node participation gives protocols like the Spark protocol and the Lightning Network a firmer foundation.

Enabling Higher Connectivity

Erlay's most significant use case is enabling nodes to increase their peer count without prohibitive bandwidth costs. Research shows that higher connectivity makes the network significantly more resistant to partitioning and eclipse attacks, where an attacker isolates a node by controlling all of its peer connections. Under the current flooding model, increasing connections from 8 to 32 would roughly quadruple transaction relay bandwidth, but Erlay makes this increase practical.

Running Nodes on Constrained Networks

Node operators in regions with metered internet, mobile data caps, or satellite connections benefit directly from reduced bandwidth. The 40% savings at default connectivity could determine whether running a node is feasible. These savings are especially relevant for the growing diversity of node implementations targeting resource-constrained environments.

Improving Transaction Privacy

Flooding enables transaction origin analysis because the first peer to announce a transaction to a node is likely the originator, or close to it. Erlay's reconciliation-based relay makes it harder to determine where a transaction entered the network because most peers learn about transactions through batch reconciliation rather than direct announcements. The result is a modest improvement to transaction-level privacy.

Implementation Status

Erlay is being implemented incrementally in Bitcoin Core rather than as a single large change. The implementation therefore proceeds in stages.

BIP 330 has received concept ACKs from multiple reviewers with no NACKs. No official release timeline has been announced, but active development continues as of 2026. The protocol is designed to be backward-compatible, so nodes that support Erlay negotiate its use with compatible peers and fall back to flooding with older nodes.

Added Propagation Latency

Erlay introduces approximately 0.2 seconds of additional propagation latency for transactions that spread via reconciliation rather than fanout because reconciliation happens periodically rather than immediately. The delay is negligible for most use cases, but the trade-off matters because faster propagation remains important for time-sensitive scenarios like replace-by-fee races. The limited fanout phase mitigates the delay by ensuring initial propagation still happens quickly through a subset of peers.

Reconciliation Failures

A reconciliation round fails if the actual number of set differences exceeds the sketch capacity. Peers must then fall back to exchanging full transaction announcements or requesting a larger sketch, and the protocol must estimate capacity well to keep failure rates low. Research indicates that short reconciliation intervals keep set differences small and predictable in practice.

Backward Compatibility Period

Nodes will maintain both flooding for non-Erlay peers and reconciliation for Erlay peers simultaneously until a significant portion of the network upgrades. Bandwidth savings during this transition period will be proportional to the fraction of peers that support the protocol. Compact blocks were gradually adopted across the network in a similar way.

Protocol Complexity

Erlay adds new message types, per-connection state tracking, and reconciliation scheduling to the peer-to-peer protocol. Each node must maintain reconciliation sets, handle sketch encoding and decoding, and manage fallback logic for failed reconciliation rounds. Careful implementation is required to avoid introducing bugs in the critical transaction relay path.

The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.

0

← All 1876 glossary terms