{"id":23999,"date":"2017-04-20T17:21:42","date_gmt":"2017-04-20T17:21:42","guid":{"rendered":"http:\/\/ci027cfe6b00042697"},"modified":"2017-04-20T17:21:42","modified_gmt":"2017-04-20T17:21:42","slug":"how-extension-blocks-are-backward-compatible-and-how-theyre-not","status":"publish","type":"post","link":"https:\/\/bitcoinmagazine.com\/technical\/how-extension-blocks-are-backward-compatible-and-how-theyre-not","title":{"rendered":"How Bitcoin Extension Blocks Are Backward Compatible \u2014 and How They\u2019re Not"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><figure><img decoding=\"async\" src=\"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/how-bitcoin-extension-blocks-are-backward-compatible-and-how-theyre-not.jpg\" title=\"\"><\/figure>\n<p>Through a splash in the media,<a href=\"https:\/\/purse.io\/\" target=\"_blank\" rel=\"noopener\"> Purse<\/a> and its in-house-built alternative Bitcoin implementation <a href=\"https:\/\/bitcoinmagazine.com\/articles\/bcoin-a-menace-to-the-network-or-an-enrichment-of-the-bitcoin-ecosystem-1476909115\">Bcoin<\/a> recently presented their scaling proposal, dubbed \u201c<a href=\"http:\/\/tothemoon.org\/\" target=\"_blank\" rel=\"noopener\">To the Moon<\/a>.\u201d Where <a href=\"https:\/\/bitcoinxt.software\/\" target=\"_blank\" rel=\"noopener\">Bitcoin XT<\/a>,<a href=\"https:\/\/bitcoinclassic.com\/\" target=\"_blank\" rel=\"noopener\"> Bitcoin Classic<\/a> and <a href=\"https:\/\/www.bitcoinunlimited.info\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Unlimited<\/a> all attempt to increase Bitcoin\u2019s block size limit with a hard fork, and <a href=\"https:\/\/bitcoincore.org\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Core<\/a> developers <a href=\"https:\/\/bitcoincore.org\/en\/2016\/01\/07\/statement\/\" target=\"_blank\" rel=\"noopener\">prefer<\/a> a <a href=\"https:\/\/bitcoinmagazine.com\/articles\/segregated-witness-part-how-a-clever-hack-could-significantly-increase-bitcoin-s-potential-1450553618\">Segregated<\/a><a href=\"https:\/\/bitcoinmagazine.com\/articles\/segregated-witness-part-why-you-should-care-about-a-nitty-gritty-technical-trick-1450827675\"> Witness<\/a><a href=\"https:\/\/bitcoinmagazine.com\/articles\/segregated-witness-part-how-a-soft-fork-might-establish-a-block-size-truce-or-not-1451423607\"> soft fork<\/a> (SegWit), Purse CEO Andrew Lee <a href=\"https:\/\/blog.purse.io\/ready-for-liftoff-a5533f4de0b6?gi=8466de6e39a0\" target=\"_blank\" rel=\"noopener\">announced<\/a> a third approach: extension blocks.<\/p>\n<p>Extension blocks were actually first proposed by Bitcoin Core developer Johnson Lau in <a href=\"https:\/\/bitcointalk.org\/index.php?topic=283746.0\" target=\"_blank\" rel=\"noopener\">2013<\/a> (as \u201cauxiliary blocks\u201d), and again <a href=\"https:\/\/lists.linuxfoundation.org\/pipermail\/bitcoin-dev\/2017-January\/013490.html\" target=\"_blank\" rel=\"noopener\">earlier this year<\/a>. The solution generally shares many of the virtues of hard forks: extension blocks allow for almost any protocol change. But they share one significant benefit with soft forks: extension blocks are backward compatible.<\/p>\n<p>Well, sort of \u2026<\/p>\n<p><strong>Soft Forks<\/strong><\/p>\n<p>Soft forks are protocol changes that add new rules or tighten up existing ones. \u201cOld nodes\u201d \u2014 as we\u2019ll call them for now \u2014 will consider a soft-forked chain valid because it doesn\u2019t break any \u201cold rules.\u201d This makes soft forks backward compatible: they allow old nodes to coexist on the same network with \u201cnew nodes\u201d that enforce the soft fork.<\/p>\n<p>While soft forks can only add or tighten rules, they can be cleverly used to extend Bitcoin\u2019s capabilities. To do this, soft forks typically utilize special Bitcoin addresses known as \u201canyonecanspend.\u201d (They\u2019re actually \u201coutputs,\u201d not addresses, but for simplicity\u2019s sake ignore that for now.)<\/p>\n<p>If these anyonecanspend addresses hold any bitcoins, it means that anyone can spend them; no cryptographic signature or anything else is required \u2026 or so it seems to old nodes.<\/p>\n<p>But that\u2019s not what new nodes, enforcing the new rules, see. The new rules prescribe that the bitcoins in these anyonecanspend addresses can only be spent under specific conditions, defined by the soft fork. These new rules can, for example, prescribe that a certain amount of time must have passed (<a href=\"https:\/\/bitcoinmagazine.com\/articles\/checklocktimeverify-or-how-a-time-lock-patch-will-boost-bitcoin-s-potential-1446658530\">CLTV<\/a>) or that a signature must be included in a new part of a Bitcoin block (SegWit).<\/p>\n<p><strong>Extension Blocks<\/strong><\/p>\n<p>Extension blocks resemble soft forks, but quite literally take the concept to another level.<\/p>\n<p>An extension block itself looks a lot like a normal Bitcoin block, which we\u2019ll call a \u201cbase block.\u201d Like a base block, an extension block mostly includes a bunch of transactions. <\/p>\n<p>But there is a difference. A base block is cryptographically linked to the previous base block and to the next base block, chaining all base blocks chronologically to form Bitcoin\u2019s blockchain. An extension block, on the other hand, links only to one corresponding base block. Extension blocks \u201cpeg along\u201d base blocks.<\/p>\n<p>Similar to most soft forks, extension blocks utilize anyonecanspend addresses. But now, these anyonecanspend addresses act like enter and exit points, to and from the extension blocks.<\/p>\n<p>When a transaction is sent from a base block to an extension block, an old node is tricked. From the perspective of the old node, the coins are sent to a typical anyonecanspend address on the base block. The coins never leave the base block as far as the old node is concerned, and in fact the old node doesn\u2019t even see the extension block.<\/p>\n<p>But from the perspective of a new node, the bitcoins are really sent to a whole new address on the extension block \u2014 an \u201cextension address.\u201d This extension address behaves more or less like a normal Bitcoin address.<\/p>\n<p>Interestingly, these bitcoins can then even start to circulate from extension address to extension address, from one extension block to the next. As such, new nodes see the coins moving around and changing ownership. At the same time, old nodes do not see anything and think the bitcoins are still stuck in the original anyonecanspend address.<\/p>\n<p>A new node can also send the bitcoins from their extension address back to a normal address on the base block. This is done by tricking old nodes again: from the perspective of the old node, the coins are finally moved from the anyonecanspend address. Only a new node knows where the coins really came from.<\/p>\n<p>Once the bitcoins are back in the base block and a normal address, old and new nodes see the same thing.<\/p>\n<p>As perhaps the main benefit of extension blocks, they don\u2019t need to adhere to the original Bitcoin protocol in almost any way. This opens up a whole category of new possibilities. The extension blocks can perhaps offer more programmability like <a href=\"https:\/\/ethereum.org\/\" target=\"_blank\" rel=\"noopener\">Ethereum<\/a> or <a href=\"https:\/\/ethereumclassic.org\/\" target=\"_blank\" rel=\"noopener\">Ethereum Classic<\/a>, or more privacy like <a href=\"https:\/\/web.getmonero.org\/\" target=\"_blank\" rel=\"noopener\">Monero<\/a>,<a href=\"https:\/\/z.cash\/\"> Zcash<\/a> or <a href=\"https:\/\/bitcoinmagazine.com\/articles\/mimblewimble-how-a-stripped-down-version-of-bitcoin-could-improve-privacy-fungibility-and-scalability-all-at-once-1471038001\">Mimblewimble<\/a>.<\/p>\n<p>Bcoin\u2019s proposal is modest, however: \u201cTo the Moon\u201d extension blocks are mostly just bigger than normal blocks (by a so-far unknown amount), so they can handle more transactions. They also include Segregated Witness, and some added benefits specifically crafted to support <a href=\"https:\/\/bitcoinmagazine.com\/articles\/understanding-the-lightning-network-part-building-a-bidirectional-payment-channel-1464710791\">the<\/a><a href=\"https:\/\/bitcoinmagazine.com\/articles\/understanding-the-lightning-network-part-creating-the-network-1465326903\"> lightning<\/a><a href=\"https:\/\/bitcoinmagazine.com\/articles\/understanding-the-lightning-network-part-completing-the-puzzle-and-closing-the-channel-1466178980\"> network<\/a> on top of the extension blocks.<\/p>\n<p><strong>Complexity<\/strong><\/p>\n<p>While extension blocks in general, and To the Moon in particular, can work technically, they do present some drawbacks.<\/p>\n<p>At the heart of these drawbacks, To the Moon is more technically complex than other scaling solutions proposed so far, including all hard forks as well as a Segregated Witness soft fork. This also makes them more complicated to implement.<\/p>\n<p>And from a user perspective, To the Moon would leave old nodes in the dark more than most soft forks do. While old nodes don\u2019t know how coins on soft-forked anyonecanspend addresses can be spent, with extension blocks, old nodes don\u2019t even know where coins are. This means that old nodes can\u2019t trace the history of a coin and perhaps in some cases temporarily can\u2019t even spend it. (This could be the case if a blockchain reorganization takes place; this can cosmetically change what a transaction from an extension block to an old node looks like.)<\/p>\n<p>As such, not everyone loves To the Moon. Johnson Lau, the original proposer of extension blocks, <a href=\"https:\/\/www.mail-archive.com\/bitcoin-dev@lists.linuxfoundation.org\/msg05183.html\" target=\"_blank\" rel=\"noopener\">argues<\/a> that To the Moon \u201cfailed to meet the very important requirement of a softfork: backward compatibility.\u201d He instead still considers extension blocks \u201cmore as an academic topic than something really ready for production use.\u201d Similarly, Bitcoin Core developer and <a href=\"http:\/\/bitcoinknots.org\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Knots<\/a> maintainer Luke Dashjr <a href=\"https:\/\/www.mail-archive.com\/bitcoin-dev@lists.linuxfoundation.org\/msg05040.html\" target=\"_blank\" rel=\"noopener\">warns<\/a> that extension blocks \u201care a risk of creating two classes of \u2018full nodes,\u2019&#8221; where non-upgraded nodes are &#8220;left&nbsp;insecure like pseudo-SPV (not even real SPV) nodes.\u201d And Bitcoin Core developer Matt Corallo <a href=\"https:\/\/www.mail-archive.com\/bitcoin-dev@lists.linuxfoundation.org\/msg04570.html\" target=\"_blank\" rel=\"noopener\">dismisses<\/a> the idea that extension blocks should be considered opt-in at all \u2014 instead \u201cthe entire network is forced to trust the extension block,\u201d a \u201cpretty terrible precedent.\u201d<\/p>\n<p><em>For more discussion on To the Moon, see the <a href=\"https:\/\/www.mail-archive.com\/bitcoin-dev@lists.linuxfoundation.org\/msg05040.html\" target=\"_blank\" rel=\"noopener\">Bitcoin-development mailing list<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Through a splash in the media, Purse and its in-house-built alternative Bitcoin implementation Bcoin recently presented their scaling proposal, dubbed \u201cTo the Moon.\u201d Where Bitcoin XT, Bitcoin Classic and Bitcoin Unlimited all attempt to increase Bitcoin\u2019s block size limit with a hard fork, and Bitcoin Core developers prefer a Segregated Witness soft fork (SegWit), Purse [&hellip;]<\/p>\n","protected":false},"author":2509,"featured_media":24000,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[1662,2306,1079],"class_list":{"0":"post-23999","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-technical","8":"tag-block-size","9":"tag-forks","10":"tag-segwit"},"author_data":{"id":2509,"name":"Aaron van Wirdum","nicename":"aaron-van-wirdum","avatar_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/12\/aaron-van-wirdum-96x96.jpg"},"featured_image_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/how-bitcoin-extension-blocks-are-backward-compatible-and-how-theyre-not.jpg","_links":{"self":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/23999","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\/2509"}],"replies":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/comments?post=23999"}],"version-history":[{"count":0,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/23999\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media\/24000"}],"wp:attachment":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media?parent=23999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/categories?post=23999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/tags?post=23999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}