Introduction
Bitcoin's security is fundamentally tied to its network connectivity. High connectivity among nodes makes it significantly harder for attackers to isolate specific nodes, a technique known as an "Eclipse attack." However, the current transaction relay protocol, known as diffusion, relies on a flooding mechanism where every node announces every transaction it receives to all its neighbors.
This approach is increasingly inefficient. As connectivity increases, bandwidth consumption scales linearly. Transaction announcements currently account for nearly half of a node's total bandwidth. For many users, the cost of maintaining high connectivity becomes prohibitive, which could lead to network centralization as only well-resourced entities can afford to run nodes. Research indicates that in the current protocol, approximately 88% of announcement bandwidth is redundant, as nodes are frequently informed about transactions they already possess.
The Erlay Protocol
To address these scalability and security concerns, the researchers propose Erlay, a new transaction relay protocol that significantly reduces bandwidth overhead. Erlay moves away from pure flooding by implementing a two-tier approach that balances speed and efficiency:
- Low-fanout flooding: Instead of broadcasting to all peers, a node "floods" transaction announcements to a small, fixed number of outbound peers (typically 8). This ensures that transactions propagate through the network quickly.
- Set Reconciliation: To ensure all nodes eventually receive every transaction, nodes periodically sync their transaction pools. Using the PinSketch algorithm (implemented in the Minisketch library), nodes can efficiently compute the difference between their transaction sets with minimal data exchange.
If set reconciliation fails due to an underestimated number of differences, the protocol employs a bisection method to identify missing transactions before reverting to standard relay methods. This hybrid approach finds a "sweet spot" between the high bandwidth of pure flooding and the high latency of pure reconciliation.
Methodology
The performance of Erlay was evaluated through both large-scale simulations and real-world deployment. Using a modified ns3 Bitcoin Simulator, the researchers modeled a network of 60,000 nodes (6,000 public and 54,000 private) to test scalability and resistance to attacks. Additionally, Erlay was implemented in Bitcoin Core and tested on a 100-node network distributed across six global Azure data centers to measure performance in a realistic environment.
Key Results and Discussion
The evaluation demonstrates that Erlay provides substantial improvements over the current protocol:
- Bandwidth Efficiency: Erlay reduces transaction announcement bandwidth by 84%, leading to a 40% reduction in total node bandwidth.
- Scalability: Unlike the current protocol, Erlay's bandwidth usage remains nearly constant as connectivity increases. This makes connections "cheaper," allowing nodes to safely increase connectivity and harden the network against attacks.
- Latency Trade-off: The protocol introduces a minor increase in propagation latency, averaging roughly 2.6 seconds. Given Bitcoin's 10-minute block interval, this delay is negligible for network operations.
- Enhanced Privacy: By reducing the number of nodes to which a transaction is flooded, Erlay makes it more difficult for malicious actors to use "first-spy" estimators to deanonymize the origin of a transaction.
Conclusion
Erlay represents a significant step forward for Bitcoin's network layer. By optimizing transaction relay, it allows for higher network connectivity at a fraction of the current bandwidth cost, thereby enhancing both the security and decentralization of the network. While future work may address more sophisticated timing attacks and further optimize computational costs, Erlay provides a robust and backward-compatible solution for modern blockchain scaling.
Summary updated