Author: OneKey Chinese source: X, @OneKeyCN
Recently, @ NervosNetwork announced that it will promote CKB to become the first "POW+UTXO" Bitcoin L2, and the price of $CKB rose sharply.
Previously, when the circle talked about BTC L2, it was actually deeply influenced by the L2 Rollup concept of Ethereum. Although the various quickly built EVM versions of L2 have mature technologies and low ecological development thresholds, their native security has been criticized. At the same time, using this type of L2 requires users to switch back and forth between the BTC wallet and the EVM wallet, which makes the user experience very inelegant. All in all, until these issues are resolved, the "picky" OGs and whales in the BTC community may not be so easily "FOMO". Amid various problems, whether the UTXO isomorphic L2 solution can become a new way out has become a hot topic recently.
This article is for beginners, starting from UTXO, the "source of all evil", to connect inscriptions and popularize the development of CKB's "no cross-chain bridge" BTC L2.
What are UTXO and eUTXO?
UTXO (Unspent Transaction Output), the literal translation is "unspent transaction output". For example, if you receive a transfer of 10 BTC and do not spend it on anyone else, this 10 BTC is a UTXO.
Let us understand through comparison and examples.
There are currently two mainstream transaction record models in the blockchain, namely the UTXO model and the account model. The account model used by Ethereum is very easy to understand. This model is the same as a bank account or Alipay WeChat account. Under this model, the total amount of funds in the account is visually displayed as an overall balance, and the system only needs to track the balance changes in the user's account. For example: you have a balance of 1,000 yuan in your account. When you purchase OneKey Classic for 600 yuan, the system will deduct 400 yuan from your account and add 400 yuan to your OneKey account.
Compared to the account model used by Ethereum, Bitcoin's UTXO abstraction will be more like a real "wallet" and "banknote", and more like a real cash transaction . An analogy: imagine you have a wallet bag with many bills in different denominations. Every banknote can be thought of as a UTXO, a sum of money that you can use. In a system like Bitcoin, when you receive a Bitcoin transfer from someone else, the money is like a new banknote in your wallet. You haven’t used it to pay for anything else, so it is “unspent.” ". Every time you make a transaction, say buying a $600 OneKey Classic with a $1,000 bill, you'll get $400 back in change. In the Bitcoin system, this operation is equivalent to using one UTXO (1,000 yuan) to create two new UTXOs: one is to pay our OneKey (600 yuan), and the other is returned to yourself (400 yuan) . You "spend" the original UTXO (1,000 yuan) and "generate" new UTXOs (600 yuan and 400 yuan).
With the above, the concept of eUTXO (Extended Unspent Transaction Output, that is, the extended version of the unspent transaction output) is easy to understand. In systems like Cardano that use the eUTXO model, it not only records the amount of money, but can also contain more complex data and logic (for example, the money can only be used to purchase specific goods or services). In this way, each transaction not only transfers funds, but also executes some conditions and even the content of the smart contract. This makes transactions more flexible, but also more complex.
What does inscriptions such as BRC-20 have to do with UTXO?
If you know something about the BRC-20 protocol, you will soon find out - "Oh shit, what they are doing is based on the UTXO model Run account model". After all, the protocol’s name comes from Ethereum’s token standard, ERC-20, which uses an account model.
In BRC-20, token operations, including deployment, mint and transfer, are all done through Bitcoin This is achieved by embedding data in JSON format in UTXO transactions. This is equivalent to writing records on the "banknotes" we mentioned earlier. In this way, tokens can be freely issued on the Bitcoin chain. However, Bitcoin cannot manage the account model, and the content of BRC-20 is placed in Segwit's Taproot script. Bitcoin cannot recognize and calculate the numbers inside. It's like the banking system only recognizes the denomination of the banknote and doesn't care what you write on it. Fortunately, unlike centralized banks, all Bitcoin transactions are public, and we can check what is written on all "banknotes." As long as we follow certain rules (ordinal theory) to create a ledger and calculate addition, subtraction and subtraction off-chain. Therefore, BRC-20 is currently building an index server off-chain to implement various ledger calculations of BRC20 tokens. However, this method obviously involves the risk of centralization - this service that maintains the ledger does not have the fair game mechanism of POW or POS to ensure that no evil is done. So this also explains why BRC-20 is regarded by some Bitcoin core developer geeks as superfluous and technological regression.
So various new inscription protocols were later developed to solve the shortcomings of BRC-20. For example, ARC-20 and Runes use a similar method to allow Bitcoin to calculate balances, that is, directly making the number of tokens equal to the number of Bitcoins in UTXO (unit: satoshi) - 1 token = 1 sat, instead of another count. This is equivalent to putting a "special mark" on the smallest denomination banknote to represent another currency. In fact, it is the "dyed coin" that appeared in the ancient history of the currency circle. The advantage of this is that no off-chain system is required for tracking transactions, calculating balances, etc. Only an index server is needed to recognize this "special mark", which reduces the cost of the index server. But this also introduces a new problem. In order to reduce spam transactions, the Bitcoin network has a minimum transaction output limit (546 satoshis). As a result, inscription tokens such as ARC-20 cannot split into finer-grained transactions, resulting in liquidity. It is similar to NFT and is not a truly fungible token. However, to introduce the calculation of split transactions, going round and round, we have to perform centralized off-chain index transactions. On this issue, ARC-20 has been stuck for a long time, and there has been no split plan for several months. At present, it seems that the project team is relying on the AVM inspired by BitVM to implement pledge split calculation, which is not easy to develop.
How does CKB implement L2 without cross-chain bridges?
From a technical point of view, many Meme-type inscription asset issuance plans themselves have limited promotion of the advancement of Bitcoin technology. Inscriptions have created many new assets, but their application has stopped at issuing assets. But its wealth effect and FOMO allow people to see the imagination of the BTC ecosystem. In the actual needs of on-chain players, the various limitations of the Bitcoin network and UTXO have further stimulated people's demand for Bitcoin expansion and more complex ecological applications.
From the perspective of expansion, the Lightning Network is already a good enough L2. The Lightning channel achieves trustlessness and operation through games (punishment-based revocable commitment transactions) for many years. However, the state channel architecture of the Lightning Network is basically limited to payment and cannot achieve more complex intentions. As mentioned earlier, implementing a relatively safe and elegant L2, adopting a UTXO model that is isomorphic to BTC, and extending it using the eUTXO concept may be a way out. Both the public chains Ergo and Cardano have made achievements in the eUTXO model and have implemented smart contract functions. But it was CKB that first thought of implementing an L2 solution.
CKB's answer is to propose an extension protocol for RGB: RGB++. In fact, it is not so much an extension as a "big magic change". The extension of CKB inherits the core of the RGB protocol, but directly uses different virtual machines and verification schemes. As an open source smart contract system protocol, the RGB protocol is designed to run scalable, robust and private smart contracts on UTXO blockchains (such as Bitcoin, Liquid). Currently v0.11 has not been released, and its virtual machine AluVM is still far away from being fully implemented (some say it may not be possible even after this bull market is over). Its technical focus is "isomorphic binding", which is to map Bitcoin UTXO to Nervos CKB's Cell - a magically modified version of UTXO that can be combined to achieve intelligence Contractual ability. For the verification scheme, all RGB++ transactions will appear simultaneously on the BTC and CKB chains with one transaction each. The original off-chain client verification has been changed to CKB's on-chain public verification, which is much more user-friendly. There is no need to use an independent client or save the original transaction data. A rough understanding is that RGB++ assets issued on the first layer of Bitcoin can use smart contracts on the second layer of CKB to realize various complex intentions. CKB does not use any cross-chain bridge, but uses a native client verification scheme.
In a sense, this is a relatively cutting-edge idea - to do intent (Intent) cross-chain expansion, rather than traditional assets Cross-chain. L2 people are always thinking of ways to use various methods to lock BTC in L2, but to achieve expansion and complex applications, maybe we only need to do intent-oriented applications in L2?
Although RGB++ is still just a concept and has not yet been implemented in depth, this solution is believed to provide a new path for the exploration of legitimacy of BTC L2. The future is promising.