Bitcoin Erlay explained

Share this article

Over the last decade, bitcoin has grown from an obscure alternative currency into a burgeoning asset class worth multiple billions, even touching as high as 1 trillion US dollars in market cap at one point. A network that holds that level of purchasing power and clears billion in transactions each month will have to face scrutiny all the time.

This makes security the primary focus of the bitcoin network, and the security of the Bitcoin network depends on connectivity between the nodes. Higher connectivity yields better security which is why running a node is an important part of using bitcoin. Running a node provides the individual with certain privacy and security benefits while also assisting in decentralising the network and adding more eyes to watch over it.

Nodes can be run on anything from an old laptop to a Raspberry Pi, but regardless of the setup, you’re still limited by the software that governs nodes. When you run a bitcoin node, half of the total bandwidth needed to operate the node is used to announce transactions.

Unlike block relays, transaction dissemination has received little attention in prior work and can become a bottleneck for network efficiency. To tackle these bandwidth constraints, a new proposal is in the works known as Erlay.

What is Erlay?

Erlay is a Bitcoin Improvement Proposal focusing on the bandwidth efficiency of relaying unconfirmed transactions between bitcoin full nodes. To understand how this protocol aims to improve the way full nodes broadcast transaction data, we first need to look at how nodes operate today.

In the currently-used bitcoin gossip protocol, full nodes are configured to advertise every new transaction to all of their peers unless they’ve previously received an advertisement about the transaction from that peer.

At a minimum of 32 bytes per advertised txid (transaction IDs) and nodes having a default maximum of 125 peers, this consumes a large amount of redundant bandwidth, given that each node only needs to learn about a transaction from one of its peers.

Why the need for Erlay?

According to research done on bitcoin nodes in the Erlay white paper, transaction relay without Erlay consumes up to 18GB of data per month for a node with eight 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 and thus limit the use of bitcoin nodes in places where they are needed most.

If you’re in a developed country with affordable access to the internet that is reliable and available 24/7, this shouldn’t be an issue for you. However, this is not the reality for most of the world, where bandwidth is costly and unreliable, and, in many cases, users are relying on mobile data connections which can be intermittent even when available.

If nodes continue to use this amount of bandwidth per month, they price out people from running their own nodes and force them to trust third parties.

Bitcoin node distribution – Source: bitnodes.io

Erlays proposed upgrade

Erlay is a two-part proposal that first limits the number of peers to which a node will directly advertise transactions (default: 8).

The second part of Erlay is to create a set reconciliation based on libminisketch with the remainder of its peers to avoid sending the txid of any transactions that the receiving peer has already seen, reducing the need to broadcast redundant information.

Erlay helps nodes scale to larger numbers of peers much better than the current protocol, making it practical for nodes to accept more connections than they do now.

This would improve the robustness of the relay network against both accidental and deliberate network partitions.

How a transaction broadcast works pre-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.

How a transaction broadcast works post-Erlay

Erlay attempts to streamline the communication process between nodes under Erlay public nodes with many peers using flooding to spread transactions quickly. While 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 node bandwidth usage 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.

Erlay is already in progress.

The start of Erlay began back on 26 September 2019 when Pieter Wuille and Gleb Naumenko officially published the BIP. However, it took almost three years to get the proposal approved and implemented

Innovation isn’t all about user-facing features

While it might not sound like the most exciting upgrade to bitcoin, it is an upgrade focusing on a core issue holding back decentralisation and self-sovereign use of the network in different parts of the world, and that is an admirable purist.

While we have been conditioned to celebrate feature sets that are more glamourous, especially as a result of altcoin marketing, where it’s all about smart this and that, in the end, it doesn’t matter how smart a feature or tool is if the underlying network is not secure and robust.

While altcoiners debate on what kind of door handles they would like, bitcoiners are looking at the foundation of the house and saying can we do better? And If they can, they will.

So don’t let anyone tell you that bitcoiners aren’t innovating; bitcoin is improving in ways that not only matter but in ways that make features built above it even more valuable.


Do your own research

If you want to learn more about Erlay on bitcoin, use this article as a jumping-off point and don’t trust what we say as the final say. Take the time to research and check out the resources below.

Disclaimer: This article should not be taken as, and is not intended to provide any investment advice. It is for educational and entertainment purposes only. As of the time posting, the writers may or may not have holdings in some of the coins or tokens they cover. Please conduct your own thorough research before investing in any cryptocurrency, as all investments contain risk. All opinions expressed in these articles are my own and are in no way a reflection of the opinions of The Bitcoin Manual

Leave a Reply

Related articles

You may also be interested in

Bitcoin Miniscript explained

What Is Bitcoin Miniscript?

When you perform a bitcoin transaction, you’re instructing a bitcoin wallet to execute a command on your behalf and provide it with a few parameters,

Bitcoin ordinals explained

What Are Bitcoin Ordinals?

If you’re new to the space or have better things to do with your time, then your first experience with NFTs has had to be

Sign up to our newsletter

Never Miss A Story

Get the latest bitcoin news, articles and resources.

Cookie policy
We use our own and third party cookies to allow us to understand how the site is used and to support our marketing campaigns.