This research report is co-produced by Infinitas and LK Venture
Author: Echo | Infinitas;Leo | LK Venture
Guidance: Hong Shuning
Introduction
While most people associate BTC with money, it has another important use case that is less well known – smart contracts. Smart contracts are the foundation on which BTC are built, first proposed by Nick Szabo in 1995. This is a computer protocol designed to execute, verify, or execute the negotiation or execution of a contract, the essence of which is a contract rather than code Smart contracts allow for trusted transactions without a third party, enabling an agreement that is automatically trusted, executed automatically without the assistance of a central authority, thus providing a safer and more convenient way to enforce a contract than traditional contracts.
Before exploring the BTC RGB protocol and its potential role in smart contracts, it’s worth mentioning that the concept of smart contracts is somewhat controversial in its own right. Vitalik Buterin, co-founder of ETH, said in 2018 that he regretted referring to the term ‘smart contract’ for ETH’s core functionality. According to Buterin, the term should be chosen with a more technical and prosaic name, such as ‘persistent scripting’, to more accurately reflect its essence as an ongoing executor. This reflects the fact that even among the pioneers in the blockchain space, there are still different views on how to define and understand smart contracts.
In this article, we’ll uncover the world of BTC smart contracts and discuss how they have evolved into vast ecosystems built on top of the web.
What restricts the development of smart contracts?
The concept of the blockchain impossible triangle was coined by Vitalik Buterin, founder of ETH Place, and it refers to the inability to achieve three goals simultaneously on a blockchain: decentralization, security, and scalability. There is also a triangle of impossibility in smart contracts: decentralization, scalability, and Turing completeness. BTC and ETH have many similarities, but due to long-term vision differences and limitations, they become two different blockchain networks.
Comparison chart of BTC and ETH
ETH Fang has long struggled to break through in terms of scalability. ETH has low throughput and slow processing speeds because it prioritizes decentralization and security over scalability (scalability trilemma). It is precisely because ETH Fang has a bottleneck in terms of scalability, even if it has Turing completeness, it is still difficult to call the final form of smart contracts.
How can BTC overcome the scalability challenges of smart contracts?
BTC on-chain scalability has been a long-standing challenge, and to complete a smart contract solution on BTC, either on the BTC main chain or on a BTC layered solution. In recent years, hierarchical solutions that BTC scalability on the chain, such as the RGB protocol, have enabled the rapid iteration of BTC’s smart contract functions and solved the scalability limitations of the impossible triangle.
Blockchains can’t be triangular
BTC smart contracts on the main chain
BTC’s scripting language is too simple, which makes it difficult to deploy complex smart contracts on the base layer. Since its inception, BTC has been designed to be simple and relatively unmodified to ensure the integrity and durability of the blockchain. While protocol upgrades occur on a regular basis, they are not meant to revolutionize the blockchain, but only to provide minor improvements at the edge.
The underlying layer of the BTC still has a lot of basic smart contract functionality.
• Paid Public Key Hash (P2PKH)
Pay-to-Public-Key-Hash is a common contract used to BTC transactions, the script creates a contract executed by a public key and signed by the corresponding private key.
• Multisig
Multisig is a BTC address that requires multiple parties to approve a transaction to complete, and is most commonly used to execute an agreement between parties, where a predefined number of signatures must be collected in order to release funds or perform some other action.
• Hash Timelock Contract (HTLC)
A hash time-locked contract is a conditional BTC transaction with time-limited contingencies. These time limits are hard-coded, BTC are only published at a specific time and date (or block). If certain requirements in the contract are not met by the preset deadline, the transaction will be cancelled.
• Cautionary Journal Contract (DLC)
DLC use oracles to perform trustless peer-to-peer transactions. These oracles are able to evaluate the outcome of real-world events and provide on-chain information to BTC smart contracts. DLC is most often used when two parties involved commit to a monetary agreement based on a future outcome.
• Pay to Taproot (P2TR)
Pay-to-Taproot is a script for sending BTC that introduces Merkle trees and Schnorr signatures. These transactions offer better security, lower transaction fees, and greater flexibility. This form of contract was recently implemented as a result of the Taproot upgrade.
BTC smart contract advantages of layered execution
The BTC layers are unique in that they can introduce new features to the network without any modifications to the main chain. Innovations and other experimental developments can be introduced without changing BTC code, so that the core of the BTC can always be kept simple and unaffected by what is built on it.
All BTC layer transactions are eventually settled on the BTC base layer, which means that the history of each transaction is written to the BTC’s ledger. The degree of verification is what differentiates a blockchain from any other network, and to change the BTC-layer transactions, you need to change the main chain transactions.
Layered execution BTC smart contracts have some key advantages.
• Greater programmability: Layered smart contracts overcome the limited capabilities of BTC scripting languages by accessing their own global state, and the layers can broaden the possibilities for building content on top of BTC.
• Greater scalability: Deploying smart contracts on a scalable solution means that transactions can be processed significantly faster. Currently, the base layer can only process about 5–7 transactions per second. Whereas, a tiered scheme can bundle transactions before sending them to the main chain for final settlement. This dramatically increases the throughput of BTC and its viability as a scalable network with millions of daily transactions.
• Increase efficiency. Improved scalability goes hand in hand with faster transactions and cheaper costs. Shorter block times can speed up confirmations, while transaction costs for hierarchical transactions are significantly lower compared to the main chain. In addition, tiered transactions reduce the clutter that occurs at the base layer and improve the performance of the entire network.
On the other hand, the BTC ecosystem, after the completion of Segregated Witness, will make every effort to develop in the direction of Layer 2 such as the lightning network and sidechain. BTC Layer 1 scaling scheme is highly complex, and it is more accepted by the community to build a new Layer 2 based on BTC Layer 1, which is compatible and does not affect the BTC system, and solves the problem of on-chain congestion. As a result, the imagination of BTC smart contracts falls to Turing completeness.
Why RGB Protocol May Be the Ultimate Form of Smart Contracts?
As a form of BTC layered solution, the RGB protocol has exploded in the smart contract space with great potential to enable future large-scale adoption. Among the BTC layered solutions, the RGB protocol and BitVM are the only two that can achieve a balance of “scalability”, “Turing completeness” and “decentralization”.
RGB is an open-source protocol that executes smart contracts based on the BTC protocol with the help of the Lightning Network (LN). RGB is a protocol built on top of BTC blockchain’s proof-of-work (PoW) consensus layer. It leverages the Lightning Network without requiring protocol modifications, and RGB enables the issuance and management of programmable and private assets. RGB solves the scalability problem by executing a private smart contract between two parties, such as an LN channel. It was developed to improve colored coins and tokenize digital assets BTC blockchain.
Client Verification
One of the core functions of RGB is client-side verification, a concept developed by Peter Todd. Client-side verification is powered by the RGB mode, which is how users create smart contract agreements between parties. This verification method leverages the strength and security of the consensus mechanism of the BTC blockchain, while taking RGB’s smart contract code and data off the blockchain. Due to BTC’s limited ability to support smart contract execution environments, RGB brings execution and verification off-chain to the blockchain, while RGB transactions are not included in BTC or lightning transactions, allowing participants to benefit from the security of the BTC consensus layer while increasing flexibility and scalability.
In addition to storing transaction data off-chain, RGB transactions are also allocated to a set of UTXOs that use one-time seals to close BTC transaction outputs as an additional security measure. The seal prevents two different parties from providing different versions of the same data. As a result, they allow eligible parties to verify the state history of the smart contract.
RGB Smart Contracts, Architecture, and Validation
An RGB smart contract consists of states, actions, and actions that owners and participants can perform to update the state. RGB’s schema defines per-state validation rules at the genesis level, ensuring that each successive state owner uses the same schema to validate history. As a result, the model guarantees social consensus, validation, and smart contract state.
The core validation logic uses Rust – a deterministic smart contract language equivalent to a Turing machine. All contract-specific validation logic runs on the Alluvium Virtual Machine (AluVM, Algorithm & Logical Unit Virtual Machine)—highly deterministic and anomaly-free VMs to provide a platform-independent instruction set.
Other BTC smart contracts that can achieve Turing completeness:
• BitVM: In the October 2023 whitepaper, BitVM uses a Rollups-like idea to execute complex procedures off-chain, and then put key evidence on-chain. It also brings Turing-complete smart contracts to BTC, but BitVM puts forward extremely high requirements for computing power, and only has theoretical executability. Scalability and commercial implementation need to be further understood.
RGB and BitVM to overcome the “impossible triangle” of smart contracts
Summary
BTC is decentralized “digital gold”, and it is also a platform for executing smart contracts. Currently, a large number of BTC are idle. About 76% of the BTC supply remains illiquid with no trading history. With the expansion of smart contracts, there is an opportunity to take BTC productivity to the next level. Through BTC ecosystem protocols such as the RGB protocol that incorporates Turing-complete smart contract functionality, developers can program more smart contracts into the network, accelerating the mainstream adoption of BTC as a store of value and financial services layer.
As a highly decentralized, secure, and long-lasting blockchain, BTC can serve as the basis for more on-chain economic activity in the future. It is believed that in the future BTC may soon become the top ecosystem for the future of smart contracts, decentralized applications, and Web3 infrastructure. In this ever-changing field, the roles and capabilities of BTC are likely to be greater than we currently imagine, as is our understanding of what the term “smart contract” means.
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
Why BTC RGB protocol may be the ultimate form of smart contracts?
This research report is co-produced by Infinitas and LK Venture
Author: Echo | Infinitas;Leo | LK Venture
Guidance: Hong Shuning
Introduction
While most people associate BTC with money, it has another important use case that is less well known – smart contracts. Smart contracts are the foundation on which BTC are built, first proposed by Nick Szabo in 1995. This is a computer protocol designed to execute, verify, or execute the negotiation or execution of a contract, the essence of which is a contract rather than code Smart contracts allow for trusted transactions without a third party, enabling an agreement that is automatically trusted, executed automatically without the assistance of a central authority, thus providing a safer and more convenient way to enforce a contract than traditional contracts.
Before exploring the BTC RGB protocol and its potential role in smart contracts, it’s worth mentioning that the concept of smart contracts is somewhat controversial in its own right. Vitalik Buterin, co-founder of ETH, said in 2018 that he regretted referring to the term ‘smart contract’ for ETH’s core functionality. According to Buterin, the term should be chosen with a more technical and prosaic name, such as ‘persistent scripting’, to more accurately reflect its essence as an ongoing executor. This reflects the fact that even among the pioneers in the blockchain space, there are still different views on how to define and understand smart contracts.
In this article, we’ll uncover the world of BTC smart contracts and discuss how they have evolved into vast ecosystems built on top of the web.
What restricts the development of smart contracts?
The concept of the blockchain impossible triangle was coined by Vitalik Buterin, founder of ETH Place, and it refers to the inability to achieve three goals simultaneously on a blockchain: decentralization, security, and scalability. There is also a triangle of impossibility in smart contracts: decentralization, scalability, and Turing completeness. BTC and ETH have many similarities, but due to long-term vision differences and limitations, they become two different blockchain networks.
Comparison chart of BTC and ETH
ETH Fang has long struggled to break through in terms of scalability. ETH has low throughput and slow processing speeds because it prioritizes decentralization and security over scalability (scalability trilemma). It is precisely because ETH Fang has a bottleneck in terms of scalability, even if it has Turing completeness, it is still difficult to call the final form of smart contracts.
How can BTC overcome the scalability challenges of smart contracts?
BTC on-chain scalability has been a long-standing challenge, and to complete a smart contract solution on BTC, either on the BTC main chain or on a BTC layered solution. In recent years, hierarchical solutions that BTC scalability on the chain, such as the RGB protocol, have enabled the rapid iteration of BTC’s smart contract functions and solved the scalability limitations of the impossible triangle.
Blockchains can’t be triangular
BTC smart contracts on the main chain
BTC’s scripting language is too simple, which makes it difficult to deploy complex smart contracts on the base layer. Since its inception, BTC has been designed to be simple and relatively unmodified to ensure the integrity and durability of the blockchain. While protocol upgrades occur on a regular basis, they are not meant to revolutionize the blockchain, but only to provide minor improvements at the edge.
The underlying layer of the BTC still has a lot of basic smart contract functionality.
• Paid Public Key Hash (P2PKH)
Pay-to-Public-Key-Hash is a common contract used to BTC transactions, the script creates a contract executed by a public key and signed by the corresponding private key.
• Multisig
Multisig is a BTC address that requires multiple parties to approve a transaction to complete, and is most commonly used to execute an agreement between parties, where a predefined number of signatures must be collected in order to release funds or perform some other action.
• Hash Timelock Contract (HTLC)
A hash time-locked contract is a conditional BTC transaction with time-limited contingencies. These time limits are hard-coded, BTC are only published at a specific time and date (or block). If certain requirements in the contract are not met by the preset deadline, the transaction will be cancelled.
• Cautionary Journal Contract (DLC)
DLC use oracles to perform trustless peer-to-peer transactions. These oracles are able to evaluate the outcome of real-world events and provide on-chain information to BTC smart contracts. DLC is most often used when two parties involved commit to a monetary agreement based on a future outcome.
• Pay to Taproot (P2TR)
Pay-to-Taproot is a script for sending BTC that introduces Merkle trees and Schnorr signatures. These transactions offer better security, lower transaction fees, and greater flexibility. This form of contract was recently implemented as a result of the Taproot upgrade.
BTC smart contract advantages of layered execution
The BTC layers are unique in that they can introduce new features to the network without any modifications to the main chain. Innovations and other experimental developments can be introduced without changing BTC code, so that the core of the BTC can always be kept simple and unaffected by what is built on it.
All BTC layer transactions are eventually settled on the BTC base layer, which means that the history of each transaction is written to the BTC’s ledger. The degree of verification is what differentiates a blockchain from any other network, and to change the BTC-layer transactions, you need to change the main chain transactions.
Layered execution BTC smart contracts have some key advantages.
• Greater programmability: Layered smart contracts overcome the limited capabilities of BTC scripting languages by accessing their own global state, and the layers can broaden the possibilities for building content on top of BTC.
• Greater scalability: Deploying smart contracts on a scalable solution means that transactions can be processed significantly faster. Currently, the base layer can only process about 5–7 transactions per second. Whereas, a tiered scheme can bundle transactions before sending them to the main chain for final settlement. This dramatically increases the throughput of BTC and its viability as a scalable network with millions of daily transactions.
• Increase efficiency. Improved scalability goes hand in hand with faster transactions and cheaper costs. Shorter block times can speed up confirmations, while transaction costs for hierarchical transactions are significantly lower compared to the main chain. In addition, tiered transactions reduce the clutter that occurs at the base layer and improve the performance of the entire network.
On the other hand, the BTC ecosystem, after the completion of Segregated Witness, will make every effort to develop in the direction of Layer 2 such as the lightning network and sidechain. BTC Layer 1 scaling scheme is highly complex, and it is more accepted by the community to build a new Layer 2 based on BTC Layer 1, which is compatible and does not affect the BTC system, and solves the problem of on-chain congestion. As a result, the imagination of BTC smart contracts falls to Turing completeness.
Why RGB Protocol May Be the Ultimate Form of Smart Contracts?
As a form of BTC layered solution, the RGB protocol has exploded in the smart contract space with great potential to enable future large-scale adoption. Among the BTC layered solutions, the RGB protocol and BitVM are the only two that can achieve a balance of “scalability”, “Turing completeness” and “decentralization”.
RGB is an open-source protocol that executes smart contracts based on the BTC protocol with the help of the Lightning Network (LN). RGB is a protocol built on top of BTC blockchain’s proof-of-work (PoW) consensus layer. It leverages the Lightning Network without requiring protocol modifications, and RGB enables the issuance and management of programmable and private assets. RGB solves the scalability problem by executing a private smart contract between two parties, such as an LN channel. It was developed to improve colored coins and tokenize digital assets BTC blockchain.
Client Verification
One of the core functions of RGB is client-side verification, a concept developed by Peter Todd. Client-side verification is powered by the RGB mode, which is how users create smart contract agreements between parties. This verification method leverages the strength and security of the consensus mechanism of the BTC blockchain, while taking RGB’s smart contract code and data off the blockchain. Due to BTC’s limited ability to support smart contract execution environments, RGB brings execution and verification off-chain to the blockchain, while RGB transactions are not included in BTC or lightning transactions, allowing participants to benefit from the security of the BTC consensus layer while increasing flexibility and scalability.
In addition to storing transaction data off-chain, RGB transactions are also allocated to a set of UTXOs that use one-time seals to close BTC transaction outputs as an additional security measure. The seal prevents two different parties from providing different versions of the same data. As a result, they allow eligible parties to verify the state history of the smart contract.
RGB Smart Contracts, Architecture, and Validation
An RGB smart contract consists of states, actions, and actions that owners and participants can perform to update the state. RGB’s schema defines per-state validation rules at the genesis level, ensuring that each successive state owner uses the same schema to validate history. As a result, the model guarantees social consensus, validation, and smart contract state.
The core validation logic uses Rust – a deterministic smart contract language equivalent to a Turing machine. All contract-specific validation logic runs on the Alluvium Virtual Machine (AluVM, Algorithm & Logical Unit Virtual Machine)—highly deterministic and anomaly-free VMs to provide a platform-independent instruction set.
Other BTC smart contracts that can achieve Turing completeness:
• BitVM: In the October 2023 whitepaper, BitVM uses a Rollups-like idea to execute complex procedures off-chain, and then put key evidence on-chain. It also brings Turing-complete smart contracts to BTC, but BitVM puts forward extremely high requirements for computing power, and only has theoretical executability. Scalability and commercial implementation need to be further understood.
RGB and BitVM to overcome the “impossible triangle” of smart contracts
Summary
BTC is decentralized “digital gold”, and it is also a platform for executing smart contracts. Currently, a large number of BTC are idle. About 76% of the BTC supply remains illiquid with no trading history. With the expansion of smart contracts, there is an opportunity to take BTC productivity to the next level. Through BTC ecosystem protocols such as the RGB protocol that incorporates Turing-complete smart contract functionality, developers can program more smart contracts into the network, accelerating the mainstream adoption of BTC as a store of value and financial services layer.
As a highly decentralized, secure, and long-lasting blockchain, BTC can serve as the basis for more on-chain economic activity in the future. It is believed that in the future BTC may soon become the top ecosystem for the future of smart contracts, decentralized applications, and Web3 infrastructure. In this ever-changing field, the roles and capabilities of BTC are likely to be greater than we currently imagine, as is our understanding of what the term “smart contract” means.