Author: Kernel Ventures Jerry Luo

Reviewers: Kernel Ventures Mandy, Kernel Ventures Joshua

TLDR:

There are many smart contract solutions on the Bitcoin network today, the most mainstream of which are the Ordinals protocol and the RGB protocol.

  • The birth of the Ordinals protocol enables the development of smart contracts on the Bitcoin network and binds its security to the Bitcoin blockchain. However, the confirmation and recording of Ordinals asset transfers are performed on the Bitcoin mainnet and are tied to the transfer of 1 sats. This brings high handling fees and also makes the Bitcoin mainnet with low TPS more congested.

  • In the RGB protocol, off-chain channels and batch packaging transactions are proposed. These methods significantly reduce the handling fees of asset transfers in RGB and increase the speed. At the same time, the client verification method also greatly reduces the amount of data recorded to maintain normal network operation, thereby improving network scalability.

  • Although the RGB protocol improves transaction speed and scalability through the above methods, it also brings many new problems. Off-chain channels optimize transaction fees and speed while bringing security issues with off-chain records. Client-side verification reduces the amount of recorded data and also greatly slows down the verification speed.

This article compares Ordinals and RGB protocols from the dimensions of security, scalability, transaction fees, transaction speed, etc., and analyzes the possible future direction of RGB narrative.

1. Market Overview

Currently, BTC accounts for about 49% of the market value of the entire crypto market. However, due to the fact that its scripting language does not have Turing completeness, the main network smart contract is missing and the transaction speed is slow, its long-term development is seriously hindered. In order to improve the above problems, Bitcoin developers have made a lot of attempts to expand and speed up, mainly the following 4 solutions:

  • RGB protocol: RGB is a second-layer protocol built on the Bitcoin network, and its core transaction data is stored on the BTC main network. RGB leverages Bitcoin’s security model to enable the creation of tokens with custom properties and smart contract functionality on the Bitcoin network. In 2016, the RGB protocol was first proposed by Peter Todd; in 2023, amid the development boom of the smart contract ecosystem on Bitcoin, the RGB protocol received attention again.

  • Segregated Witness: In August 2017, Bitcoin implemented the Segregated Witness (SegWit) upgrade. By separating transaction information and signature information, the effective block size is increased from 1M to 4M, which alleviates the congestion problem to a certain extent. However, due to the limitation of the size of the Bitcoin block itself, we cannot infinitely expand the storage information of a block. Therefore, the method of improving efficiency by expanding the capacity of block storage information ends here.

  • Lightning Network: Lightning Network is a second-layer expansion solution based on Bitcoin, which allows transactions to be performed without accessing the blockchain, greatly improving throughput. The Lightning Network has been implemented on the Bitcoin mainnet, and existing Lightning Network solutions include OmniBOLT, Stacks, etc. However, the Lightning Network faces greater centralization risks.

  • Side chain technology: Side chain technology is to build a side chain outside the Bitcoin network, and the assets on the side chain are anchored to BTC at a ratio of 1:1. Sidechains have greatly improved transaction performance compared to the mainnet, but they can never reach the security of the BTC mainnet.

Image source: Dune

Since March this year, the transaction fees of the Bitcoin network and the transaction volume of BRC20 protocol assets have experienced a surge. BTC mainnet transaction fees reached their peak in early May. Although transaction fees have declined since then, the transaction volume of BRC20 assets has remained at a high level. This means that the development enthusiasm of the Bitcoin network smart contract ecosystem has not slumped with the decline in the popularity of inscriptions in the BTC ecosystem. Developers continue to try to find the optimal solution for the development of Bitcoin network smart contracts.

2. Ordinals Agreement

2.1 Satoshi edition

Satoshi on the Bitcoin network is different from wei on Ethereum, which is recorded in the form of data. It is calculated by the UTXO owned by each address. In order to distinguish different sats, we must first distinguish different UTXOs, and then distinguish sats under the same UTXO. The former is relatively simple. Different UTXOs are mined in different blocks, which will correspond to different block heights. Only mining produces the initial sats, so only the UTXO in the coinbase transaction is numbered. The main difficulty lies in how to number sats under the same UTXO. The Ordinals protocol proposes a new solution, which is numbering based on the first-in-first-out principle.

  • Distinguishing different UTXOs: BTC Builder starts recording when UTXO is mined. Each UTXO corresponds to a unique block, and each block has a unique block height on the Bitcoin network. Through different block heights Different UTXOs can be distinguished.

  • The distinction between sats under the same UTXO: First, the approximate range of sats under UTXO can be determined through the block height. For example, the earliest block can mine 100 BTC, which is $$10^{10}$$ sats, then the corresponding area In a block with a block height of 0, the sats number is [0,$$10^{10}$$-1], and in a block with a block height of 1, the sats number is [$$10^{10$$,$$2 *10^{10}$$-1], the sats number in the block with block height 2 is [$$2*10^{10}$$,$$3 10^{10}$$-1], subsequent So on and so forth. If you want to make a specific distinction for a specific sats under this UTXO, it must be achieved through the consumption process of UTXO. The Ordinals protocol follows the first-in-first-out principle. Among the outputs generated by the UTXO as input, the first output corresponds to the same number of sats with the first serial number. For example, miner A who digs out a block with a height of 2 now needs to use his 100 50 of the BTC are transferred to B, and the front output is assigned to A, and he gets the back output, then A will get the number [$$210^{10}$$,$$2.5 10^ {10}$$-1] sats, B obtains the sats with the serial number [$$2.510^{10}$$,$$3 *10^{10}$$-1].

Image source: Kernel Ventures

2.2 Inscription Ordinals

The Bitcoin network first provided an 80-byte storage space for each transaction by adding the OP_RETURN operator. However, the 80-byte area cannot satisfy the writing of complex code logic, and writing data to the blockchain will also increase transaction costs and increase the possibility of network congestion. In order to solve this problem, the Bitcoin network has carried out two soft forks, SegWit and Taproot. The Bitcoin transaction process provides a 4M space through a Tapscript script that starts with the OP_FALSE opcode and will not be executed. In this area we can write ordinals inscriptions to implement text and picture uploading or BRC20 protocol token issuance, etc.

2.3 Disadvantages of Ordinals

Ordinals greatly improves the programmability of the Bitcoin network, breaks the restrictions on the narrative and development of the BTC ecosystem, and provides functions beyond Bitcoin network transactions. However, many of these problems are still criticized by BTC ecosystem developers.

  • Centralization of Ordinals: Although the recording and changes of status in the Ordinals protocol are all performed on the chain, the security of the Ordinals protocol itself cannot be compared with the Bitcoin network. Ordinals cannot prevent inscriptions from being re-uploaded on the chain. The identification of invalid inscriptions needs to be carried out by the ordinals protocol outside the chain. This emerging protocol has not been tested for a long time and has many potential problems. At the same time, if there is a problem with the underlying services of the ordinals protocol, it may also lead to the loss of user assets.

  • Limitations of transaction fees and transaction speed: Because the engraving of inscriptions is performed through the Segregated Verification Zone, that is to say, completing a transfer of ordinals assets must correspond to a UTXO expenditure. Limited to the Bitcoin network’s block generation speed of around 10 minutes, the transaction process cannot be accelerated. At the same time, the chaining of inscriptions will also increase transaction costs.

  • Damage to the original attributes of Bitcoin: Since the assets on ordinarys are bound to the sats that have value in the Bitcoin network itself, the use of ordinarys itself will cause the alienation of the original assets of Bitcoin, and at the same time, the inscription on the chain will bring The increase in mining fees. Many BTC supporters worry that this will damage Bitcoin’s original payment function.

3. RGB protocol

With the surge in network transaction volume, the shortcomings of the ordinals protocol have become highlighted. In the long run, if this problem cannot be properly solved, it will be difficult for Bitcoin’s smart contract ecosystem to compete with the Turing-complete public chain ecosystem. Among the many alternatives to ordinals, many developers have chosen the RGB protocol, which has made greater breakthroughs than ordinals in terms of scalability, transaction speed, and privacy. Ideally, the transaction speed and scalability of Bitcoin ecological assets based on the RGB protocol can reach a level similar to that of assets on the Turing-complete public chain.

3.1 RGB core technology

Client validation

Different from the broadcast of transaction data in the Bitcoin main network, the RGB protocol places this process off-chain, and the information is only transmitted between the sender and the receiver. After the recipient verifies the transaction, there is no need to synchronize the entire network nodes and record all transaction data in the network like the Bitcoin main network. The receiving node only needs to record the data related to the transaction and meet the requirements for on-chain verification. This improvement greatly improves the scalability and privacy of the network.

Image source: Kernel Ventures

Disposable sealing strip

In the process of handing in materials in real life, materials often change hands many times, which poses a great threat to the authenticity and integrity of the materials. In real life, in order to prevent materials from being maliciously tampered with before submitting them for verification, people adopt the method of adding seals, and the integrity of the seals is used to determine whether the content inside has been tampered with. The role of the one-time seal in the RGB network is similar, and its specific embodiment is the electronic seal that is naturally disposable in the Bitcoin network - UTXO.

Similar to smart contracts on Ethereum, issuing Token under the RGB protocol also requires specifying the name and total amount of the currency to be issued. The difference is that the RGB network does not have a specific public chain as a carrier. Each Token in RGB must specify a specific UTXO on the Bitcoin network to correspond to. Someone who owns a UTXO in the Bitcoin network also owns the RGB Token corresponding to the UTXO recorded in the RGB protocol. If you want to complete the transfer of RGB token, the holder needs to spend the UTXO. Due to the one-time nature of UTXO, once spent, it is gone. In the RGB protocol, the corresponding RGB asset is spent. This process of spending UTXO is the process of opening the one-time seal.

Image source: Kernel Ventures

UTXO blinding

In the Bitcoin network, each transfer can find the corresponding input UTXO and output UTXO. This improves the efficiency of UTXO traceability on the Bitcoin network and effectively prevents double-spending attacks. However, since the transaction process is completely transparent, the privacy of both parties cannot be taken into account. In order to improve transaction privacy, the blind source UTXO solution is proposed in the RGB protocol.

During the transfer process of RGB Token, the sender A of the Token will not be able to obtain the specific address of the receiving UTXO, but can only obtain the hash result of a receiving UTXO address followed by a random password value. When receiver B wants to use the received RGB protocol Token, it not only needs to inform receiver C of the address corresponding to its UTXO, but also sends its corresponding password value to receiver C to verify with receiver C. Previously, A The RGB protocol Token is indeed sent to B.

Image source: Kernel Ventures

3.2 RGB vs Ordinals comparison

  • Security: Each transaction or state transfer of the Ordinals smart contract requires a UTXO expenditure, and in RGB this process is largely achieved with the help of the Lightning Network or off-chain RGB channels. A large amount of data in the RGB transaction process is stored on the RGB client (client local cache or cloud server). This process is highly centralized, and the data may be exploited by centralized institutions. At the same time, once the server goes down or the local cache is lost, customer assets will be lost. In terms of security, Ordinals has the advantage.

  • Verification speed: Since RGB uses client-side verification, every verification of a transaction requires starting from scratch in the RGB protocol. This will take a lot of time to determine each step of the RGB asset transfer in the transaction process, which greatly slows down the verification speed. . Therefore, Ordinals has an advantage in terms of verification speed.

  • Privacy: The transfer and transaction verification process of RGB assets are performed outside the blockchain, establishing a unique channel between the sender and the receiver. At the same time, the UTXO is blinded so that even the sender cannot trace the whereabouts of the UTXO. The transfer process of ordinals assets is through the UTXO spending record on Bitcoin. Both the input and output users of UTXO can be queried on the Bitcoin network, and there is no privacy at all. Therefore, the RGB protocol has more advantages from a privacy perspective.

  • Transaction fees: A large number of transfers in RGB are carried out through the client's RGB channel or the Lightning Network. This process has almost zero transaction fees. No matter how many transactions there are in the middle, it only needs to be submitted to the blockchain for confirmation by spending one UTXO. However, every step of the ordinals transfer needs to be recorded in the tapscript script. In addition to the cost of recording the inscription, a considerable handling fee will be incurred during the transaction. At the same time, the RGB protocol proposes a method of batch packaging transactions. Multiple recipients of RGB assets can be specified in a tapscript script. In ordinarys, the recipient of UTXO output by default is the recipient of ordinarys assets, and only one-to-one transfers can be made. RGB greatly reduces the cost of this process by amortizing it. Therefore, the RGB protocol has more advantages in terms of transaction costs.

  • Scalability: In RGB's smart contract, transaction verification and data storage are completed by the client (receiving node), not on the BTC chain. There is no need for broadcast and global verification on the main network. Each node only needs Ensure the confirmation of data related to a certain transaction. The inscription data in ordinals all need to be uploaded to the chain. In view of the processing speed and scalability of the Bitcoin network itself, the ability to withstand transaction volume will be greatly limited. Therefore, the RGB protocol has more advantages in scalability.

4. RGB ecological project

After the release of RGB v0.10.0, it provides developers with a more friendly environment for developing on the RGB network than previous versions. Therefore, the large-scale development of the RGB protocol ecology has only been half a year ago, and most of the following RGB ecology projects are still in the early stages of development:

  • Infinite

Infinitas is a Turing-complete Bitcoin application ecosystem that combines the advantages of the Lightning Network and the RGB protocol and supports and complements each other to achieve a more efficient Bitcoin ecosystem. It is worth mentioning that Infinitas has also proposed a recursive zero-knowledge proof method to solve the inefficiency problem of client verification. If this method is effectively implemented, it will largely solve the problem of RGB network verification speed.

  • RGB Explorer

RGB Explorer is the earliest browser to support RGB asset query and asset (Fungible token and None Fungible token) sending. The supported assets are RGB20, RGB21, and RGB25 three standard assets.

  • Cosminmart

Cosminimart is essentially a Bitcoin Lightning Network that is compatible with the RGB protocol. Try to create a new Bitcoin ecosystem that can deploy smart contracts. Different from the single functions of the above projects, Cosminmart provides a wallet, derivatives trading market and early project discovery market. It provides a one-stop service for the Bitcoin network from smart contract development to product promotion and transactions.

  • NO

DIBA uses the Lightning Network and RGB protocol to build an NFT market for the Bitcoin network. It is currently running on the Bitcoin testnet and is expected to be launched on the mainnet soon.

5. RGB future prospects

With the advent of RGB v0.10.0, the overall framework of the protocol program has become stable, and possible large-scale incompatibility issues during version updates are being gradually improved. At the same time, developer tools and various API interfaces are becoming more and more perfect, and the difficulty for developers to develop using RGB can also be greatly reduced.

Today#Tetherannounces the ending of the support of 3 blockchains $USDt: OmniLayer, BCH-SLP and Kusama. Customers will be able to continue to redeem and swap $USDt tokens (to another of the many supported blockchains), but Tether won't issue any new additional $USDt on those 3 blockchains.

Recently, Tether officially issued a document to transfer the deployment of USDT contracts on the Bitcoin second-layer network from OmniLayer to RGB. This move by Tether is seen as a signal that the Crypto giant is trying to enter RGB. RGB now has a mature development protocol, a large developer community, and recognition from Crypto giants. Finally, RGB developers are now trying to use recursive zero-knowledge proofs to compress the size of client verification. If this improvement can be completed, the verification speed of the RGB network will be greatly improved, thereby alleviating the network delays faced in large-scale use. time issue.

Kernel Ventures is a crypto venture capital fund driven by the research and development community with over 70 early-stage investments focused on infrastructure, middleware, dApps, especially ZK, Rollup, DEX, modular blockchains, and onboarding Vertical areas for billions of crypto users in the future, such as account abstraction, data availability, scalability, etc. For the past seven years, we have been committed to supporting the growth of core development communities and university blockchain associations around the world.

References

  1. RGB protocol:https://rgb.tech/

  2. RGB-lightning-sample:https://github.com/RGB-Tools/rgb-lightning-sample

  3. RGB info:https://rgb.info/

  4. Infinitas official website introduction: https://www.iftas.tech/#/home?id=about

  5. Cosminimart official website: https://cosminmart.com/#/

  6. DIBA official website: https://diba.io/

  7. RGB Explorer official website: https://rgbex.io/

  8. RGB Ecological Ten Thousand Words Research Report: Leading the large-scale adoption of Crypto and lighting up the future of Bitcoin: https://www.odaily.news/post/5189052

  9. ViaBTC Capital Insight丨A Brief Analysis of RGB:A Scalable, Confidential Smart Contract Protocol Built on Bitcoin:https: //medium.com/@ViaBTC_Capital/viabtc-capital-insight丨a-brief-analysis-of-rgb-a-scalable-confidential-smart-contract-protocol-b449f7dbb323

  10. Interpretation of the innovations and limitations of the Bitcoin Originals protocol and BRC20 standard principles: https://zhuanlan.zhihu.com/p/631275714

  11. BRC20 transaction data source: https://dune.com/cryptokoryo/brc20