
Bitcoin's NFT protocol has attracted a lot of attention since its launch in February - from Ordinals-based NFTs to Ordinals-based BRC 20 tokens, but for the BRC 20 protocol, some Bitcoin researchers believe that they are not the best The solution, the second layer of Bitcoin like RGB, is a better choice.
first level title
1. Bitcoin is ready for a 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 4 MB 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 Inscription 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.
inscription 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. 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, which has existed since the birth of Bitcoin and was written by Satoshi Nakamoto. "op_if" means that if "0" and "op_if" appear on the stack, the entire code between "0" and "op_if" will be skipped and will not enter the stack for actual execution.
And Ordinals takes advantage of this - when it needs to append an inscription, it first verifies a signature, then writes "0" and "op_if" to the stack, and"0"and "op_if"The data in the middle is completely skipped according to the script settings, and this 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. Usually, some data needs to be provided 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 4 MB, 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: contains script and signature data, each byte counts as 1 wu;
Transaction data: contains sender, receiver, input and output information, each byte is 4 wu;
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 1 MB to 1 vMB, which is 4 MB.
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 size of 4 MB 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 BRC 20-based Bitcoin NFTs, which attracted widespread attention in the industry. Mempool also released a dedicatedResearch Report on Bitcoin NFTfirst level title
2. BRC 20 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 BRC 20 came out, it attracted a lot of attention, and many people hoped to use the Ordinals limelight to issue tokens. The first token deployed on BRC-20 is "ordi", a tribute to BTC. The total amount of Ordi is also 21 million, and each minting 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, the price of Ordi had dropped from its peak of $24 to around $8.
Meanwhile, just on May 25th, a company called Stably announced that they will soon launch their U.S. dollar (USD)-backed stablecoin, Stably USD, as a locally issued BRC 20 token under the symbol #USD.
Simply explain BRC 20 technically, it actually takes advantage of the feature that Inscription can write arbitrary data in the block, and write data in the form of JSON to issue tokens. These JSON summer holidays define some standards for tokens, Information including asset names, circulation, etc. 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 ERC 20 on top of ERC 721. 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, the BRC 20 is equivalent to writing a check on this banknote and transferring money to another person through the check on this banknote.
In the opinion of our guests, A Jian and Jeffery Hu, BRC 20 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 in 2014 that Tether issued stable currency USDT based on it. The addresses of these transfer accounts usually start with "1" and "3". Although the transfer speed is slow, it is still accepted by users at the beginning because it is based on the Bitcoin blockchain, 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 Bitcoin’s OP_RETURN script to embed a small piece of data in the transaction, so as to write the token information other than Bitcoin on the Bitcoin chain.
In Bitcoin's UTXO system, each transaction has a spend (spend), which is an 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 Script Hash (P 2 SH) transaction. The lock script for the transaction output includes the OP_RETURN opcode followed by the data to be inserted (usually up to 40 bytes).
Users add inputs to this transaction, such as unspent transaction outputs (UTXOs) that they want to use as transaction inputs.
After a user creates a transaction, they sign the transaction 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 stored on the blockchain forever.
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;
Second, 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 complete Omni transaction information. The 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 spent
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 BRC 20 bound to Satoshi can only be spent once.
In the face of BRC 20, it is worth thinking that the Omni Layer has been proven to be unfeasible. BRC 20 is highly similar to it, can it be better developed?
first level title
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 and started a new one. At the end of 2013, he wrote the Ethereum white paper. 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 customer of the party receiving the payment It is verified by the terminal, but uses the decentralized network of Bitcoin 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 as follows: Tokens are bound to a Bitcoin UTXO. If you want to transfer tokens, you need to spend this UTXO. When spending this UTXO, Bitcoin transactions must Contains a data commitment, that is, the payment information of RGB, including input, which UTXO the token will be sent to, the id of the asset, the amount, the transaction spent, etc.
(Literature reference:https://www.btcstudy.org/2022/04/24/understanding-rgb-protocol/)
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, and the remaining funds are sent back to the original owner after deducting the miner’s handling fee, 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, the security of additional assets on Bitcoin is guaranteed through the characteristics of UTXO that cannot be double-spend. In fact, RGB is also based on such a concept-to allow users to independently verify the contract on a specific UTXO state, and verify that all contract state transitions are safe or not, and then use Bitcoin's UTXO transactions to stimulate 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, as long as they go to mine, because if they know the content of the transaction, it will bring the possibility of censorship. RGB inherits this concept - all RGB assets are just artificially attached to a UTXO, so its trace on the chain is an ordinary Bitcoin transaction, and miners don't need 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. 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.
first level title
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 Layer 2 concepts, including Plasma, etc., had some technical flaws, but until Rollup, an ideal Layer 2 structure appeared: in order to solve the performance limitations of the main chain and other issues A chain that has been recreated 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 funds can flow in both directions.
image description
text
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 on Ethereum.
secondary title
text
The most typical Bitcoin status 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.
secondary title
text
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.
secondary title
text
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 asset class expansion, 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 is called the reinterpretation layer, such as Ordinals, Omnilayer and BRC 20. 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 be an NFT Either 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 the Lightning Network, which only writes the final settlement or some commitment information into 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.
【contact us】
Listen to the WeChat group: Cyberpunklechee
You can find us in Small Universe, Himalaya, and Podcast