{"id":10605,"date":"2023-07-12T17:28:11","date_gmt":"2023-07-12T17:28:11","guid":{"rendered":"https:\/\/www.bitnovo.com\/blog\/?p=10605"},"modified":"2022-05-17T10:56:31","modified_gmt":"2022-05-17T10:56:31","slug":"bip-119-update-op_ctv","status":"publish","type":"post","link":"https:\/\/www.bitnovo.com\/blog\/en\/bip-119-update-op_ctv","title":{"rendered":"BIP 119 Update (OP_CTV)"},"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' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-119-update-op_ctv\/#check_template_verify\" >Check Template Verify<\/a><\/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-119-update-op_ctv\/#what_are_the_possible_uses_of_op_ctv\" >What are the possible uses of OP_CTV?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-119-update-op_ctv\/#combating_network_congestion\" >Combating network congestion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-119-update-op_ctv\/#at_lightning_network\" >At Lightning Network<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-119-update-op_ctv\/#vaults_and_coinjoins\" >Vaults and Coinjoins<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-119-update-op_ctv\/#sapio_a_language_based_on_op_ctv\" >Sapio, a language based on OP_CTV<\/a><\/li><\/ul><\/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>In the journey to<strong>\u00a0improve Bitcoin<\/strong>\u00a0there are many paths to follow. Every developer has a\u00a0<strong>vision of what Bitcoin should look<\/strong>\u00a0like and patiently works towards it. But Bitcoin is\u00a0<strong>very difficult to change<\/strong>, and this is not a bad thing. On the contrary, its greatest value comes from its immutability.<\/p>\n<p>&nbsp;<\/p>\n<p>Consensus has recently been reached to activate the\u00a0<strong><a href=\"https:\/\/www.bitnovo.com\/blog\/en\/all-about-taproot\/\">Taproot<\/a>\u00a0upgrade<\/strong>, a proposal that has been in the works for years. From this, discussion on\u00a0<strong>new proposals<\/strong>\u00a0has resumed in the more technical community.<\/p>\n<p>&nbsp;<\/p>\n<p>Bitcoin improvements are proposed in\u00a0<strong>BIPs, (Bitcoin Improvement Proposals)<\/strong>. We recently discussed\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/bip-118-update-anyprevout\/\">BIP 118<\/a>, and I\u2019ll explain what<strong>\u00a0BIP 119<\/strong>\u00a0is. This proposal, also called\u00a0<strong>OP_CHECKTEMPLATEVERIFY<\/strong>, or simply\u00a0<strong>OP_CTV<\/strong>, has received a lot of attention and is likely to end up in Bitcoin.<\/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=\"check_template_verify\"><\/span><strong>Check Template Verify<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>The proposal consists of a new\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-an-op_code-quick-guide-for-your-blockchain\/\">Opcode<\/a>, an operator for the<strong>\u00a0Bitcoin language<\/strong>. In the\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-bitcoin-script\/\">Bitcoin Script<\/a>\u00a0there are some operators that are useless, the\u00a0<strong>OP_NOP<\/strong>. These were introduced by\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/who-is-satoshi-nakamoto\/\">Satoshi<\/a>\u00a0to\u00a0<strong>allow updates in the future<\/strong>\u00a0and so far 3 have been used.<\/p>\n<p>&nbsp;<\/p>\n<p>With this trader you can build\u00a0<strong>\u201ccovenants\u201d, a very peculiar type of transactions<\/strong>. In Bitcoin, coins are\u00a0<strong>locked in<\/strong>\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-utxo-in-bitcoin\/\">UTXOs<\/a>, a set of rules about what is needed to unlock and spend them.<\/p>\n<p>&nbsp;<\/p>\n<p>For example, a<strong>\u00a0UTXO may require<\/strong>\u00a0a person to have\u00a0<strong>a private key to spend its coins<\/strong>. This is the most common case, where a person proves by means of a\u00a0<strong>digital signature<\/strong>\u00a0the possession of that private key. Therefore, if you don\u2019t have your private keys, you don\u2019t have your Bitcoin.<\/p>\n<p>&nbsp;<\/p>\n<p>The conditions of<strong>\u00a0what is needed to spend<\/strong>\u00a0some coins can be more complex, but they\u00a0<strong>do not enter into how to spend<\/strong>\u00a0them. With covenants, the condition of how they should be spent can be added.<\/p>\n<p>&nbsp;<\/p>\n<p>In other words,\u00a0<strong>without OP_CTV<\/strong>\u00a0a user can\u00a0<strong>spend coins in any way when unlocking them. With OP_CTV<\/strong>\u00a0an additional condition is\u00a0<strong>how they are to be spent<\/strong>. Covenants restrict how coins will be spent, and can open doors to\u00a0<strong>really complex smart contracts.<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>But, as\u00a0<strong>Jeremy Rubin<\/strong>\u00a0(the developer behind BIP 119) explains, covenants\u00a0<strong>add risks and have been controversial<\/strong>\u00a0as a result. One of those risks is that some coins may be subject to conditions in perpetuity,\u00a0<strong>worsening Bitcoin\u2019s fungibility<\/strong>. That is,\u00a0<strong>not all coins are worth the same<\/strong>\u00a0because there are some with\u00a0<strong>restrictions<\/strong>\u00a0on their use. Jeremy\u2019s implementation does not have the risk of restricting some coins forever, and it is\u00a0<strong>simpler and safer<\/strong>\u00a0than other forms of covenant.<\/p>\n<p>&nbsp;<\/p>\n<p>The logic is that when constructing a covenant,\u00a0<strong>information about the future transaction<\/strong>\u00a0should be recorded. This is the\u00a0<strong>template<\/strong>\u00a0against which the future transaction is checked. If the transaction that spends those coins does not match the template, then it will be invalid.<\/p>\n<p>&nbsp;<\/p>\n<p>In this simple way we record, as a\u00a0<strong>condition<\/strong>, that a\u00a0<strong>specific transaction<\/strong>\u00a0(not any other) must be carried out in order to<strong>\u00a0spend some coins<\/strong>. Let\u2019s see some uses 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_24379860\" 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-119-OP_CTV2.jpg\" sizes=\"(max-width: 768px) 100vw, 768px\" srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV2.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV2-300x205.jpg 300w\" alt=\"Actualizaci\u00f3n BIP 119 (OP_CTV)\" width=\"768\" height=\"526\" data-srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV2.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV2-300x205.jpg 300w\" data-src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV2.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_are_the_possible_uses_of_op_ctv\"><\/span><strong>What are the possible uses of OP_CTV?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>An implementation of BIP 119 in Bitcoin, would open the doors for new uses and advantages. Some of them could be:<\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h3><span class=\"ez-toc-section\" id=\"combating_network_congestion\"><\/span><strong>Combating network congestion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>One<strong>\u00a0high-value use<\/strong>\u00a0for Bitcoin is as a tool to\u00a0<strong>reduce network congestion<\/strong>. We already know that when there is a<strong>\u00a0lot of\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-are-network-fees\/\">demand for transactions<\/a><\/strong>\u00a0(usually in a bull market)\u00a0<strong>transactions accumulate<\/strong>\u00a0on hold (in the mempool). For market effects, transactions must\u00a0<strong>pay more commission to be included<\/strong>\u00a0at that time.<\/p>\n<p>&nbsp;<\/p>\n<p>One way to combat this is with OP_CTV. We can send\u00a0<strong>coins from many users<\/strong>\u00a0in a group to\u00a0<strong>a UTXO<\/strong>\u00a0where the transactions needed to spend it are recorded.<\/p>\n<p>&nbsp;<\/p>\n<p>Let\u2019s imagine that an<strong>\u00a0exchange<\/strong>\u00a0wants to send money to\u00a0<strong>different users<\/strong>, but there is a lot of\u00a0<strong>network congestion<\/strong>\u00a0at that moment. What it does is to send the coins to\u00a0<strong>a single UTXO<\/strong>\u00a0(a single address)\u00a0<strong>using the OP_CTV<\/strong>. When\u00a0<strong>the congestion is reduced<\/strong>, that UTXO can be spent in the preset way, according to the<strong>\u00a0template<\/strong>\u00a0(sending to all users).<\/p>\n<p>&nbsp;<\/p>\n<p>This can be thought of as a cheaper<strong>\u00a0intermediate transaction<\/strong>, which ends up in the\u00a0<strong>final transaction<\/strong>\u00a0when\u00a0<strong>commissions are already low<\/strong>. The savings in commissions and congestion can be very significant according to Jeremy Rubin\u2019s simulations.<\/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_1699161176\" 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-119-OP_CTV.jpg\" sizes=\"(max-width: 768px) 100vw, 768px\" srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV-300x205.jpg 300w\" alt=\"Actualizaci\u00f3n BIP 119 (OP_CTV)\" width=\"768\" height=\"526\" data-srcset=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV.jpg 768w, https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV-300x205.jpg 300w\" data-src=\"https:\/\/www.bitnovo.com\/blog\/wp-content\/uploads\/2021\/07\/Actualizacion-BIP-119-OP_CTV.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<h3><span class=\"ez-toc-section\" id=\"at_lightning_network\"><\/span><strong>At Lightning Network<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>OP_CTV can also be used for\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-the-lightning-network\/\">Lightning Network<\/a>, Bitcoin\u2019s<strong>\u00a0scalability solution<\/strong>\u00a0that allows thousands of transactions per second with low fees. Lightning Network is a set of constructs called\u00a0<strong>payment channels<\/strong>, which allow<strong>\u00a0two users<\/strong>\u00a0to maintain\u00a0<strong>independent balances<\/strong>\u00a0to the blockchain.<\/p>\n<p>&nbsp;<\/p>\n<p>One use is<strong>\u00a0channel factories<\/strong>, which allow<strong>\u00a0many participants<\/strong>\u00a0to use a single Lightning channel (currently only two participants). This allows Lightning to\u00a0<strong>scale<\/strong>\u00a0much more, enabling millions of people to use it. Channel factories would also be\u00a0<strong>possible with BIP 118<\/strong>, although in this form they have different features.<\/p>\n<p>&nbsp;<\/p>\n<p>In addition, these covenants can be used to\u00a0<strong>create non interactive channels<\/strong>\u00a0that allow for more convenient and independent channel management and, thanks to the congestion tool,<strong>\u00a0improve network efficiency.<\/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<h3><span class=\"ez-toc-section\" id=\"vaults_and_coinjoins\"><\/span>Vaults and Coinjoins<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>Other uses of OP_CTV are\u00a0<strong>vaults<\/strong>\u00a0for\u00a0<strong>better security<\/strong>\u00a0and cheaper\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-coinjoin\/\">coinjoins<\/a>\u00a0(a privacy technique in Bitcoin).<\/p>\n<div class=\"is-divider divider clearfix\"><\/div>\n<div class=\"is-divider divider clearfix\"><\/div>\n<h3><span class=\"ez-toc-section\" id=\"sapio_a_language_based_on_op_ctv\"><\/span><strong>Sapio, a language based on OP_CTV<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"is-divider divider clearfix\"><\/div>\n<p>Jeremy Rubin has also developed a\u00a0<strong>language<\/strong>\u00a0for\u00a0<strong>Bitcoin programming<\/strong>\u00a0called\u00a0<strong>Sapio<\/strong>. Sapio uses BIP 119 to create smart contracts in Bitcoin and has the potential to challenge the \u201cBitcoin can\u2019t have complex smart contracts\u201d statement.<\/p>\n<p>&nbsp;<\/p>\n<p>Sapio is currently used in Bitcoin by means of an\u00a0<a href=\"https:\/\/www.bitnovo.com\/blog\/en\/what-is-a-blockchain-oracle\/\">oracle<\/a>\u00a0that allows to\u00a0<strong>emulate OP_CTV<\/strong>. Should this proposal move forward and end up in Bitcoin, Sapio could be used\u00a0<strong>to its full potential and without trust<\/strong>\u00a0(without relying on third parties like oracles).<\/p>\n<p>&nbsp;<\/p>\n<p>BIP 119 could be a<strong>\u00a0key enabler<\/strong>\u00a0of more applications and\u00a0<strong>innovation on Bitcoin<\/strong>. And thanks to Sapio, its potential would be much\u00a0<strong>more accessible to programmers<\/strong>\u00a0who want to build on Bitcoin.<\/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>In the journey to\u00a0improve Bitcoin\u00a0there are many paths to follow. Every developer has a\u00a0vision of what Bitcoin should look\u00a0like and patiently works towards it. But Bitcoin is\u00a0very difficult to change, and this is not a bad thing. On the contrary, its greatest value comes from its immutability. &nbsp; Consensus has recently been reached to activate [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":7736,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-10605","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-criptomonedas"],"_links":{"self":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/posts\/10605","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=10605"}],"version-history":[{"count":0,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/posts\/10605\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/media\/7736"}],"wp:attachment":[{"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/media?parent=10605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/categories?post=10605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bitnovo.com\/blog\/wp-json\/wp\/v2\/tags?post=10605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}