{"id":24123,"date":"2017-03-27T16:51:46","date_gmt":"2017-03-27T16:51:46","guid":{"rendered":"http:\/\/ci027cfe7840062697"},"modified":"2017-03-27T16:51:46","modified_gmt":"2017-03-27T16:51:46","slug":"how-light-clients-can-protect-themselves-coin-split","status":"publish","type":"post","link":"https:\/\/bitcoinmagazine.com\/technical\/how-light-clients-can-protect-themselves-coin-split","title":{"rendered":"How Light Clients Can Protect Themselves From a Bitcoin Coin-Split"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><figure><img decoding=\"async\" src=\"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/how-light-clients-can-protect-themselves-from-a-bitcoin-coin-split.jpg\" title=\"\"><\/figure>\n<p>Bitcoin could soon <a href=\"https:\/\/bitcoinmagazine.com\/articles\/beginners-guide-surviving-coin-split\">split in two<\/a>. If <a href=\"https:\/\/www.bitcoinunlimited.info\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Unlimited<\/a> miners start mining blocks exceeding one megabyte, these would be rejected by full Bitcoin nodes like <a href=\"https:\/\/bitcoincore.org\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Core<\/a> and <a href=\"http:\/\/bitcoinknots.org\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Knots<\/a>. This could result in two different and incompatible blockchains and networks, each with their own currency: Bitcoin\u2019s \u201cBTC\u201d and Bitcoin Unlimited\u2019s \u201cBTU.\u201d<\/p>\n<p>While full nodes would know which protocol to follow, for many light clients \u2014 like almost all mobile wallets \u2014 things would not be so clear. One type of light client in particular, Simplified Payment Verification (SPV) wallets, often rely on data received from random nodes. These could be Bitcoin nodes or Bitcoin Unlimited nodes. Therefore, users will have no way of knowing whether they\u2019re seeing BTC or BTU in their wallet interface. They could inadvertently accept one currency, while thinking they\u2019re accepting the other.<\/p>\n<p>But a recent <a href=\"https:\/\/github.com\/bitcoin\/bips\/blob\/master\/bip-0180.mediawiki\" target=\"_blank\" rel=\"noopener\">Bitcoin Improvement Proposal<\/a> by Bitcoin Knots maintainer and Bitcoin Core developer Luke Dashjr can solve this.<\/p>\n<p><strong>Simplified Payment Verification<\/strong><\/p>\n<p>Simplified Payment Verification was first described by Satoshi Nakamoto in the <a href=\"https:\/\/bitcoin.org\/bitcoin.pdf\" target=\"_blank\" rel=\"noopener\">Bitcoin white paper<\/a>. SPV wallets do connect to Bitcoin\u2019s peer-to-peer network directly, but request only a bare minimum of data. They currently check blocks for proof of work to make sure these aren\u2019t created out of thin air. And to calculate their balance, they check if any bitcoins were sent to or from their specific Bitcoin addresses.<\/p>\n<p>The problem with SPV wallets is that they can be fooled by miners. For example, a miner could create a block that has a valid proof of work but which spends bitcoins that don\u2019t belong to the miner. The SPV wallet has no idea that these bitcoins don\u2019t belong to the miner, so it would accept the transaction as a valid payment.<\/p>\n<p>Likewise, an SPV wallet doesn\u2019t check for Bitcoin\u2019s block size limit. So, if a split happens, these wallets will check for proof of work but won\u2019t know that a block is invalid according to the (current) Bitcoin protocol. If Bitcoin Unlimited has the longest chain by proof of work, and an SPV wallet receives data from at least one Bitcoin Unlimited node, it blindly follows the Bitcoin Unlimited chain instead.<\/p>\n<p>As an unfortunate consequence, this means that users of SPV wallets could unknowingly accept BTU, when they think they\u2019re accepting BTC. Their wallet can\u2019t tell the difference, and if they are not paying attention to Bitcoin\u2019s scaling debate, they may not even know there was a split. It\u2019s only when they spend their coins, deposit them in a different wallet or send them to an exchange that they\u2019ll find out they don\u2019t own any BTC; they own BTU. Or more accurately: they owned BTU, and now they have to hope that the merchant, the other wallet or the exchange accepts BTU or returns it to them.<\/p>\n<p>And that\u2019s not taking into account that the Bitcoin Unlimited chain may at some point be <a href=\"https:\/\/bitcoinmagazine.com\/articles\/how-bitcoin-unlimited-users-may-end-different-blockchains\">discarded altogether<\/a>. If that were to happen, their coins would suddenly disappear from their wallet.<\/p>\n<p><strong>Fraud Proofs<\/strong><\/p>\n<p>In the Bitcoin white paper, Satoshi Nakamoto proposed a solution for these attack vectors. If a full node detects an invalid block, Nakamoto suggested, it should send an \u201calert\u201d to SPV nodes. This solution has not been developed, however, and it is unclear whether it really can be.<\/p>\n<p>This explains why some Bitcoin developers have always been wary of the current implementation of SPV wallets. And perhaps <a href=\"https:\/\/twitter.com\/iamjosephyoung\/status\/792628300115881984\/photo\/1\" target=\"_blank\" rel=\"noopener\">none more<\/a> than Luke Dashjr. (Dashjr even refers to these wallets as \u201cpseudo-SPV\u201d or \u201cpSPV\u201d; he believes their lack of security doesn\u2019t warrant the term \u201cSPV\u201d as described in the Bitcoin white paper.)<\/p>\n<p>Now, Dashjr is proposing a partial fix to the problem, specifically designed for the block size limit. Digging into the weeds of Bitcoin\u2019s hashing algorithm, the Bitcoin developer thinks he has figured out a way to determine whether a block exceeds one megabyte with only the proof of work hash, and a sort of alert first suggested by Nakamoto (now called a \u201cfraud proof\u201d). While an SPV wallet won\u2019t know the exact size, it will know when a block exceeds one megabyte.<\/p>\n<p>These fraud proofs will need to be sent from full nodes, like Bitcoin Core or Bitcoin Knots. Once at least about a quarter of all Bitcoin nodes on the network have upgraded to provide fraud proofs, SPV nodes that have integrated the solution should connect to at least one of them and be relatively reliable.<\/p>\n<p><em>For some discussion and more information, see the <a href=\"https:\/\/www.mail-archive.com\/bitcoin-dev@lists.linuxfoundation.org\/msg04815.html\" target=\"_blank\" rel=\"noopener\">Bitcoin-dev mailing list<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bitcoin could soon split in two. If Bitcoin Unlimited miners start mining blocks exceeding one megabyte, these would be rejected by full Bitcoin nodes like Bitcoin Core and Bitcoin Knots. This could result in two different and incompatible blockchains and networks, each with their own currency: Bitcoin\u2019s \u201cBTC\u201d and Bitcoin Unlimited\u2019s \u201cBTU.\u201d While full nodes [&hellip;]<\/p>\n","protected":false},"author":2509,"featured_media":24124,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[3568,1662,3469],"class_list":{"0":"post-24123","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-technical","8":"tag-bitcoin-unlimited","9":"tag-block-size","10":"tag-coin-split"},"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-light-clients-can-protect-themselves-from-a-bitcoin-coin-split.jpg","_links":{"self":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/24123","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=24123"}],"version-history":[{"count":0,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/24123\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media\/24124"}],"wp:attachment":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media?parent=24123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/categories?post=24123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/tags?post=24123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}