By Echo | Infinitas; Leo | LK Venture
Guidance: Hong Shuning

While Bitcoin is commonly associated with money, it also has a lesser-known but equally important use case - smart contracts. Smart contracts form the foundation of Bitcoin and were first proposed by Nick Szabo in 1995. They are computer protocols designed to execute, verify or enforce contract negotiations or executions, essentially acting as a contract rather than code. Smart contracts enable trusted transactions without third parties and can facilitate self-executing agreements without central authority intervention, providing a safer and more convenient alternative to traditional contracts. Before delving into Bitcoin's RGB protocol and its potential role in smart contracts, it's worth noting that the concept of smart contracts remains somewhat controversial. In 2018, Vitalik Buterin (co-founder of Ethereum) expressed regret over using the term "smart contract" for Ethereum's core functionality. He believes that a more technical name such as 'persistent script' would better reflect its nature as an ongoing program execution process. This highlights how even pioneers in blockchain technology have differing views on defining and understanding smart contracts. In this article, we will explore the world of Bitcoin smart contracts and discuss their evolution into an extensive ecosystem built upon the network.
The concept of the Impossible Triangle introduced by Ethereum founder Vitalik Buterin refers to three goals that cannot be achieved simultaneously on a blockchain: decentralization, security, and scalability. Similarly, smart contracts face their own impossible triangle: decentralization, scalability and Turing completeness. While there are many similarities between Bitcoin and Ethereum due to differences in long-term vision limitations; they have become two distinct entities.

The scalability of Ethereum has been a persistent challenge, as it prioritizes decentralization and security over high throughput and fast processing (known as the scalability trilemma). Due to these inherent limitations in scalability, even though Ethereum is Turing complete, determining the ultimate form of smart contracts remains challenging.
The scalability issue has long plagued the Bitcoin chain, and in order to implement the smart contract scheme on Bitcoin, it can be either developed on the Bitcoin main chain or through a layered solution. Recently emerged scalable layered solutions on the Bitcoin chain, such as the RGB protocol, enable rapid iteration of Bitcoin's smart contract functionality and address the scalability limitations posed by the impossible triangle.

The scripting language of Bitcoin, known as Script, is relatively simplistic, which poses challenges in deploying complex smart contracts at the base layer. Since its inception, Bitcoin has been designed to prioritize simplicity and minimal modifications to ensure the integrity and durability of its blockchain. While protocol upgrades are regularly implemented, they aim to provide incremental improvements rather than revolutionize the blockchain itself. Nevertheless, the underlying layer of Bitcoin still supports several fundamental smart contract functionalities.
- Paid Public Key Hash (P2PKH):
Pay-to-Public-Key-Hash is a commonly used contract for bitcoin transactions that involves a script executed by a public key and a signature generated by the corresponding private key.
- Multisig:
Multisig refers to a type of Bitcoin address that requires multiple parties' approval for transaction completion. It is primarily utilized in executing agreements between parties where a predefined number of signatures must be collected before funds can be released or specific actions performed.
- Hash Time Lock Contract (HTLC):
A hash time lock contract represents a conditional Bitcoin transaction with time-limited contingencies. These predetermined time limits restrict BTC release only at certain times or dates (or blocks). If the specified requirements within the contract are not met by the preset deadline, the transaction will be canceled.
- Prudent Log Contract (DLC):
DLC employs prophecy machines to facilitate trustless peer-to-peer transactions within Bitcoin's ecosystem. These prophecy machines possess capabilities to evaluate real-world event outcomes and provide on-chain information for smart contracts involving Bitcoins. DLC finds frequent application when two involved parties commit to monetary agreements based on future outcomes.
- Pay to Taproot (P2TR)
Pay-to-Taproot is a script for sending bitcoins 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.
Bitcoin layers are unique in that they can introduce new functions to the network without making any modifications to the main chain. Innovations and other experimental developments can be introduced without changing the Bitcoin code, so that the core of Bitcoin can always remain simple and unaffected by what is built on top of it.All Bitcoin layer transactions are ultimately settled on the Bitcoin base layer, which means that the history of each transaction is written into Bitcoin's ledger. The degree of verification is what distinguishes blockchain from any other network, and to change a Bitcoin layer transaction, you change a mainchain transaction.Bitcoin smart contracts that execute in layers have some key advantages.Greater programmability: Layered smart contracts overcome the limited capabilities of the Bitcoin scripting language by accessing their own global state, and layers can broaden the possibilities of building content on top of Bitcoin.
- Higher scalability: Deploying smart contracts on scalable solutions means that transactions can be processed significantly faster. Currently, the base layer can only process about 5-7 transactions per second. And tiered schemes can bundle transactions before they are sent to the main chain for final settlement. This greatly increases the throughput of Bitcoin and its viability as a scalable network with millions of daily transactions.
- Improve efficiency. Improved scalability goes hand in hand with faster transactions and cheaper costs. The shorter block time can speed up confirmation, while the transaction cost of layered transactions is significantly reduced compared to the main chain. In addition, layered transactions reduce the clutter that occurs at the base layer and improve the performance of the entire network.
- In contrast, the Bitcoin ecology, after the completion of the isolation witness, has fully developed in the direction of lightning network, side chain and other Layer2. The complexity of Bitcoin Layer1 expansion scheme is high, and more accepted by the community is to build a new Layer2 based on Bitcoin Layer1, which is compatible and does not affect the Bitcoin system, while solving the problem of congestion on the chain. So the imaginative space for Bitcoin smart contracts falls to Turing completeness.
As a form of Bitcoin's layered solution, the RGB protocol has great potential for future large-scale applications in the field of smart contracts. In the Bitcoin layering solution, the RGB protocol and BitVM are the only two that can achieve the balance of "scalability", "Turing completeness" and "decentralization".RGB is an open source protocol based on Bitcoin, using the Lightning Network (LN) to execute smart contracts. RGB is a protocol built on top of the Bitcoin blockchain proof-of-work (PoW) consensus layer. It uses the Lightning network without the need to modify the protocol, and uses RGB to distribute and manage programmable and private assets. RGB addresses scalability issues by executing private smart contracts between two parties, such as LN channels. It was developed to improve colored coins and tokenize digital assets on the Bitcoin blockchain.
One of the core functions of RGB is client-side validation, a concept introduced by Peter Todd. Client 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 Bitcoin blockchain consensus mechanism while taking RGB smart contract code and data off the blockchain. Due to Bitcoin's limited ability to support a smart contract execution environment, RGB brings execution and verification under the blockchain chain, while RGB transactions are not included in Bitcoin or lightning transactions, allowing participants to benefit from the security of the Bitcoin consensus layer while increasing flexibility and scalability.In addition to storing transaction data off-chain, RGB transactions are also assigned to UTXO sets that use one-time seals to turn off the Bitcoin transaction output as another security measure. Sealing prevents two different parties from providing different versions of the same data. As such, they allow eligible parties to verify the status history of the smart contract.
RGB smart contracts consist of states, actions that owners and participants can perform to update the state. RGB's Schema defines each state validation rule at the genesis level, ensuring that each successive state owner uses the same Schema to validate the history. Thus, the model guarantees social consensus, verification, and smart contract status.The core validation logic uses Rust, a deterministic smart contract language equivalent to Turing machines. All contract-specific validation logic is run on the Alluvium Virtual Machine (AluVM, Algorithm & Logical Unit Virtual Machine) - a highly deterministic and exception-free VM that provides a platform-independent instruction set.Other Bitcoin smart contracts that can be Turing-complete:
- BitVM: White paper released in October 2023, BitVM uses Rollups-like ideas to execute complex programs off-chain, and then put key evidence on the chain. The same Turing-complete smart contract that brought Bitcoin to life, BitVM has extremely high demands on computing power and is only theoretically executable. Scalability and commercial landing need to be further understood.
Bitcoin is a decentralized "digital gold" that is also a platform for executing smart contracts. Right now, a lot of bitcoins are sitting idle. About 76% of the Bitcoin supply remains illiquid, with no transaction history. With the expansion of smart contracts, there is an opportunity to take bitcoin productivity to new levels. Through Bitcoin eco-protocols that incorporate Turing-complete smart contract capabilities, such as the RGB protocol, developers can program more smart contracts into the network, accelerating mainstream adoption of Bitcoin as a store of value and a financial services layer.As a highly decentralized, secure, and durable blockchain, Bitcoin could serve as the basis for more on-chain economic activity in the future. Bitcoin may soon become the top ecosystem for the future of smart contracts, decentralized applications, and Web3 infrastructure. In this ever-changing space, Bitcoin's role and capabilities may grow beyond our current imagination, as our understanding of the meaning of the term "smart contract" continues to evolve and deepen.
https://coinexsmartchain.medium.com/innovative-csc-to-challenge-an-impossible-trinity-in-blockchain-technology-9ff86aa0192ehttps://bitcoinist.com/vitalik-buterin-ethereum-regret-smart-contracts/https://zhuanlan.zhihu.com/p/264882173https://www.plus500.com/zh/instruments/ethusd/what-is-the-difference-between-ethereum-and-bitcoin~2
All Comments