{"id":19599,"date":"2019-08-09T17:27:45","date_gmt":"2019-08-09T17:27:45","guid":{"rendered":"http:\/\/ci027cfe79600c2697"},"modified":"2025-01-27T21:34:28","modified_gmt":"2025-01-27T21:34:28","slug":"how-the-new-erlay-protocol-could-speed-up-the-bitcoin-network","status":"publish","type":"post","link":"https:\/\/bitcoinmagazine.com\/technical\/how-the-new-erlay-protocol-could-speed-up-the-bitcoin-network","title":{"rendered":"How the New Erlay Protocol Could Speed Up the Bitcoin Network"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><figure><img decoding=\"async\" src=\"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2025\/01\/how-erlay-protocol-could-speed-the-bitcoin-network.jpg\" title=\"\"><\/figure>\n<p>Bitcoin users are more secure if they use full Bitcoin nodes, and the overall Bitcoin network is healthier if they do, too. To encourage this, resource requirements to run a full node should be kept low, including the bandwidth required.<\/p>\n<p>Erlay is a new proposal that could help reduce bandwidth requirements. It was developed by University of British Columbia researchers Gleb Naumenko, Alexandra Fedorova and Ivan Beschastnikh; Blockstream engineer Pieter Wuille; and independent Bitcoin Core contributor Gregory Maxwell.<\/p>\n<p>The proposal recommends an approach that will transmit transaction identifiers more efficiently, thereby reducing the number of messages sent between nodes, while still supporting the transmission of new transactions to all nodes.<\/p>\n<p>Here\u2019s why that is important and how it works.<\/p>\n<h3>The Problem<\/h3>\n<p>When a new bitcoin transaction is broadcast, it must be sent to all nodes on Bitcoin\u2019s peer-to-peer network. Technically, this happens in two steps. First, after receiving a transaction, a node sends a transaction identifier \u2014 the transaction ID \u2014 to all of the peers it\u2019s connected with (except for the one it got the transaction from). All of these peers then check this transaction ID to see if they\u2019ve already received that transaction from another peer. If not, they request the whole transaction from the node that sent the transaction ID. Then, the process repeats: This node sends the transaction ID to all of its peers.<\/p>\n<p>Because nodes share transaction IDs even with peers that have already been sent the transaction, there is a plethora of redundant messages being shared on the Bitcoin network. This redundancy consumes a lot of bandwidth. Notably, 50 percent of the bandwidth required to run a Bitcoin node is presently used for announcing transactions. Another 45 percent of bandwidth is needed for relaying the actual transaction body and 5 percent is needed for various other messages, like block header information. The Erlay research paper estimates that 44 percent of all traffic between Bitcoin nodes consists of redundant messages.&nbsp;<\/p>\n<p>Operating nodes that require a lot of bandwidth may not be affordable for many users and may pose an impediment for them to run full nodes.<\/p>\n<h3>Connectivity and Risks<\/h3>\n<p>A related problem is more subtle.<\/p>\n<p>Bitcoin\u2019s security relies, in part, on the level of connectivity between nodes on the Bitcoin network. If this connectivity is too low \u2014 if nodes don\u2019t connect with enough peers \u2014 it opens the door to \u201ceclipse attacks.\u201d These are attacks in which an attacker controls many IP addresses and uses these to connect to a particular Bitcoin node. If all that node sees are peers controlled by the same attacker, the attacker could essentially create an \u201calternative Bitcoin blockchain,\u201d just for that node alone. This opens the door to a number of attacks.<\/p>\n<p>In their paper, Naumenko, Fedorova, Beschastnikh, Wuille and Maxwell argue that the current connectivity between Bitcoin network nodes is too low to ensure an adequate level of security on the cryptocurrency\u2019s blockchain. A similar conclusion was drawn in a <a href=\"https:\/\/eprint.iacr.org\/2015\/263.pdf\" target=\"_blank\" rel=\"noopener\">paper<\/a> by researchers Ethan Heilman, Alison Kendler, Aviv Zohar and Sharon Goldberg from Boston University and Hebrew University\/MSR Israel.<\/p>\n<p>The problem could be solved by increasing connectivity among Bitcoin nodes on the network. However, as it stands now, this would also significantly increase the bandwidth required by each node: Bandwidth usage currently increases linearly if nodes want to connect to more peers.<\/p>\n<p>A more efficient relay protocol would help.<\/p>\n<h3>Enter Erlay<\/h3>\n<p>To address the problems associated with Bitcoin\u2019s current transaction relay protocol, Naumenko et al. have suggested using Erlay, a new type of transaction dissemination protocol. According to the research they\u2019ve conducted, Erlay could substantially reduce the amount of bandwidth required (by about 40 percent) for maintaining current levels of connectivity between Bitcoin nodes.<\/p>\n<p>The Erlay protocol reduces the number of messages passed between Bitcoin nodes using a solution called \u201c<a href=\"https:\/\/bitcoinmagazine.com\/articles\/synching-data-between-bitcoin-nodes-about-get-easier\">Minisketch<\/a>,\u201d which was previously proposed by Naumenko, Wuille and Maxwell. In addition to transaction IDs, Bitcoin nodes share \u201csketches\u201d of transactions with one another.&nbsp;<\/p>\n<p>This is done in two phases. In the first phase, nodes will share new transaction IDs with their peers, as usual. However, they will select a maximum of eight peers to share it with \u2014 even if they have connections with more peers. In the second phase, nodes instead request a \u201csketch\u201d from their peers.<\/p>\n<p>Such a sketch contains identifiers for all of the transactions that a node has accepted (since the last reconciliation), but in compact form. Using the sketches, a node can figure out which transactions it doesn\u2019t have that its peer does have. Then, it can request only those transactions from those peers that don\u2019t appear in their sketch. This approach consumes far less bandwidth than sharing all of the transaction IDs.<\/p>\n<p>As an additional benefit, the solution would, in many cases, offer more privacy. Because the transactions IDs are initially not shared with all connected nodes, it gets harder for \u201cspy nodes\u201d to monitor the network and trace where a particular transaction originated.<\/p>\n<p>It should be noted that one of the drawbacks to comparing different sketches and finding missing transactions is that it takes a relatively long time (around 2 seconds longer) for a transaction to find its way through the entire network. However, the Bitcoin network averages 10-minute block times, which suggests that this approach is worth the tradeoff, as it could substantially reduce the number of messages that are received by each node.<\/p>\n<h3>Next Steps<\/h3>\n<p>Naumenko intends to draft a Bitcoin Improvement Proposal for Erlay after application developers, software testers and researchers review the protocol\u2019s specification and effectively approve it by not raising any objections. At present, the Erlay protocol is being reviewed by the Bitcoin community, and it might be integrated into the Bitcoin protocol in the foreseeable future.<\/p>\n<p>According to its specifications, the Erlay prototype consists of only 584 lines of code and does not include any non-compatible changes to the existing Bitcoin protocol. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>A forthcoming Bitcoin Improvement Proposal could greatly reduce the bandwidth required to run a full node.<\/p>\n","protected":false},"author":3455,"featured_media":13008,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[1468,227,287,1788,3204,3313],"class_list":["post-19599","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technical","tag-bip","tag-bitcoin-core","tag-blockstream","tag-erlay","tag-gregory-maxwell","tag-pieter-wuille"],"author_data":{"id":3455,"name":"Omar and Aaron","nicename":"omarandaaron","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=robohash&r=g"},"featured_image_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/how-erlay-protocol-could-speed-the-bitcoin-network.jpg","_links":{"self":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/19599","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/users\/3455"}],"replies":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/comments?post=19599"}],"version-history":[{"count":0,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/19599\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media\/13008"}],"wp:attachment":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media?parent=19599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/categories?post=19599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/tags?post=19599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}