{"id":27369,"date":"2023-12-27T09:20:01","date_gmt":"2023-12-27T09:20:01","guid":{"rendered":"https:\/\/financialtelegraph.in\/index.php\/2023\/12\/27\/coinex-institution-bitvm-the-potential-of-smart-contracts-on-the-bitcoin-mainnet\/"},"modified":"2023-12-27T09:20:01","modified_gmt":"2023-12-27T09:20:01","slug":"coinex-institution-bitvm-the-potential-of-smart-contracts-on-the-bitcoin-mainnet","status":"publish","type":"post","link":"https:\/\/financialtelegraph.in\/index.php\/2023\/12\/27\/coinex-institution-bitvm-the-potential-of-smart-contracts-on-the-bitcoin-mainnet\/","title":{"rendered":"CoinEx Institution: BitVM, the Potential of Smart Contracts on the Bitcoin Mainnet"},"content":{"rendered":"<div>\n<p><img width=\"1200\" height=\"900\" src=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/1-227.jpg\" class=\"attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/1-227.jpg 1200w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/1-227-300x225.jpg 300w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/1-227-1024x768.jpg 1024w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/1-227-768x576.jpg 768w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/1-227-150x113.jpg 150w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/1-227-450x338.jpg 450w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\"><\/p>\n<p><strong>New Delhi (India), December 27<\/strong>: On October 9, Robin Linus, a developer from ZeroSync, released the BitVM whitepaper, which attracted huge attention from the community. BitVM introduces a new computing paradigm capable of expressing Turing-complete Bitcoin contracts without requiring modifications to the network\u2019s consensus rules.\u00a0<\/p>\n<p><strong>Decentralized Smart Contracts: Limitations and Goals<\/strong><\/p>\n<p>Bitcoin\u2019s Script, a stack-based language, provides fundamental control structures, such as conditional checks, for defining the validation logic of transactions. It demands valid digital signatures to spend bitcoins through a simple process of conditional validation. That said, the Script was designed to be non-Turing complete. Although it doesn\u2019t support complex flow control features like loops, this design ensures simplicity and security of the language. Such limitations have made it challenging for Script to execute complex computations, including those involving smart contracts.<\/p>\n<p>While some Layer 2 solutions designed for Bitcoin can achieve basic smart contract functions by locking up assets, they essentially rely on multi-signature addresses and cross-chain asset mappings, which require a certain level of centralized trust. This compromises Bitcoin\u2019s commitment to decentralization. Prior to the introduction of BitVM, the Bitcoin community had been exploring methods that would be decentralized, trust-minimized, and capable of Turing-complete computations.<\/p>\n<p><strong>BitVM: Compute Anything on Bitcoin<\/strong><\/p>\n<p>At the core of its innovation, BitVM utilizes Bitcoin\u2019s existing Script system to implement logic gates (this includes AND gates, OR gates, NOT gates, and XOR gates, enabling operations like AND, OR, NOT, and XOR) to build arbitrarily complex Boolean circuits. These circuits are used to perform logic operations on binary inputs and give binary outputs; Boolean computation can be implemented using logic gates to carry out operations like AND, OR, NOT, and XOR. Specifically, BitVM employs Hash Time Locked Contracts (HTLC) and Taproot (a soft fork for optimizing Script activated in November 2021) to represent fundamental logic gates, such as AND and OR gates. BitVM then combines these basic logic gates to construct circuits of any complexity, essentially simulating a programmable computer on the Bitcoin blockchain.<\/p>\n<p>Finally, in the event of disputes between transacting parties, an elegant challenge-response protocol, similar to fraud proofs on Bitcoin, can be employed for validation. A prover makes a claim that a given function evaluates for some particular inputs to some specific output. If that claim is false, then the verifier can perform a fraud-proof and punish the prover. Using this mechanism, any computable function can be verified on Bitcoin.<\/p>\n<p><strong>BitVM\u2019s Design<\/strong><\/p>\n<p><strong>Bit Value Commitment<\/strong><\/p>\n<p>Bit Value Commitment, a Bitcoin script, employs if-else statements to implement a commitment scheme. This cryptographic primitive makes sure that the sender can confirm the message\u2019s content before sending it, and the content cannot be altered once it\u2019s publicly disclosed. This commitment scheme encompasses two hash values, hash0 and hash1. Whether the returned value will be 0 or 1 is determined by comparing the hash value of the input to these two hash values.<\/p>\n<p>Figure 1: A concrete implementation for a 1-bit commitment<\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/2-71-1024x768-1.jpg\" alt=\"\" class=\"wp-image-18741\" srcset=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/2-71-1024x768-1.jpg 1024w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/2-71-300x225.jpg 300w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/2-71-768x576.jpg 768w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/2-71-150x113.jpg 150w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/2-71-450x338.jpg 450w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/2-71.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/figure>\n<p>Source:\u00a0<a href=\"https:\/\/bitvm.org\/bitvm.pdf\">https:\/\/bitvm.org\/bitvm.pdf<\/a><\/p>\n<p><strong>Logic Gate Commitment<\/strong><\/p>\n<p>In the theory of computation, any computable function can be represented as a Boolean circuit. In particular, the NAND gate is a universal logic gate that can be used to build all other complex logic gates. BitVM incorporates two bit value commitments representing the two inputs and a third bit value commitment representing the output to implement the NAND gate.<\/p>\n<p>BitVM ingeniously expresses the NAND gate through Bitcoin scripts. This allows it to build arbitrarily complex Boolean logic circuits, effectively simulating a programmable computer via Script.<\/p>\n<p>Figure 2: Implementation of a NAND gate using bit value commitments<\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/3-13-1024x768-1.jpg\" alt=\"\" class=\"wp-image-18742\" srcset=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/3-13-1024x768-1.jpg 1024w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/3-13-300x225.jpg 300w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/3-13-768x576.jpg 768w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/3-13-150x113.jpg 150w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/3-13-450x338.jpg 450w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/3-13.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/figure>\n<p>Source:\u00a0<a href=\"https:\/\/biquanlibai.notion.site\/BitVM-2b8557e0ea004d0cbc52951782bc9754\">https:\/\/biquanlibai.notion.site\/BitVM-2b8557e0ea004d0cbc52951782bc9754<\/a>\u00a0\u00a0<\/p>\n<p>Figure 3: Logic gate commitment for a NAND operation<\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/4-2-1024x768-1.jpg\" alt=\"\" class=\"wp-image-18743\" srcset=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/4-2-1024x768-1.jpg 1024w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/4-2-300x225.jpg 300w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/4-2-768x576.jpg 768w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/4-2-150x113.jpg 150w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/4-2-450x338.jpg 450w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/4-2.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/figure>\n<p>Source:\u00a0<a href=\"https:\/\/bitvm.org\/bitvm.pdf\">https:\/\/bitvm.org\/bitvm.pdf<\/a><\/p>\n<p>The script computes the NAND value of the two inputs to ensure that it matches the committed output bit.<\/p>\n<p><strong>Binary Circuit Commitment<\/strong><\/p>\n<p>BitVM\u00a0can express any circuit by composing gate commitments. Every step of the execution is committed to in a Tapleaf. They are all combined into the same Taproot address, such that the prover can execute any gate in the circuit. Executing a gate requires the prover to open the corresponding gate commitment and set values for its inputs and output bits. For instance, in Figure 4, A, B, C, and D are predefined bit value commitments, each representing a bit. Logic operations involving the eight NAND gates are then carried out. For example, if A NAND B yield E, and E is used as the input for the next NAND gate, the final output of the entire circuit will be TRUE. This design of Boolean circuits connects the NAND gates of bit value commitments and achieves complex logic operations, offering a compact representation for verifiable computation on the Bitcoin blockchain.<\/p>\n<p>Figure 4: A circuit with eight different NAND gates<\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/5-2-1024x768-1.jpg\" alt=\"\" class=\"wp-image-18744\" srcset=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/5-2-1024x768-1.jpg 1024w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/5-2-300x225.jpg 300w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/5-2-768x576.jpg 768w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/5-2-150x113.jpg 150w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/5-2-450x338.jpg 450w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/5-2.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/figure>\n<p>Source:\u00a0<a href=\"https:\/\/bitvm.org\/bitvm.pdf\">https:\/\/bitvm.org\/bitvm.pdf<\/a><\/p>\n<p><strong>Challenges and Responses<\/strong><\/p>\n<p>In BitVM, committing to one circuit is not enough, and a challenge-response mechanism is required to prove the correctness of computations. To achieve that, the prover and the verifier should pre-sign a sequence of transactions during setup. The transactions are linked in the order of \u201cchallenge \u2013 response \u2013 challenge \u2013 response\u201d, creating multiple rounds of challenge-and-response interactions. If one of the parties stops engaging then, after timeout, the other party wins the challenge and can take both deposits. This mechanism is required only in case of fraud. As long as both parties are cooperative, they can jointly settle any contract with a 2-of-2 signature.\u00a0<\/p>\n<p>Let\u2019s see how this mechanism works in a hypothetical case. Paul (prover) and Vicky (verifier) pre-signed a sequence of transactions. Vicky can then initiate a challenge (TX 2) by selecting a challenge (hash7) from one of the hashlocks in her Tapscript leaves. This unlocks for Paul a specific Tapscript and forces him to execute it, with open inputs and outputs. Any inconsistent claim can be disproven quickly by repeating this procedure for a few rounds of queries. If the prover stops collaborating, the verifier can unlock a hash preimage he holds to force the prover to respond on-chain. Each round of queries may validate or disprove a specific gate. Through binary search (an algorithm used to locate a specific element in a sorted array), the verifier can quickly identify the prover\u2019s error after just a few rounds of challenge-and-response. Once the prover\u2019s two commitments conflict, the verifier immediately wins the challenge and takes the deposit.<\/p>\n<p>Figure 5: A pre-signed sequence of transactions to perform multiple rounds of challenge-and-response<\/p>\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/6-1-1024x768-1.jpg\" alt=\"\" class=\"wp-image-18745\" srcset=\"https:\/\/financialtelegraph.in\/wp-content\/uploads\/2023\/12\/6-1-1024x768-1.jpg 1024w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/6-1-300x225.jpg 300w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/6-1-768x576.jpg 768w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/6-1-150x113.jpg 150w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/6-1-450x338.jpg 450w, https:\/\/pnndigital.com\/wp-content\/uploads\/2023\/12\/6-1.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/figure>\n<p>Source:\u00a0<a href=\"https:\/\/bitvm.org\/bitvm.pdf\">https:\/\/bitvm.org\/bitvm.pdf<\/a><\/p>\n<p>This meticulous design allows BitVM to perform on-chain verification of any complex computation, which ensures the efficiency of collaboration and imposes penalties in the event of fraud. It demonstrates the possibility of verifying Turing-complete interactive computation in the Bitcoin network.<\/p>\n<p>Key Aspects of BitVM\u2019s Design<\/p>\n<p>Off-chain Computation &amp; On-chain Verification<\/p>\n<p>BitVM places the burden of complex computation off the blockchain, reserving the Bitcoin blockchain for the sole purpose of verifying results. This approach avoids running complex contracts directly on the blockchain, which mitigates blockchain bloat.<\/p>\n<p>Logic Gates Expressed with Hashlocks and Bitcoin Scripts<\/p>\n<p>BitVM leverages hashlocks and script opcodes supported by Bitcoin to represent basic logic gates, such as AND and NOT gates. Connecting these logic gates allows it to build circuits of arbitrary complexity, enabling Turing-complete computation.<\/p>\n<p>A Game Theory Mechanism for the Prover and the Verifier<\/p>\n<p>BitVM\u2019s validation mechanism, which resembles Optimistic Rollup, involves interactive challenges and responses between the parties of the computation. Ultimately, the correct computation result is confirmed on-chain. If the prover cheated, the verifier could execute penalties on the Bitcoin blockchain. As such, BitVM and Optimistic Rollup employ similar interaction mechanisms for on-chain verification, and the only difference is that BitVM directly uses Bitcoin scripts to implement an interactive challenge-response process.<\/p>\n<p>Minimal On-chain Impact<\/p>\n<p>BitVM\u2019s computation process has minimal impact on the Bitcoin blockchain, leaving only a small number of transactions on-chain when disputes arise. This preserves the efficiency and scalability of Bitcoin.<\/p>\n<p>No Need for Soft Forks<\/p>\n<p>As BitVM only utilizes existing Bitcoin script capabilities, it does not require any modifications to the Bitcoin protocol through soft forks. This makes it easier for BitVM to be integrated into the Bitcoin mainnet.<\/p>\n<p>Conclusion<\/p>\n<p>BitVM\u2019s biggest innovation lies in its ability to implement Turing-complete verification without modifying the core Bitcoin protocol; it achieves this by making creative use of scripts, especially the ones optimized by Taproot. This ingenious design enables seamless integration with the Bitcoin mainnet without introducing new compatibility issues or making Bitcoin less decentralized.<\/p>\n<p>BitVM\u2019s innovative solution holds the potential to introduce smart contracts and decentralized applications to the Bitcoin ecosystem. For instance, it can be used to build minimal-trust cross-chain bridges to connect different blockchain assets, enhancing Bitcoin\u2019s interoperability. Additionally, BitVM can also help build more efficient zkRollup expansion layers to make Bitcoin more scalable. In a nutshell, BitVM showcases the vast possibilities of driving the Bitcoin ecosystem into a new era only through the innovative utilization of existing features.<\/p>\n<p>References<\/p>\n<p><a href=\"https:\/\/bitvm.org\/bitvm.pdf\">https:\/\/bitvm.org\/bitvm.pdf<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/supertestnet\/tapleaf-circuits\">https:\/\/github.com\/supertestnet\/tapleaf-circuits<\/a><\/p>\n<p><a href=\"https:\/\/biquanlibai.notion.site\/BitVM-2b8557e0ea004d0cbc52951782bc9754\">https:\/\/biquanlibai.notion.site\/BitVM-2b8557e0ea004d0cbc52951782bc9754<\/a><\/p>\n<p>About CoinEx<\/p>\n<p>Established in 2017,\u00a0<a href=\"http:\/\/www.coinex.com\/\">CoinEx<\/a>\u00a0is a global cryptocurrency exchange committed to making trading easier. The platform provides a range of services, including spot and margin trading, futures, swaps, automated market maker (AMM), and financial management services for over 5 million users across 200+ countries and regions. Founded with the initial intention of creating an equal and respectful cryptocurrency environment, CoinEx is dedicated to dismantling traditional finance barriers by offering easy-to-use products and services to make crypto trading accessible for everyone.<\/p>\n<p>If you have any objection to this press release content, kindly contact pr.error.rectification@gmail.com to notify us. We will respond and rectify the situation in the next 24 hours.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>New Delhi (India), December 27: On October 9, Robin Linus, a developer from ZeroSync, released the BitVM whitepaper, which attracted huge attention from the community. BitVM introduces a new computing &hellip; <a href=\"https:\/\/financialtelegraph.in\/index.php\/2023\/12\/27\/coinex-institution-bitvm-the-potential-of-smart-contracts-on-the-bitcoin-mainnet\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":27370,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[448],"class_list":["post-27369","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-business","tag-business","entry"],"_links":{"self":[{"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/posts\/27369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/comments?post=27369"}],"version-history":[{"count":0,"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/posts\/27369\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/media\/27370"}],"wp:attachment":[{"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/media?parent=27369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/categories?post=27369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/financialtelegraph.in\/index.php\/wp-json\/wp\/v2\/tags?post=27369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}