2 min read
Erlay is an upgrade to Bitcoin Core’s peer-to-peer networking functionality, which decreases the bandwidth used to relay transactions between nodes. Part of Erlay is already implemented, with more planned to follow.
How Transaction Broadcasting Worked Before Erlay
Before Erlay, when a new transaction was broadcast to the Bitcoin network, it was sent from the broadcasting node to its peer nodes. These peers each sent the transaction out to all of their peers. This process, called flooding, continued until all nodes in the network had received the transaction. The benefit of this was that making all nodes aware of new transactions was very fast, but it came at the cost of each node receiving the transaction multiple times. This redundancy used up a lot of unnecessary bandwidth.
According to the Erlay white paper, transaction relay without Erlay consumes up to 18GB of data per month for a node with 8 outbound connections. A node with up to 24 outbound connections could consume up to 50GB of bandwidth per month. This makes running a node far more costly for individuals who do not have access to, or can not afford, Internet connections that support this bandwidth usage.
Transaction Broadcasting After Erlay
Erlay attempts to streamline the communication process between nodes. With Erlay, public nodes with many peers use flooding to spread transactions quickly. However, private nodes, which receive information from nodes but do not broadcast information, will not participate in flooding. Instead, they will send batches of transactions to peers to learn the transactions known to the other side and reconcile the differences. This more efficient approach aims to reduce bandwidth usage for nodes by 40%.
This method attempts to find an optimal compromise between latency and bandwidth and preserves privacy for nodes. One major privacy goal in Bitcoin’s peer-to-peer design is that it should be difficult to determine from which node a transaction originated. By mixing flooding and batching, and having private nodes only use batching, Erlay aims to fortify peer-to-peer privacy.