{"id":10633,"date":"2023-04-23T15:54:39","date_gmt":"2023-04-23T15:54:39","guid":{"rendered":"https:\/\/www.bitnovo.com\/blog\/?p=10633"},"modified":"2022-05-17T11:20:34","modified_gmt":"2022-05-17T11:20:34","slug":"bip-118-update-anyprevout","status":"publish","type":"post","link":"https:\/\/www.bitnovo.com\/blog\/en\/bip-118-update-anyprevout","title":{"rendered":"BIP 118 Update (ANYPREVOUT)"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Alternar tabla de contenidos\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ffffff;color:#ffffff\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #ffffff;color:#ffffff\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-118-update-anyprevout\/#sighash_and_transactions\" >Sighash and transactions<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-118-update-anyprevout\/#what_is_bip_118_anyprevout\" >What is BIP 118 (ANYPREVOUT)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-118-update-anyprevout\/#eltoo_and_lightning_network\" >Eltoo and Lightning Network<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-118-update-anyprevout\/#other_uses\" >Other uses<\/a><\/li><\/ul><\/nav><\/div>\n<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Tiempo de lectura:<\/span> <span class=\"rt-time\"> 4<\/span> <span class=\"rt-label rt-postfix\">minutos<\/span><\/span><p><strong>Bitcoin\u00a0<\/strong>is a fascinating world surrounded by people constantly looking for ways to\u00a0<strong>improve it<\/strong>. Improvements can be in the realm of disclosure (as I do myself) or in the technological realm.<\/p>\n<p>&nbsp;<\/p>\n<p>Protocol changes are a very\u00a0<strong>complicated<\/strong>\u00a0topic and can lead to heated discussions. An example of this was the one that took place between 2016 and 2017 with the SegWit2x proposal (we will talk about this another day). If there is one thing we can be sure of, it is that Bitcoin is\u00a0<strong>very difficult to change<\/strong>, and this is possibly its greatest strength.<\/p>\n<p>&nbsp;<\/p>\n<p>That is why changes to Bitcoin are thoroughly\u00a0<strong>reviewed and undergo months of discussion<\/strong>. An important step for a proposal is\u00a0<strong>registration as BIP<\/strong>\u00a0(Bitcoin Improvement Proposal). Today we are going to talk about one of these proposals, precisely what\u00a0<strong>BIP 118<\/strong>\u00a0is about.<\/p>\n<p>But first let\u2019s understand what a<strong>\u00a0sighash flag<\/strong>\u00a0is and how a transaction basically works.<\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h3><span class=\"ez-toc-section\" id=\"sighash_and_transactions\"><\/span><strong>Sighash and transactions<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p><strong>Bitcoin transactions<\/strong>\u00a0consist of\u00a0<strong>unlocking bitcoins<\/strong>\u00a0from one address (proving you are the owner with a digital signature) and\u00a0<strong>locking them in another<\/strong>\u00a0address.<\/p>\n<p>&nbsp;<\/p>\n<p>For example you can have two addresses with bitcoins (belonging to two previous transactions in which they were sent to you). To spend those bitcoins you can make a transaction with two digital signatures for each address and send them wherever you want.<\/p>\n<p>&nbsp;<\/p>\n<p>The \u201c<strong>sighash flag<\/strong>\u201d consists of an identifier that indicates\u00a0<strong>which data must be signed<\/strong>\u00a0to unlock the bitcoins (the SigHash being the information to be signed).<\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div id=\"image_787064403\" class=\"img has-hover x md-x lg-x y md-y lg-y\">\n<div class=\"img-inner dark\"><img fetchpriority=\"high\" decoding=\"async\" class=\"attachment-large size-large lazyloaded\" src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT1.jpg\" sizes=\"(max-width: 768px) 100vw, 768px\" srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT1.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT1-300x205.jpg 300w\" alt=\"Actualizaci\u00f3n-BIP-118-(ANYPREVOUT)\" width=\"768\" height=\"526\" data-srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT1.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT1-300x205.jpg 300w\" data-src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT1.jpg\" data-sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/div>\n<\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h2><span class=\"ez-toc-section\" id=\"what_is_bip_118_anyprevout\"><\/span><strong>What is BIP 118 (ANYPREVOUT)<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>BIP 118 was written in 2017 and was then known as\u00a0<strong>SIGHASH_NOINPUT<\/strong>. This proposal was initially made by\u00a0<strong>the writers of the\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-the-lightning-network\/\">Lightning Network<\/a>\u00a0paper<\/strong>\u00a0(Joseph Poon and Thaddeus Dryja) to solve a problem known as \u201c<strong>transaction malleability<\/strong>\u201d later solved by\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-segwit\/\">SegWit<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>Lightning Network is a protocol that allows bitcoin to be transferred almost\u00a0<strong>instantaneously and with almost no commission<\/strong>. Not for nothing is it the biggest promise for scaling bitcoin to thousands of transactions per second. And despite its slow growth, it has come a long way since\u00a0<strong>its theoretical inception in 2015.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>However, with its advancement, the developers realized that it was still going to be very positive SIGHASH_NOINPUT. Recently, following the development of\u00a0<strong>the new Bitcoin update,\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/all-about-taproot\/\">Taproo<\/a><\/strong>t, it was decided to change the name to SIGHASH_ANYPREVOUT and make it suitable for integration with Taproot addresses.<\/p>\n<p>&nbsp;<\/p>\n<p>What ANYPREVOUT allows, in a nutshell, is to<strong>\u00a0not sign<\/strong>\u00a0the part of the information that refers\u00a0<strong>to the previous transaction<\/strong>. A transaction with this type of sighash flag is not linked to past transactions and can spend\u00a0<strong>any bitcoin<\/strong>\u00a0from addresses with<strong>\u00a0the same public key<\/strong>\u00a0(or conditions for spending).<\/p>\n<p>&nbsp;<\/p>\n<p>Okay, you\u2019ve probably stayed the same, but let\u2019s explain the implications of this.<\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div id=\"image_1055054638\" class=\"img has-hover x md-x lg-x y md-y lg-y\">\n<div class=\"img-inner dark\"><img decoding=\"async\" class=\"attachment-large size-large lazyloaded\" src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT2.jpg\" sizes=\"(max-width: 768px) 100vw, 768px\" srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT2.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT2-300x205.jpg 300w\" alt=\"Actualizaci\u00f3n-BIP-118-(ANYPREVOUT)\" width=\"768\" height=\"526\" data-srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT2.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT2-300x205.jpg 300w\" data-src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-118-ANYPREVOUT2.jpg\" data-sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/div>\n<\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h2><span class=\"ez-toc-section\" id=\"eltoo_and_lightning_network\"><\/span>Eltoo and Lightning Network<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>The biggest implication, and the reason why this proposal is so important, is because it enables a protocol called\u00a0<strong>Eltoo<\/strong>\u00a0(as if we read \u201cL2\u201d in English). Eltoo greatly<strong>\u00a0simplifies and improves Lightning Network.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Lightning uses a construct called\u00a0<strong>payment channels<\/strong>\u00a0where two users can transfer bitcoin off-chain, i.e. without it being a transaction on the blockchain and therefore\u00a0<strong>privately, instantly and without commission.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>In a payment channel t<strong>he balances of two users are updated<\/strong>\u00a0with each\u00a0<strong>off-chain<\/strong>\u00a0transaction. For example Alice has 1 BTC and Bob has 0. Alice can make a transaction to Bob updating the balance so that she keeps 0.5 and Bob keeps 0.5 (i.e. this is a 0.5 transaction).<\/p>\n<p>&nbsp;<\/p>\n<p>The Bitcoin\u00a0<strong>blockchain<\/strong>\u00a0acts as a\u00a0<strong>judge<\/strong>\u00a0in case of a dispute in this protocol. If Alice puts on the blockchain her balance of 1 BTC (which is incorrect because she actually has 0.5 after the transaction), Bob will be able to prove that Alice has cheated and will keep all her money as a penalty. But this makes Lightning users have to\u00a0<strong>accumulate<\/strong>\u00a0more and\u00a0<strong>more information<\/strong>\u00a0in order to settle these\u00a0<strong>disputes<\/strong>, as well as being complex.<\/p>\n<p>&nbsp;<\/p>\n<p>With Eltoo all this\u00a0<strong>complexity disappears<\/strong>\u00a0because the only thing you have to maintain is the\u00a0<strong>last balance<\/strong>\u00a0sheet. You don\u2019t have to keep information for each case as it is the case now. Just keep the<strong>\u00a0last 2 transactions<\/strong>\u00a0(one of them with ANYPREVOUT). If someone cheats you can use the ANYPREVOUT transaction to prove he did it and spend those bitcoins the right way.<\/p>\n<p>&nbsp;<\/p>\n<p>This way the information to be<strong>\u00a0backed up<\/strong>\u00a0is minimal, the protocol is simpler,\u00a0<strong>Lightning can be innovated<\/strong>\u00a0more easily and\u00a0<strong>the risk of losing all your money accidentally due to the penalty that exists now is reduced<\/strong>.<\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h2><span class=\"ez-toc-section\" id=\"other_uses\"><\/span><strong>Other uses<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>Other uses this type of sighash flag can have are \u201c<strong>covenants<\/strong>\u201d that allow for\u00a0<strong>more complex\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-smart-contract\/\">smart contracts<\/a><\/strong>\u00a0(setting out specific ways in which bitcoins should be spent) and\u00a0<strong>blind statechains<\/strong>\u00a0using Eltoo (a scalability solution like Lightning but not entirely without reliance on third parties).<\/p>\n<p>&nbsp;<\/p>\n<p>If implemented, ANYPREVOUT will only be used by this type of protocols so\u00a0<strong>the rest of the users would not be affected<\/strong>. However, although its effect on the blockchain itself is small, it would be a change that would allow a lot of\u00a0<strong>innovation in higher layers<\/strong>\u00a0(scalability solutions such as Lightning).<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Tiempo de lectura:<\/span> <span class=\"rt-time\"> 4<\/span> <span class=\"rt-label rt-postfix\">minutos<\/span><\/span>Bitcoin\u00a0is a fascinating world surrounded by people constantly looking for ways to\u00a0improve it. Improvements can be in the realm of disclosure (as I do myself) or in the technological realm. &nbsp; Protocol changes are a very\u00a0complicated\u00a0topic and can lead to heated discussions. An example of this was the one that took place between 2016 and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":7812,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[185],"tags":[],"class_list":["post-10633","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blockchain-en"],"_links":{"self":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/posts\/10633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/comments?post=10633"}],"version-history":[{"count":0,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/posts\/10633\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/media\/7812"}],"wp:attachment":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/media?parent=10633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/categories?post=10633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/tags?post=10633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}