April 11, 2024
at
12:00 am
EST
MIN READ
Bitcoin has recently had a surge of developments in the ecosystem, with Ordinals leading the way. While this has been a new development in the historically slow-to-evolve Bitcoin ecosystem, increased Ordinals activity has led to a corresponding increase in demand for Bitcoin blockspace. This has caused transaction fees to skyrocket on Bitcoin.
The resulting increase in transaction fees has led builders to revisit the topic of scaling Bitcoin, which has a very low throughput compared to more modern blockchains. Much work has been done on this topic over the years, and now people are starting to take notice after Ordinals have brought Bitcoin back into the spotlight.
While many of the existing Bitcoin Layer 2 solutions use Ethereum’s EVM model, a new alternative non-EVM Bitcoin Layer 2 has emerged. RGB++ Protocol is a new Bitcoin-based protocol that is helping Bitcoin scale by leveraging three factors: Bitcoin’s UTXO model, the Lightning Network’s asset issuance RGB Protocol, and the Nervos blockchain to create native Bitcoin smart contracts. It is a new solution that has been in development by the Nervos team for some time. RGB++ utilizes each of the three pieces of technology and brings them together to create Turing-complete contracts in a manner that is fully compatible with the existing Bitcoin network.
UTXO, or Unspent Transaction Output, is how Bitcoin manages transactions on its blockchain.
Here’s a Beginner’s guide on how it works:
Bitcoin’s UTXO (Unspent Transaction Output) model is how Bitcoin manages transactions on its blockchain. When a transaction is made on Bitcoin, the blockchain splits the transactions into inputs and outputs. The sender of the transaction is creating an “input” of funds from their wallet, and the receiver of the transaction is receiving an “output” funds into their wallet. Thus, the Bitcoin blockchain can’t create a brand new output if there wasn’t already an input inside the sender’s wallet.
There can be multiple UTXOs within a Bitcoin wallet, and all of these UTXOs summed up represent a Bitcoin wallet’s available balance. A common comparison to UTXO is physical cash. When you receive Bitcoin from someone else, you receive an input that is similar to a banknote. When you send a portion of that Bitcoin off to someone else, this essentially splits your input UTXO banknote into two brand new UTXOs. You keep one UTXO input, and your recipient receives the second input. Since sending Bitcoin breaks the original UTXO into two, UTXOs can only be used once.
This then brings us to RGB, a Bitcoin-based smart contract protocol that is built on top of the Lightning Network that is capable of acting as an asset issuance protocol. As an asset issuance protocol, RGB enables digital assets to exist on the Bitcoin blockchain.
The RGB Protocol was originally developed based on Peter Todd’s research on single-use seals and client side verification. Single-use seals are a mechanism that locks a seal on a message, ensuring that the message can only be read/used once. We can take advantage of Bitcoin UTXO’s single-use property and use it as a seal for RGB.
Using single-use seals, the RGB protocol creates tokens that point to a specific corresponding UTXO. Ownership of this corresponding UTXO establishes ownership of the RGB issued asset token. In order to transfer a RGB asset, the holder will need to spend their single-use corresponding UTXO, which consumes the single-use seal. This spend transaction is the only thing that needs to be traced to determine ownership state.
RGB transactions are not verified between Bitcoin nodes the way Bitcoin’s transactions are. Where Bitcoin full-network nodes individually record and verify all transaction data that occurs on Bitcoin, RGB does something different called client side validation. Client side validation is a validation method that brings smart contract code and data off the Bitcoin blockchain. Bringing smart contract code and data off-chain helps free up capacity on the Bitcoin blockchain, allowing other transactions to be processed instead.
With client side validation, users do not need to obtain an entire block’s worth of data, and can focus on only the data they truly need. Users can pass data between themselves, only needing to verify UTXO transaction history that is directly related to their UTXO, which can then be used to backtrack towards the initial state of a contract. After verifying, users will only need to record data related to the transaction and meet Bitcoin’s requirements for on-chain validation.
Under client-side verification, transaction information is only shared between senders and receivers. This means that third parties have difficulty obtaining this information, especially since the data stored by individual users in their clients is unique to each client. There is no way for someone to access all the unique data that is being stored by individuals. Thus, there is a data availability problem.
On RGB, both users must be online at the same time to perform a transfer. Because RGB is built on top of Bitcoin, RGB relies on a P2P network for transactions. When users transfer assets to each other, the users need to interact directly with one another, and receivers need to provide a UTXO invoice before receiving an asset.
Lack of Development: There currently is not a complete solution for interaction with public contracts. This makes it difficult to have transactions with multiple parties using RGB. Additionally, RGB protocol uses AluVM, a relatively new virtual machine. There is a lack of dev tooling and existing codebases to draw upon, hindering overall development of RGB.
Nervos is a Proof of Work blockchain which has one important feature: Cells. Cells are the most basic structure for holding data in Nervos and can not be changed once published to the Nervos blockchain. There are no restrictions for the type of data that a Cell can hold. Cells are also an unspent output like Bitcoin’s UTXO model, which inspired the Cell model.
If a change needs to be made to a Cell, it undergoes a process called consumption, which extracts the data contents and destroys the Cell. A new Cell with updated data can then be published to the blockchain.
Nervos Cells also benefit from parallel computing. Each transaction within a cell runs independently and simultaneously, allowing Cells great scaling potential. Multiple smart contracts can be batched into one transaction. This reduces transaction bloat on Nervos, allowing the chain to run more efficiently.
The Nervos developers released the RGB++ whitepaper. The team proposed RGB++ as an extension protocol that uses single-use seals and client-side verification to manage changes in blockchain state and transaction verification.
In a process called ‘isomorphic binding’, RGB++ uses Bitcoin UTXOs as RGB containers, and maps the UTXOs to Nervos Cells through a message that contains information about the UTXO and its intended operation (ex. state change or asset transfer). When a Bitcoin UTXO is spent, a commitment for the spend is included within the Bitcoin transaction.
This commitment links the Bitcoin transaction to a specific state change or operation on Nervos, which uses a light client to scan and verify Bitcoin block data. Once the light client confirms the inclusion of the Bitcoin transaction that spent the UTXO, the Nervos cell can then be updated to reflect the state change or asset transfer.
As a result, RGB++ transactions will be published to both the BTC and Nervos blockchains. The Nervos blockchain can then act as a validation client, which replaces the client verification process. Users can now check the CKB chain to determine if the state calculation of RGB++ transactions are correct. Since all transactions are published on-chain and not stored individually the way it is with client-side verification, the data availability problem that RGB suffers from is solved.
Because CKB cells can flexibly store data as well as process multiple transactions at once, we can attach multiple CKB transactions to a Bitcoin RGB++ transaction. This essentially allows the slower Bitcoin blockchain to piggyback off of the faster Nervos blockchain, helping increase the low throughput of the Bitcoin blockchain.
The binding of UTXOs to Cells also supports Turing-complete Bitcoin transactions. Under the original RGB Protocol, a user on the receiving end of a transaction needed to be online and provide a live UTXO as an invoice before they could receive an asset. Thus, both users needed to be online in order to complete a transaction. Within a Turing-complete environment, the receiver’s invoice UTXO is no longer needed. As a result, Senders can send without receivers being online with RGB++.
RGB++ bundles together the UTXOs, RGB, and Nervos into one fluid package, allowing for Turing-complete contracts in a data-efficient manner that is compatible with the existing Bitcoin network. RGB++ offers improved programmability and throughput to Bitcoin, and is able to do so using native client verification methods, maintaining security and censorship resistance.
Moving forward, the Nervos team has publicly announced plans to integrate RGB++ with the Lightning Network. Once this is complete, RGB++ assets will be able to exist throughout the Bitcoin ecosystem without a need for a cross-chain bridge.