Dialogue Researcher: In addition to BRC-20, Bitcoin also has RGB Layer 2

Bitcoin researcher A Jian and Harshky Capital's Tech lead Jeffery Hu talk about their views on Bitcoin's second layer including BRC-20.

Anchor and guests

Ajian: Bitcoin Maximalism, BTCStudy contributor, @AurtrianAjian

Jeffery Hu:Hashkey Capital Tech lead,@hu_zhiwei

Brutoshi: Director of Mempool, co-founder of AstroX, a Web3 wallet product, @brutoshi_

0xHelen: Mempool manager, web3 builder

Bitcoin’s NFT protocol has attracted a lot of attention since its launch in February—from Ordinals-based NFTs to Ordinals-based BRC20 tokens, but for the BRC20 protocol, some Bitcoin researchers believe they are not the best solution , similar to the second layer of Bitcoin like RGB, is a better choice.

In this episode of the Mempool podcast, Bitcoin researcher A Jian and Harshky Capital's Tech lead Jeffery Hu talked about their views on the second layer of Bitcoin including Brc20.

1 Bitcoin is ready for the new second layer

Ordinals was proposed by Bitcoin core developer Casey Rodarmor on February 2, 2022, and it will be launched at the end of January 2023. The entire development took almost a year. Simply put, it uses a unique method to integrate any A piece of 4MB content data is written to Bitcoin, and each piece of data is bound to one Satoshi of Bitcoin. The Ordinals agreement can be understood from two parts, one is the Ordinals ordinal number, and the other is the Inion inscription:

  • Ordinals ordinal number: To understand Ordinals, you must first understand Satoshi Satoshi, the smallest currency unit of Bitcoin. One Bitcoin is equal to 100 million Satoshi. Based on the Bitcoin UTXO accounting system, Casey uses a set of technical solutions to serialize Satoshi and track them.
  • inion inscription: After each satoshi is numbered, a piece of content can be written into the witness isolation area. The content can be pictures, text, audio and video, or even code. As long as the size is less than 4MB, this process is the art The product is bound to Satoshi so as to be issued and circulated.

Bitcoin is actually a decentralized ledger system, and the core of this ledger is its script system—a language used to write transaction rules. This language does not have Turing completeness, and provides the ability to execute transactions and customize specific function of the operation.

The logic of Ordinals in the script actually relies on the "op_if" operation code in the Bitcoin script. This operation code has existed since the birth of Bitcoin and was written by Satoshi Nakamoto. "op_if" means that if "0" and "op_if" appear in the stack, the entire code between "0" and "op_if" will be skipped and will not enter the stack to actually execute.

And Ordinals takes advantage of this - when it needs to attach an inscription, it first verifies a signature, and then writes "0" and "op_if" to the stack, and the middle of "0" and "op_if" The segment data is completely skipped according to the script settings, and this segment of data is the Ordinals inscription.

In addition to "op_if", the existence of Ordinals is also related to a major technical upgrade of Bitcoin, Segregated Witness. As we all know, Bitcoin bookkeeping uses the UTXO system, and UTXO has its own script public key, and usually needs to provide some data to complete the verification program programmed by the script public key for a sum of money to be unlocked. Originally, all the data needed to pass the validator would be placed in the input script signature field. In August 2017, Bitcoin adopted a soft fork upgrade called Segregated Witness (SegWit). In layman's terms, by placing data such as signatures that take up a large amount of storage space at the end of transaction scripts, the Bitcoin block size does not exceed Under the limit of 4MB, the block has more space, so that more transactions can be performed to achieve the purpose of expansion.

Since Segregated Witness is a soft fork, it is not mandatory. In order to attract everyone to use Segregated Witness, developers make data storage on Segregated Witness cheaper. The size of the transaction is the basis for charging the handling fee of Bitcoin. Therefore, the developer adopts the right method to give a discount to the calculation of the transaction size of the witness isolation part——dividing the transaction data structure into two parts: transaction data and witness data. When witnessing the size of data, virtual Byte (vByte) is used as the unit, and 1 vByte is equivalent to 4 weight units (wu):

  • Witness data: including script and signature data, each byte is counted as 1wu;
  • Transaction data: contains sender, receiver, input and output information, each byte is 4wu;

That is to say, the data weight of the witness part is only 25% of the transaction part, and the transaction fee is correspondingly 25%. At the same time, the previous maximum block size was changed from 1MB to 1vMB, which is 4MB.

But the real implementation of Ordinals is also related to Taproot. In the witness isolation technology, there is a special limit on the size of the data input each time, but in November 2021, Bitcoin will undergo another major upgrade to Taproot, removing the restriction on the amount of data in the witness part. The specific size of the data is only It is limited by the maximum block of 4MB in the isolated area, and at the same time, it allows developers to write more advanced scripts in the witness section.

After a series of technical upgrades, it was impossible to store data on the Bitcoin chain before, laying the foundation for the realization of Ordinals step by step.

After the release of Ordinals, the community first used this protocol to issue NFTs, especially after well-known institutions like Yuga Labs also issued BRC20-based Bitcoin NFTs, which attracted widespread attention in the industry. Mempool also released a special article on Bitcoin NFTs. The research report (but what quickly attracted more attention from the market is the BRC20 protocol based on Ordinals issuing tokens.

2. BRC20 follows the old path of Omni Layer

Following the Bitcoin NFT craze, Twitter user @domodata created the BRC-20 token standard on Bitcoin on March 8, 2023.

Once BRC20 came out, it attracted great attention, and many people hoped to use the Ordinals limelight to issue tokens. The first token to be deployed on BRC-20 is "ordi", a tribute to BTC. The total amount of Ordi is also 21 million, and each coinage is limited to 1,000. Ordi has aroused great popularity in the market. If calculated according to the mint price, the peak increase was more than 3000 times, and it once became the hottest meme currency in the market. But by the end of May when our article was published, Ordi's price had dropped from its peak of $24 to around $8.

Meanwhile, on May 25th, a company called Stably announced that they will soon launch their US dollar (USD)-backed stablecoin, Stably USD, as a locally issued BRC20 token under the symbol #USD.

Simply explaining BRC20 technically, it actually takes advantage of the feature that inscription can write arbitrary data in the block, and writes data in the form of JSON to issue tokens. These JSON summer holidays define some standards for tokens, including Asset name, circulation and other information are written on the chain in the form of inscriptions.

**If you use Ethereum as an example, it is equivalent to implementing the function of issuing tokens in ERC20 on top of ERC721. It is better to understand this form of "matryoshka" in a metaphorical way. If Bitcoin is a banknote, Ordinals is like writing some text or drawing a picture on the banknote, or even embedding a The right size game, in the opinion of our guest Jeffery Hu, BRC20 is equivalent to writing a check on this banknote, and through the check on this banknote, transfer money to another person. **

In the opinion of our guests, A Jian and Jeffery Hu, BRC20 is very similar to the previous Omni Layer agreement, "and everyone has gone through this road before, and we already know that it is a road that does not work."

Omni Layer is also trying to issue additional assets on top of Bitcoin. What really made Omnilayer land on a large scale was that in 2014 Tether issued the stable currency USDT based on it. The addresses of these transfer accounts usually start with "1" and "3". Although the transfer speed is slow, because it is based on the Bitcoin blockchain, it is still accepted by users at the beginning, especially the transfer of large amounts of money usually uses Omni Layer-based USDT. But in 2018, Ethereum became popular, so Tether issued USDT on Ethereum, and the transfer speed increased sharply. These addresses are usually "0x", and users based on Omni Layer gradually lost.

**The design of Omni Layer and Ordinals is very similar. In fact, it also uses the OP_RETURN script of Bitcoin. **Embeds a small piece of data in the transaction, so that the token information other than Bitcoin is written on the Bitcoin chain. .

In Bitcoin's UTXO system, each transaction has a spend (spend) that is input, and then generates an output (output), which is "unspent transaction output" (Unspent Transaction Output). Output scripts are responsible for programming in transactions, and when a transaction attempts to spend from an account, it must provide an input script that "solves" the puzzle provided by the output script.

But when the OP_RETURN opcode is used in the output script, it marks the output as non-spendable, which means that the transaction does not affect the balance, but the transaction is still recorded on the blockchain:

  • OP_RETURN is used in the first step of creating a pay-to-script-hash (P2SH) transaction. The locking script of the transaction output includes the OP_RETURN opcode, followed by the data to be inserted (usually up to 40 bytes).
  • The user adds inputs to this transaction, such as unspent transaction outputs (UTXOs) that they want to use as transaction inputs.
  • After the user creates the transaction, the transaction is signed with their own private key.
  • Once the transaction is broadcast, miners verify it and include it in the next block.
  • Since OP_RETURN marks the transaction output as provably unspendable, no new tokens are created and funds are not transferred.
  • Data related to OP_RETURN will be permanently stored on the blockchain.

It is not difficult to see that there are some differences between the Omini protocol and the Odinals protocol: in the Omni protocol, there is no relationship between the assets on the Bitcoin chain and the transaction itself, but in the Ordinals protocol, by tracking the flow of satoshi, to track and decide Who owns the NFT, that is to say, the NFT and the Bitcoin asset itself are bound.

but very similar to:

First of all, they all write data on the chain, and the idea is to divide the entire protocol design into two layers:

  • The first layer is Bitcoin, which writes transaction data into blocks, but because of the code containing OP_RETURN, the intermediate data will not be recognized, but these data will be recognized by another layer;
  • The second layer is an additional protocol, which is used to analyze the connotation of the data specially placed in a certain location, and help users use assets other than Bitcoin on the Bitcoin chain;

Secondly, the core of their solution to the double spend problem is that UTXO cannot be spent twice:

  • In the era of Omni, each USDT is dyed and comes with some other assets, so we call it dyed USDT. When it is spent, the transaction carries an OP_RETURN, which contains a complete Omni transaction This information tells everyone that this asset has been completely sent to a certain UTXO, because a UTXO can only be spent once, so it can also ensure that the asset carried in the UTXO is not double-spend
  • Ordinals track Satoshi, and Satoshi will only be in a certain UTXO, and this UTXO can only be spent once, which also ensures that the NFT or BRC20 bound to Satoshi can only be spent once.

In the face of BRC20, it is worth thinking that Omni Layer has been proven to be unfeasible. BRC20 is highly similar to it, can it be better developed?

In the opinion of our guests, RGB may be a better method - in the case of using UTXO to ensure the security of funds, it is not necessary to put all the data on the chain, only need to put the data commitment on the chain, through this A way to implement a secure smart contract system.

3. RGB is a better asset distribution protocol‍

For a long time, when Vitalic was still running the Bitcoin Magazine website, many people in the community, including him, tried to issue additional assets on Bitcoin. Both Omnilayer and Counterparty were the result of this attempt, (in our In the 4th episode, this kind of attempts and efforts were sorted out).

After a period of hard work, the community came to a unanimous conclusion: if you want to use Bitcoin script to issue additional assets, it means that all nodes need to parse the information of additional assets in Bitcoin script, In the real large-scale application, the shortcomings in speed and cost are very obvious.

As a result, Vitalic gave up on Bitcoin as the bottom layer, started anew, and wrote the Ethereum white paper at the end of 2013. At the same time, there are other people who did not give up Bitcoin, but gave up writing all data to the Bitcoin chain, and only put the most important part of the data on the chain, that is, the Bitcoin second-layer protocol like RGB.

Based on the concepts of client-side validation and single-use-seals proposed by Peter Todd in 2017, the RGB protocol proposes a more scalable, more private, and more future-oriented solution The core idea of the scheme is that the Bitcoin blockchain is only used when necessary, and the verification work of token transfer is removed from the consensus layer of the whole chain, placed off-chain, and only the party receiving the payment client to verify, but use Bitcoin's decentralized network to prevent double spending and anti-censorship. In general, it has the following characteristics:**

One-time seal and off-chain transfer: The basic design of RGB is like this. The token is bound to a Bitcoin UTXO. If you want to transfer the token, you need to spend this UTXO. When you spend this UTXO, A Bitcoin transaction must contain a data commitment, the payment information in RGB, including the input, which UTXO the token will be sent to, the id of the asset, the amount, the transaction spent, and so on.

(Literature reference:

  • If you have additional tokens on Bitcoin to transfer, these tokens are bound to UTXO;
  • To transfer these tokens you need to create an RGB transaction and a Bitcoin transaction that spends UTXO and that Bitcoin transaction commits to the RGB transaction.
  • The RGB transaction is the transfer of tokens from Bitcoin transaction output 1 to output 2 of Bitcoin transaction C.
  • The output of the final transaction B is the change address, after deducting the miner's fee, the remaining funds are sent back to the original owner, and the RGB transaction is also committed*. *

In this design, Bitcoin's UTXO acts as a one-time container for RGB assets. To transfer assets, you only need to open the old container and close the new container.

That is to say, in an RGB transaction, when a transaction needs to be initiated, the transaction initiator will send the flawless data proving the order of asset circulation to the counterparty in a point-to-point off-chain manner. On the chain, the UTXO carried by the user spends , use the OP_RETURN output to carry the hash value of this transaction. It is worth noting that, compared with the Omni protocol, which will put the complete transaction, the RGB protocol only puts a hash value. **

Self-verification: Whether it is Omnilayer or Ordinals, in fact, UTXO can not be used to ensure the security of additional assets on Bitcoin. In fact, RGB is also based on such a concept-let users verify independently The state of the contract on a specific UTXO, and verify that all contract state transitions are safe or not, and then use Bitcoin's UTXO transactions to activate a smart contract system. ‍

For example, when Brutoshi wants to send an asset to A Jian, A Jian needs Brutoshi to provide detailed records of the transfer process to verify that an asset has indeed been routed or transferred to him through bitcoin transactions one by one, and These materials can also allow Ah Jian to prove to the next person that these assets have indeed been transferred from a certain place to him. This verification method is called self-verification-the transfer chain is flawless, accept Investors can safely receive assets and be able to pay others.

Anti-censorship: In addition, RGB does not require the receiver to give a clear UTXO, but gives UTXO plus an obfuscated value, which ensures the privacy of the receiver. At the same time, in the transfer process, use zero-knowledge proof technology to ensure that its amount will not be exposed during the entire transfer process, which is more private than UTXO on Bitcoin.

This is also based on a very radical concept of Peter Tolder, **He believes that miners should not know the specific content of a transaction, just go to mine, because if you know the content of the transaction, it will bring the possibility of review . **RGB inherits this concept - all RGB assets are just artificially attached to a UTXO, therefore, its trace on the chain is an ordinary Bitcoin transaction, and miners do not To know whether there are RGB assets in the transaction, miners only need to mine bitcoin transactions.

For a long time, the privacy of Bitcoin has been limited. For example, the transfer amount of the transaction is public. The Bitcoin community made such a choice because they believed that the auditability of the amount of money would be more important than the privacy of the transaction.

At our Ordinals offline event held in April, Luxor Mining, the largest mining pool in North America, told us that as a company based in the United States, they need to comply with the requirements of US laws, based on some OFAC, such as creations from North Korea censorship, so, in some extreme cases, complete censorship resistance is also necessary.

It sounds like RGB is a perfect technical solution, but sometimes the development of the ecology requires "the right time, place and people". The white paper of Ethereum was released at the end of 2013, and the main network was released in 2015. Although there was an attack on Ethereum in 2016 However, with the development of DeFi, more and more developers are building applications on Ethereum, embracing this technical paradigm that is different from Bitcoin and RGB.

RGB has been in the cold for a few years, with a team of about 5 people, all Ukrainian, who continue to maintain the agreement, but both of our guests agreed that over time, a truly suitable solution can develop.

4. Layer 2 of Bitcoin

In the Ethereum community, everyone has formed a relatively strong consensus on the second layer. At DevCon in Prague, the community believed that many previous Layer2 concepts, including Plasma, etc., had some technical flaws, but it was not until Rollup that an ideal Layer2 structure appeared: in order to solve the performance limitations of the main chain and other issues, it was redesigned A chain created can be trust-free in both directions with the main chain, which means that the main network and the side chain can verify each other and the two-way flow of funds.

But on Bitcoin, we have no way to apply the concept of Ethereum Layer2, the simplest example, Lightning Network is undoubtedly layer2 on Bitcoin, but it does not have an independent chain, such as Bitcoin The trust between Bitcoin's side chain and Bitcoin is usually one-way, so we try to define and classify Bitcoin's layer2, and our guest Jeffery Hu divides them into four categories:

Image source: Jeffery Twitter @hu_zhiwei

A. Rollup

Rollup is the most popular layer-2 solution on Ethereum, which essentially transfers the calculation process from the main chain to a separate chain called "Rollup chain". After transactions are executed on these Rollup chains, the data is aggregated and summarized, and transmitted to the main chain for verification, thus reducing network congestion in Ethereum.

In contrast, in Rollup projects such as Rollkit and Alpen on Bitcoin, Bitcoin plays the role of the data availability layer compared to the stronger smart contract function on Ethereum, but because Bitcoin is considered to be the most A secure chain, therefore, this solution also has its advantages in certain application scenarios.

B. State channel

The most typical Bitcoin state channel is the Lightning Network. Its concept is to open a "green channel" outside the blockchain, and conduct a large number of high-frequency and small transactions outside the blockchain, and the final settlement data is placed on the blockchain. Issues such as confirmation of transactions on and off the chain and payment channels are solved through technical methods such as RSMC and HTLC. Compared with solutions such as Rollup, it does not have an independent chain, but only one channel.

The ultimate security of the Lightning Network is actually guaranteed by Bitcoin miners, as is Rollup. Therefore, Rollup is very similar to the state channel design.

In the past few years, the development speed of the Lightning Network is not very obvious. According to the data on May 30, there are currently about 5,300 BTC in the channel, but we have also seen that exchanges like Okex have used the Lightning Network to support Bitcoin. Therefore, we believe that after more and more application scenarios experience the "sweetness" brought by the Lightning Network, the Lightning Network can develop faster.

C. Sidechain:

The Lightning Network mainly solves the problem of low BTC settlement throughput and high cost, but it does not solve the problem of insufficient construction of BTC native applications. Therefore, during the same period, the concept of Bitcoin Sidechain (Sidechain) was also proposed. Simply put, developers create another chain and do more smart contracts or other calculations on this chain.

The interaction between the side chain and Bitcoin is mainly for the side chain to verify the information on the Bitcoin main chain, and then perform subsequent executions. In turn, the Bitcoin main chain cannot go to the untrusted side chain, or all Bitcoin miners To verify whether the transaction on the side face happened. Therefore, generally speaking, the form of an alliance side chain may be adopted, similar to the way a group or several members witness each other, so to achieve two-way anchoring.

Blockstream first proposed and developed the side chain, called Liquid Network, which was launched in 2018. The recently popular stacks are also considered side chains.

D. Client Authentication‍‍

It is somewhat similar to the idea of the state channel, that is, it is not necessary for all the nodes/miners on the main chain to verify the state transition process through repeated calculations, and only need to use the main chain to ensure the security of the promise. Items include: RGB, Taro, and more. Projects such as RGB will also provide FT and NFT contract templates to support the development of some contracts.

We can also see that the combination of different Bitcoin second layers can bring greater possibilities to the Bitcoin ecosystem, such as RGB+ Lightning Network. The former brings the expansion of asset classes, and the latter brings performance expansion. In the RGB protocol, using Lightning Network as an off-chain channel is a design that greatly improves performance when issuing assets.

But if you jump out of the limitation of the second layer, you can also divide the Bitcoin technology as follows:

One type is called reinterpretation layer, such as Ordinals, Omnilayer and BRC20. These are actually transactions on the existing main chain, but through these technologies, the meaning of transactions is redefined or explained. For example, let Ordinals is an NFT or a FT is bound to a Satoshi, or Omnilayer binds an asset to an NFT. They have more actions on the Bitcoin main chain.

The other type is called the omission layer, such as Lightning Network, which only writes the final settlement or some commitment information on the chain, and utilizes the security of Bitcoin, and many intermediate transactions are completed off the chain.

In fact, RGB can be regarded as a combination of the two. It not only uses some data on the Bitcoin network, but also does a lot of client verification under the chain, which brings great possibilities for the improvement of Bitcoin scalability. sex.

It cannot be denied that after the emergence of Ordinals and a series of technical preparations for Bitcoin, we believe that there is still a great possibility for the development of Bitcoin's future ecology. ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

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.
  • Reward
  • Comment
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)