Many people are starting to pay attention to Bitcoin’s RGB protocol and are really happy. However, most people are relatively unfamiliar with such a protocol (especially a relatively technically complex protocol), and do not know how to research and try the content and ecology of the protocol.
Therefore, I specially write a continuously updated Mirror to summarize relevant learning materials and provide a relatively reasonable learning path; at the same time, it also serves as a record of personal learning about RGB.
Part One: Popular Science Part-Initial Understanding of RGB
When many people see the three words RGB, they think of “the three primary colors: red green blue”. If you look at the icon, this is really the case. This is because the RGB protocol utilizes the early concept of “dyed coins”.
Here we are talking aboutRGB isan agreement,An extremely private, scalable smart contract system protocol that can run on the Bitcoin mainnet, Lightning Network, or similar networks。
This protocol is currently maintained and updated by the LNP/BP protocol, and bitfinex also participates in some code work.
It is difficult to simply classify RGB into the category of Bitcoin L2. It does not have its own chain, it does not have its own layer, and it can operate on other L2s of BTC. Therefore, to be precise:It is a universal technology。
In the industry, it is generally believed that RGB and Bitvm will be the ultimate form of BTC expansion, because they can both achieve the scalability of the BTC ecosystem based on the native nature of BTC. Compared with Bitvm, which is far away,RGB has been gradually implemented。
It is worth mentioning that RGB is a technology that is not limited to crypto. It can be widely used in our non-crypto scenarios. As the protocol becomes more mature, we will see more and more use cases.
From the official introduction, we can see the functions that the RGB protocol can achieve:
If we classify it, we can see:
From this perspective, RGB allows BTC to have most of the functions of the current EVM, but it is not implemented in a non-native form similar to “EVM compatible”, but implemented natively. I have to say that this set of theories and designs The concept is awesome.
In fact, it is worth noting that the RGB smart contract system is very different from previous methods, whether based on Bitcoin (Colored Coins, Counterparty, OMNI) or non-Bitcoin (Ethereum, EOS, etc.), it has its own Unique features:
The first meaning is that smart contracts will be better stratified. The issuer only has the rights to the contract at the moment of issuance, and then the state owner will have the rights during the continuous state evolution process;
The second meaning is that it keeps the code off-chain, which can save on-chain space, improve running speed, and reduce development difficulty, but it can also ensure security through mechanisms;
The third article reveals its security endorsement layer (blockchain), and it is Turing complete and can support simple language operations.
Therefore, the following picture may be closer to the correct understanding:
From Dr. Maxim Orlovsky’s teaching video, we can see that the officially recognized RGB characteristics include:
Let’s break it down one by one:
1️⃣Extreme privacy
2️⃣High security
I don’t quite understand these two points, I need to study them.
3️⃣Highly scalable
4️⃣No congestion
5️⃣Extremely high integration
So, in fact, in my eyes, RGB for BTC is more like the following:
Compared with other protocols, the RGB protocol has its own very unique technical points. Here are a few important parts of simple science:
4.1 Disposable sealing
This technology was first proposed by Peter Todd in 2016. Its main meaning is to “add a seal to a message to ensure that the message can only be used once, because you must remove the seal to know the message.”
A simple method is to set up a notarized third-party server that publishes a certificate in a public registry whenever a seal is opened or locked, so that anyone can verify the status of the seal they care about.
If you do not use a trusted entity to implement the one-time seal function, you can use Bitcoin’s UTXO as a seal. Because any UTXO in Bitcoin can only be spent once. Therefore, using UTXO as a seal, you can lock the UTXO when it is created and open it when you spend it.
RGB utilizes such a “one-time sealing” technology, which “wraps” RGB asset information, contract status, etc. in UTXO. When UTXO is spent, the ownership of the asset and the status of the contract change. This means that every time an RGB transaction occurs, the sender actually creates a contract (the one that defines the rights being transferred).status change。
Take RGB20 as an example:
1️⃣First, the issuer of the contract sets the founding state of the contract and defines the details of the contract: the name of the asset, the total supply, etc., and the issuer has the right to move the UTXO of these supplies;
2️⃣When an asset is transferred for the first time, the owner of the first UTXO can create a state change to define which UTXO will hold the asset;
3️⃣State change can be applied to the right to change the ownership of the asset, or to other types of rights, such as the right to secondary issuance, or the right to add/change specific attributes of the asset (for example: metadata), etc. .
4.2 Client verification
RGB verification is different from the traditional “global consensus” verification and uses “client verification” technology.
With traditional Bitcoin verification, a node connected to the network continuously downloads and verifies blocks and transactions in a transaction pool (full node). Such a node has a real-time updated view of the UTXO set on the entire chain (the set of all unspent outputs on the blockchain). When it sees a new transaction, to verify its validity, it only needs to verify All inputs to the transaction are part of the latest state of the UTXO set.
But for RGB, there is no globally propagated data, so there is no such global view of the UTXO set. After an RGB client accepts a transaction, it not only needs to verify that the latest state of the transaction is valid, but also must perform the same verification on all previous state transformations related to the transaction, all the way back to the founding state of the issuing contract.
This seems to bring about an obvious disadvantage:Causes verification to take a long time
But this only occurs when “an asset has a long trading history,” and this part of the trading history can be verified in advance through a data sharing layer (on a voluntary basis).
This also brings significant advantages:The client does not need to know or verify all transactions that occur globally
Because it only needs to know the transactions related to its own wallet, it does not need to verify other transactions, so the amount of data to be verified by each client is smaller, and the system scalability is significantly enhanced.
4.3 Bitcoin’s promise of certainty
How RGB prevents “double spending” is achieved through RGB commitments. Such commitments need to be realized:
1️⃣Multiple state transitions involving a contract can be committed to a single Bitcoin transaction
2️⃣Each contract state transition can only be committed to a Bitcoin transaction once
The specific way to achieve this is:
1️⃣First, all state transitions related to a certain contract (or asset ID) must be deterministically aggregated into a commitment
2️⃣Then, the commitments of all transferred assets are aggregated into a Merkle tree
3️⃣The final root hash value is the final RGB commitment;
4️⃣In order to ensure compatibility with other protocols that have nothing to do with RGB but also need to use deterministic Bitcoin commitments, the RGB commitments and the commitments of other protocols must be aggregated again (as described in the LNPBP-4 standard), and the hash obtained in this way The value is the message that is actually embedded in the Bitcoin transaction.
4.4 Batch processing
As we can know from the previous section, we can “wrap” any number of state changes in a single Bitcoin commitment, so large-scale batch processing is theoretically possible.
Scenario:A wants to pay multiple people at the same time, transfer an RGB20 asset to B, transfer an RGB21 asset to C, and transfer the ownership of a contract to D
Result:A only needs to create a state transition for each of B, C, and D, and commit all state transitions to the same Bitcoin transaction. That’s it. It doesn’t need to occupy more bytes. This means that the marginal cost of on-chain fees for each RGB payment can be very small, because the same fee is spread evenly across any number of transfers.
But we also need to see the limitations here, that is: these state transition information must be “wrapped” in the same UTXO. If there are multiple, then the input of this transaction needs to be increased, and the corresponding costs will also be improve. But compared to the traditional situation where each one requires a transaction, great improvements can be achieved.
This batch processing capability is very important for service providers who use merged UTXO, and there will be many application scenarios.
4.5 Communication between clients
In order to complete an RGB transfer, participating clients need to share some data with each other.
If you have a detailed understanding of the transfer steps of RGB assets, you can know that the sender needs to share the consignment with the recipient(s).This data structure contains all the information needed to verify the transfer, including all state transitions that can be traced back to the contract’s founding state.
The consignment needs to be transferred from the sender to the receiver through communication, but the RGB protocol does not care about the communication channel used for this data sharing operation, because there are many ways to do it. However, as a whole, there are two main ways to share data in RGB software:
After having a general concept of the RGB protocol, I think at this time, we can understand how the protocol developed step by step. Any agreement at this level is not achieved overnight and must have gone through many changes and innovations.
envisioning stage
RGB was originally conceived by Giacomo Zucco and Peter Todd, who proposed the client-side authentication and one-time sealing concepts
development stage
Initially, it was maintained by BHB Network and inbitcoin for a period of time, and was supported by Poseidon Group.
Later, the main developer became Alekos Filini
Since mid-2019 to date, Pandora Core AG and Dr. Maxim Orlovsky have become major contributors to technology development
Gradual maturity stage
Since 2019, the RGB protocol has received help from many contributors and industry organizations and has gradually matured. and is a project based on a set of standards maintained by the LNP/BP Standards Association.
For example: At this stage, RGB was reconstructed from a token protocol to a general smart contract system, absorbing many parts of confidential transactions, and using Blockstream’s bulletproof technology. The overall work was financially supported by Bitfinex/Tether Inc and Fulgur Ventures. (This is also the basis for the continued development of the RGB protocol)
Adam Back’s advice and Blockstream engineers played an important role in the technical design of its RGB, including Andrew Poelstra (Bulletproof, mimblewimple, Confidential Transactions), Peter Wuille (Confidential Transactions, Bulletproof) and Christian Decker (Lightning Network, Systems) architectural design )work. So this is another important reason why I pay attention to Liquid. On a theoretical basis, the two have a lot of exchanges, and I am very optimistic about the combination of the two in the future.
The main protocol development work of RGB is almost completed. In the v0.10 version, asset issuance and other functions can be easily used. However, some problems were encountered when connecting to bolt-ln (current bolt lightning network), so the bifrost standard was designed. The protocol is used to expand smart contracts and further proposes the Storm standard.
The v0.11 version is currently undergoing a security audit and is expected to be completed and released in early 2024. The v0.11 version is a major update compared to v0.10. The contracts between the two are definitely no longer compatible. There may be plans to exchange assets by then. There may or may not be a bridge. After all, the current versions are all test versions.
I rather expect that the v0.11 protocol version will become a large stable version, which will bring a certain degree of certainty to the development of ecological projects under the protocol.
Next, let me talk about the existing problems of the RGB protocol in detail:
1️⃣Slow development progress
This problem has been criticized by many people, and the reasons are caused by many factors:
—The LNP/BP Association has very few developers, and the main code work is completed by Dr. Maxim and Bitfinex
—LNP/BP is a non-profit organization, and its operations basically rely on donations. Although it has financial support from Bitfinex/Tether Inc and Fulgur Ventures, the use of funds also requires careful planning (for example, if you want to hold an offline conference every year, you may not have a budget)
2️⃣ Strong instability
This instability refers to “the extent to which protocol updates may break older versions.
For example, this time v0.10 will cause greater uncertainty due to the contract damage (incompatibility) of v0.11.
If the ecological projects under the protocol develop functions based on v0.10, they may need to be redone in v0.11, which will bring high risk costs. But from the perspective of the association itself, it is for overall renewal and planning, and will not consider this issue at this stage.
3️⃣Mismatch problem
The association itself considers the overall development plan of the agreement, which may not necessarily match the needs of the market.
4️⃣Insufficient attention to funds
At present, there are very few big funders paying attention to RGB. Institutions are still immersed in narratives that can be seen quickly, such as inscriptions. There is not enough attention to large and in-depth protocols like RGB, so the development of the ecology is temporarily There hasn’t been much improvement (although it’s better than before, but I personally think it’s due to the spillover effect of funds)
When expressing my opinions, I like to give my reasons very much, because this is also the basis for my judgment; I don’t like to call orders and fomo without thinking, because that is not in line with my true intention. So, let’s sort it out first:
—The ecological development of BTC is the result of the common hope of current miners, old funds, etc., and a new narrative is also needed in the market;
—The basic technical conditions for the development of the BTC ecosystem are already in place, of which taproot upgrade is a very important part;
—Asset issuance is the first step in ecological development. Without assets, nothing can be done. So we can see various protocols based on the issuance of assets on Bitcoin, and gradually overflow to other public chains;
—Ecological development cannot just be the issuance of assets, it can only be the first step. The second step is to implement application scenarios for these assets, that is, to process and exchange assets, etc. This requires smart contracts, which can be simple to complex;
—Of the current protocols, the only native ones I have seen are RGB and Bitvm, and as I said before, RGB is more practical.
This is why I like him!
However, the development process of things is often not as consistent as imagined. Let’s use a picture to express it:
Part 2: Agreement Part—Understanding LNP/BP
LNP: Lighting network protocol (Lightning network protocol)
BP: Bitcoin protocol
This is a Swiss non-profit organization,Responsible for overseeing the Layer 2 and 3 open standards and protocols for Bitcoin and the Lightning Network. They are the creators of L2 and L3 protocols such as RGB, Bifrost, Storm, Prometheus, Kaleidscope, and are active builders of the #BiFi (Bitcoin Finance) ecosystem on the Lightning Network. The association consists of@dr-orlovskyand@giacomozuccoFounded in 2019
Official website link Twitter link github link
Github contains a large amount of open source information about RGB and related protocols. Technical friends can take a closer look.
LNP/BP has a very strong lineup of donor organizations, including:
Moreover, TEDA has stated many times that it will issue USDT on the RGB protocol and promote the development of the RGB protocol!
2.1 LNPBP-1: Public Key
to be continued…
Part Three: Summary of Frequently Asked Questions
In this part, I will continue to summarize and update various issues related to RGB and BTC technology encountered in learning and community operations in this place.
There are four main types of bitmap addresses:
1️⃣Legacy/Payment Public Key Hash (P2PKH) address
This kind of traditional Bitcoin address is the form of the address when it was created in the early days, so it is also called a “legacy address” or a “payment public key hash (P2PKH) address” because when Bitcoin was launched in 2009, its generation method was Starting with the generation of a public/private key pair, which at the time was the only way to create an address.
This type of address all starts with “1”. Because it uses the most space in transactions, it is also the most expensive address type.
2️⃣Pay-to-Script-Hash (P2SH) address
This type of address does not use the hash operation result of the public key, but uses the hash operation of certain scripts to record demerits, and can be used for transfers that require multiple signatures, etc.
This type of address starts with “3” because you can use Segregated Witness to save transaction fees, sending to a P2SH address is about 26% cheaper than a wallet using the old address.
3️⃣Segregated Witness Address (SegWit) Bech32 Address
Segwit addresses are also known as Bech32 addresses. This type of Bitcoin address reduces the amount of information stored in a transaction. They do not store signatures and scripts in the transaction, but in the witness (commit).
This type of address starts with “bc1q”. Compared with P2SH addresses, Segwit addresses can save about 16% of transaction fees, and compared with traditional addresses, they can save more than 38% of fees.
4️⃣Taproot address
To increase block space efficiency and improve fees, SegWit has introduced some changes in how addresses are constructed. Therefore, based on the SegWit address, the Taproot address was developed, which is translated as the main root address.
This type of address starts with “bc1p”, which further reduces storage space, improves transaction efficiency, and provides better privacy.
This is a commonly used technical method on BTC: HD Wallet
This technology allows a pair of “public and private keys” to generate countless sub-public keys, which are the addresses we see; this feature is to protect the privacy of Bitcoin wallet users.
Because in traditional use, in order to confirm transactions, users will expose their public keys, then there is a risk of revealing their true identity (which can be continuously tracked), but after using HD Wallet, after every use, Convert it to another sub-public key so it cannot be traced.
For details, please refer to the following documents:
HD Wallets | Hierarchical Deterministic Wallets
An explanation of what an HD Wallet is, how they work in Bitcoin, and their history.
Many people will argue about the title “first” because people like to chase the first
If you want to talk about the first asset on RGB, it was probably released when Dr. Maxim himself tried it. Of course, neither you nor I saw it.
If you want to talk about the RGB sample assets opened by the LNP/BP Association, you can refer to the following website
If it is an asset issued on the project party bitmask under the RGB protocol, you can refer to the following website
But bitmask is only a project party under the RGB protocol, because RGB is “client verified”, so as long as you can build a client, you can also use the “command line” to issue your own “first RGB asset”
Therefore, I think arguing about who is number one is meaningful for short-term publicity, but in the long run, the value contained in the assets is more meaningful. This value may be community spirit, empowerment, etc.
In fact, you can’t ask this, because: RGB uses the Bitcoin network for “security endorsement” and “prevention of double spending”. In principle, it can be used on any other network with such characteristics.
If the RGB transaction runs on the main network, then its transactions are uploaded to the main network in real time; if the RGB transaction runs on the Lightning Network, then its transaction data is uploaded to the Lightning Network in real time, and the data of the Lightning Network is stored off-chain. Yes, it will only be chained on the BTC main network at the moment of withdrawal; if RGB transactions run on other networks, the data chaining situation will also be determined based on the conditions of other networks.
It must also be pointed out that the actual transaction data of RGB is stored on the client, and what is uploaded to the chain is the aggregation of transaction commitments.
For me, I think RGB is a general technology that can be connected to L1/L2/L3. It can do many things and is a very critical part of the development of BTC ecology; it can realize BIFI, that is, bitcoin+fi, which can It is defi, nftfi, gamefi, or other forms of fi
In fact, many people pay attention to the application of RGB in crypto, but RGB can do more, such as bonds, treasury bonds, the combination of real assets and virtual assets, etc.
The RGB protocol can run on the main network, on the Lightning Network, and even on side chains in the future.
RGB is designed to run on the Lightning Network for the sake of scalability. Because of running smart contracts, the tps of the main network obviously cannot meet this requirement. The high tps of the Lightning Network can, but the current Bolt Lightning Network cannot. It meets the complex smart contract requirements of RGB, so it needs to be upgraded to bifrost to become complete;
The current problem is due to the size of the Lightning Network channel, and the Lightning Network was originally designed for small payments; of course, if you build a large channel yourself, you can also make large payments (generally large amounts go to the mainnet) )
I think there are two reasons why Lightning Network is used instead of side chains:
1️⃣ Side chains are generally considered not native enough, because side chains have their own chain, their own nodes, their own blocks and their own consensus mechanism. You can even say that it has little to do with the BTC main network; but Lightning The network can be understood as something hanging on the BTC main network. It is very native and is called L2.
2️⃣The theoretical TPS of the Lightning Network is much higher than that of the side chain
I also have this kind of worry, especially since there don’t seem to be many donations at the moment (in fact, the return rate on investments like TEDA is very high), but I still appreciate the spirit of the association in a non-profit way. Do such great things.
Mainly speaking, most of the work on the RGB protocol has been completed. Of course, there are still many tasks to follow; I think if the RGB protocol gets more and more people’s attention, as more and more devs join, the development work will change. quick.
Yes, and multiple times
As of December 17, 2023, everyone is waiting for the update of v0.11. This update involves updates to smart contracts, wallets, etc.; we hope that v0.11 will become a larger stable version, so that projects in the ecosystem can A relatively safe development.
If v0.11 is released, the issuance and transfer of RGB assets based on the Lightning Network will soon be realized (it will be very fast), but complex smart contracts still rely on the development of the bifrost Lightning Network.
bitmask/bitlight: Two very formal project parties. The former was announced on the LNP/BP homepage and focuses on the development of wallets and diba (nft market). The latter focuses on the development of wallets and dex;
pprgb: The first rgb meme with market popularity, a project temporarily released on liquid (note the attributive)
seal: Projects that hope to issue NFT and empower tokens on rgb insist on issuing on rgb
UTXO exchange: I want to build dex on rgb and use zero-roll airdrops. The assets it issues must be rgb assets. However, given the current form, it is speculated that it will be in a centralized form and assess the risks by itself.
BiHelix: Originally named infinity, it was later renamed intas, and later renamed Bihelix. I wrote a lot of articles and did a lot of evangelistic work, but in the early days there was some unpleasantness with the LNP/BP agreement and it was identified as a scam. I suggest They need to deal with this problem well, otherwise it will be more difficult to do it on this track
rgbdoge: It is speculated that it is a Chinese project (I don’t care whether it is Chinese or foreign, it depends on the quality and strategy of the project). It has strong action, but lacks direction (from the initial battle for “number one”, to building a platform, to going issued on liquid)
bitrgb: A platform for making RGB smart contracts. It is currently using the nostrasset method. I have recommended the zealy task (Lubai idea) before, but in view of the “anonymity of the team/anonymity of investment institutions/charge mint (the price seems not low)” ”, feeling that the risk is very high
Recently, it was discovered that LNP/BP tg was identified as scam by Dr. Maxim.
Inscriptionwar: This is completely free, so there is no need to participate.
Off-chain security depends on the project party or the client itself, so the association needs to establish unified standards for storage, etc., to ensure the security of assets, etc.
The main data is stored on the off-chain client, and clients can share information and communicate through Storm nodes in the future.
Let me give a brief introduction. Adam Back founded the blockstream company. This company has many products, such as the elements side chain development platform. They also have green wallet products, real mining pools, and financial management products related to mining pools. Financial products, etc.;
Liquid is L2 developed using the elements platform, and sideswap is a project on Liquid.
The storage security of off-chain data is provided by the project party. Users can protect the security of their assets by backing up data. Of course, if there is a problem with the project party’s data and the user does not back up the data himself, then there will be problems with the assets. .
Some malicious project parties may commit crimes by creating malware, but the usage mechanism of RGB can avoid mechanism fraud. Of course, RGB is difficult to prevent in all blockchains.
Yes, using the Storm protocol, data is shared between peers, but current development is overdue
Can’t. The project party cannot collect information about individual transactions and may only collect number transfers completed within the application (such as aggregate statistics).
Of course, I personally think that if the user authorizes the relevant permissions, then the application can access this data (it will be somewhat similar to the unblinding key on Liquid to view the blinding information)
Yes, but every company needs to comply with regulations regarding securities.
1) The asset has ContractID and genesis initial value
2) Compatible with RGB wallet
3) Open source
This way you can know whether it is an RGB asset
UTXO is the “public” asset layer, but only between the same assets, for example: USDT<>USDT; in the future, we can achieve “interoperability” between different assets, but this requires Bifrost
This is possible, but the target chain must support the UTXO model and other available models in order to integrate with RGB Core and cross libraries. At this time, the assets need to follow the specifications of the RGB20 model.
In fact, RGB is compatible with LN and you can use it with any LN implementation, such as inserting CLN or LND. When using Storm, acknowledgment of each sample is possible on the LN; on L1, the acknowledgment and routing of the asset is only done if you open/close the channel or scan using HTLC.
Yes, this requires a lot of support libraries to work together,
In theory, the process can be simplified through authorization. Of course, this is only in theory.
Part 4: Reference links
Here, you can learn:
1️⃣What is RGB, what can it do, and what are its advantages (Jump)
2️⃣How to try the RGB library, such as command line, installing nodes, calling API, etc. (Jump)
3️⃣Learn RGB through official videos (of course, it is difficult for non-English speakers) (Jump)
Scalable & confidential smart contracts for Bitcoin & Lightning
This document explains the design principles and provides in-depth technical insights into how RGB systems are constructed and work, including:
1️⃣Overview and goals of protocol design (Jump)
2️⃣Introduction to “Client Verification”, describing “Single-use-seals”and”Deterministic bitcoin commitments”(Jump)
3️⃣Explanation of “RGB Contract, Status and Operation” (Jump)
4️⃣Some contents of “Try RGB Contract”: including writing contracts, interacting with contracts, P2P communication, interacting with wallets, etc. (Jump)
RGB Blackpaper | RGB Blackpaper
Turing-complete, Scalable & Confidential Smart Contract Layer for Bitcoin & LN
If you encounter problems, you can first check whether this official document has any answers.
Here, you can learn about the Turing-complete Alu virtual machine developed by the LNP/BP Association
1️⃣CoinEx Research
A Brief Analysis of RGB: A Scalable, Confidential Smart Contract Protocol Built on Bitcoin
Blog | CoinEx - The Global Cryptocurrency Exchange
2️⃣Federico Tenga
Understanding the RGB protocol
@FedericoTenga">Federico Tenga – Medium
@FedericoTenga">Read writing from Federico Tenga on Medium. Working on Bitcoin stuff. Every day, Federico Tenga and thousands of other voices re…
@FedericoTenga">medium.com
3️⃣Bitfinex
How Can RGB Improve Bitcoin?
How Can RGB Improve Bitcoin? - Bitfinex blog
4️⃣Waterdrip Capital
Detailed explanation of RGB protocol: finding a new way to create a new second layer of Bitcoin asset issuance
5️⃣ Design of RGB protocol
A Chinese gathering place for Bitcoin ideas
Many people are starting to pay attention to Bitcoin’s RGB protocol and are really happy. However, most people are relatively unfamiliar with such a protocol (especially a relatively technically complex protocol), and do not know how to research and try the content and ecology of the protocol.
Therefore, I specially write a continuously updated Mirror to summarize relevant learning materials and provide a relatively reasonable learning path; at the same time, it also serves as a record of personal learning about RGB.
Part One: Popular Science Part-Initial Understanding of RGB
When many people see the three words RGB, they think of “the three primary colors: red green blue”. If you look at the icon, this is really the case. This is because the RGB protocol utilizes the early concept of “dyed coins”.
Here we are talking aboutRGB isan agreement,An extremely private, scalable smart contract system protocol that can run on the Bitcoin mainnet, Lightning Network, or similar networks。
This protocol is currently maintained and updated by the LNP/BP protocol, and bitfinex also participates in some code work.
It is difficult to simply classify RGB into the category of Bitcoin L2. It does not have its own chain, it does not have its own layer, and it can operate on other L2s of BTC. Therefore, to be precise:It is a universal technology。
In the industry, it is generally believed that RGB and Bitvm will be the ultimate form of BTC expansion, because they can both achieve the scalability of the BTC ecosystem based on the native nature of BTC. Compared with Bitvm, which is far away,RGB has been gradually implemented。
It is worth mentioning that RGB is a technology that is not limited to crypto. It can be widely used in our non-crypto scenarios. As the protocol becomes more mature, we will see more and more use cases.
From the official introduction, we can see the functions that the RGB protocol can achieve:
If we classify it, we can see:
From this perspective, RGB allows BTC to have most of the functions of the current EVM, but it is not implemented in a non-native form similar to “EVM compatible”, but implemented natively. I have to say that this set of theories and designs The concept is awesome.
In fact, it is worth noting that the RGB smart contract system is very different from previous methods, whether based on Bitcoin (Colored Coins, Counterparty, OMNI) or non-Bitcoin (Ethereum, EOS, etc.), it has its own Unique features:
The first meaning is that smart contracts will be better stratified. The issuer only has the rights to the contract at the moment of issuance, and then the state owner will have the rights during the continuous state evolution process;
The second meaning is that it keeps the code off-chain, which can save on-chain space, improve running speed, and reduce development difficulty, but it can also ensure security through mechanisms;
The third article reveals its security endorsement layer (blockchain), and it is Turing complete and can support simple language operations.
Therefore, the following picture may be closer to the correct understanding:
From Dr. Maxim Orlovsky’s teaching video, we can see that the officially recognized RGB characteristics include:
Let’s break it down one by one:
1️⃣Extreme privacy
2️⃣High security
I don’t quite understand these two points, I need to study them.
3️⃣Highly scalable
4️⃣No congestion
5️⃣Extremely high integration
So, in fact, in my eyes, RGB for BTC is more like the following:
Compared with other protocols, the RGB protocol has its own very unique technical points. Here are a few important parts of simple science:
4.1 Disposable sealing
This technology was first proposed by Peter Todd in 2016. Its main meaning is to “add a seal to a message to ensure that the message can only be used once, because you must remove the seal to know the message.”
A simple method is to set up a notarized third-party server that publishes a certificate in a public registry whenever a seal is opened or locked, so that anyone can verify the status of the seal they care about.
If you do not use a trusted entity to implement the one-time seal function, you can use Bitcoin’s UTXO as a seal. Because any UTXO in Bitcoin can only be spent once. Therefore, using UTXO as a seal, you can lock the UTXO when it is created and open it when you spend it.
RGB utilizes such a “one-time sealing” technology, which “wraps” RGB asset information, contract status, etc. in UTXO. When UTXO is spent, the ownership of the asset and the status of the contract change. This means that every time an RGB transaction occurs, the sender actually creates a contract (the one that defines the rights being transferred).status change。
Take RGB20 as an example:
1️⃣First, the issuer of the contract sets the founding state of the contract and defines the details of the contract: the name of the asset, the total supply, etc., and the issuer has the right to move the UTXO of these supplies;
2️⃣When an asset is transferred for the first time, the owner of the first UTXO can create a state change to define which UTXO will hold the asset;
3️⃣State change can be applied to the right to change the ownership of the asset, or to other types of rights, such as the right to secondary issuance, or the right to add/change specific attributes of the asset (for example: metadata), etc. .
4.2 Client verification
RGB verification is different from the traditional “global consensus” verification and uses “client verification” technology.
With traditional Bitcoin verification, a node connected to the network continuously downloads and verifies blocks and transactions in a transaction pool (full node). Such a node has a real-time updated view of the UTXO set on the entire chain (the set of all unspent outputs on the blockchain). When it sees a new transaction, to verify its validity, it only needs to verify All inputs to the transaction are part of the latest state of the UTXO set.
But for RGB, there is no globally propagated data, so there is no such global view of the UTXO set. After an RGB client accepts a transaction, it not only needs to verify that the latest state of the transaction is valid, but also must perform the same verification on all previous state transformations related to the transaction, all the way back to the founding state of the issuing contract.
This seems to bring about an obvious disadvantage:Causes verification to take a long time
But this only occurs when “an asset has a long trading history,” and this part of the trading history can be verified in advance through a data sharing layer (on a voluntary basis).
This also brings significant advantages:The client does not need to know or verify all transactions that occur globally
Because it only needs to know the transactions related to its own wallet, it does not need to verify other transactions, so the amount of data to be verified by each client is smaller, and the system scalability is significantly enhanced.
4.3 Bitcoin’s promise of certainty
How RGB prevents “double spending” is achieved through RGB commitments. Such commitments need to be realized:
1️⃣Multiple state transitions involving a contract can be committed to a single Bitcoin transaction
2️⃣Each contract state transition can only be committed to a Bitcoin transaction once
The specific way to achieve this is:
1️⃣First, all state transitions related to a certain contract (or asset ID) must be deterministically aggregated into a commitment
2️⃣Then, the commitments of all transferred assets are aggregated into a Merkle tree
3️⃣The final root hash value is the final RGB commitment;
4️⃣In order to ensure compatibility with other protocols that have nothing to do with RGB but also need to use deterministic Bitcoin commitments, the RGB commitments and the commitments of other protocols must be aggregated again (as described in the LNPBP-4 standard), and the hash obtained in this way The value is the message that is actually embedded in the Bitcoin transaction.
4.4 Batch processing
As we can know from the previous section, we can “wrap” any number of state changes in a single Bitcoin commitment, so large-scale batch processing is theoretically possible.
Scenario:A wants to pay multiple people at the same time, transfer an RGB20 asset to B, transfer an RGB21 asset to C, and transfer the ownership of a contract to D
Result:A only needs to create a state transition for each of B, C, and D, and commit all state transitions to the same Bitcoin transaction. That’s it. It doesn’t need to occupy more bytes. This means that the marginal cost of on-chain fees for each RGB payment can be very small, because the same fee is spread evenly across any number of transfers.
But we also need to see the limitations here, that is: these state transition information must be “wrapped” in the same UTXO. If there are multiple, then the input of this transaction needs to be increased, and the corresponding costs will also be improve. But compared to the traditional situation where each one requires a transaction, great improvements can be achieved.
This batch processing capability is very important for service providers who use merged UTXO, and there will be many application scenarios.
4.5 Communication between clients
In order to complete an RGB transfer, participating clients need to share some data with each other.
If you have a detailed understanding of the transfer steps of RGB assets, you can know that the sender needs to share the consignment with the recipient(s).This data structure contains all the information needed to verify the transfer, including all state transitions that can be traced back to the contract’s founding state.
The consignment needs to be transferred from the sender to the receiver through communication, but the RGB protocol does not care about the communication channel used for this data sharing operation, because there are many ways to do it. However, as a whole, there are two main ways to share data in RGB software:
After having a general concept of the RGB protocol, I think at this time, we can understand how the protocol developed step by step. Any agreement at this level is not achieved overnight and must have gone through many changes and innovations.
envisioning stage
RGB was originally conceived by Giacomo Zucco and Peter Todd, who proposed the client-side authentication and one-time sealing concepts
development stage
Initially, it was maintained by BHB Network and inbitcoin for a period of time, and was supported by Poseidon Group.
Later, the main developer became Alekos Filini
Since mid-2019 to date, Pandora Core AG and Dr. Maxim Orlovsky have become major contributors to technology development
Gradual maturity stage
Since 2019, the RGB protocol has received help from many contributors and industry organizations and has gradually matured. and is a project based on a set of standards maintained by the LNP/BP Standards Association.
For example: At this stage, RGB was reconstructed from a token protocol to a general smart contract system, absorbing many parts of confidential transactions, and using Blockstream’s bulletproof technology. The overall work was financially supported by Bitfinex/Tether Inc and Fulgur Ventures. (This is also the basis for the continued development of the RGB protocol)
Adam Back’s advice and Blockstream engineers played an important role in the technical design of its RGB, including Andrew Poelstra (Bulletproof, mimblewimple, Confidential Transactions), Peter Wuille (Confidential Transactions, Bulletproof) and Christian Decker (Lightning Network, Systems) architectural design )work. So this is another important reason why I pay attention to Liquid. On a theoretical basis, the two have a lot of exchanges, and I am very optimistic about the combination of the two in the future.
The main protocol development work of RGB is almost completed. In the v0.10 version, asset issuance and other functions can be easily used. However, some problems were encountered when connecting to bolt-ln (current bolt lightning network), so the bifrost standard was designed. The protocol is used to expand smart contracts and further proposes the Storm standard.
The v0.11 version is currently undergoing a security audit and is expected to be completed and released in early 2024. The v0.11 version is a major update compared to v0.10. The contracts between the two are definitely no longer compatible. There may be plans to exchange assets by then. There may or may not be a bridge. After all, the current versions are all test versions.
I rather expect that the v0.11 protocol version will become a large stable version, which will bring a certain degree of certainty to the development of ecological projects under the protocol.
Next, let me talk about the existing problems of the RGB protocol in detail:
1️⃣Slow development progress
This problem has been criticized by many people, and the reasons are caused by many factors:
—The LNP/BP Association has very few developers, and the main code work is completed by Dr. Maxim and Bitfinex
—LNP/BP is a non-profit organization, and its operations basically rely on donations. Although it has financial support from Bitfinex/Tether Inc and Fulgur Ventures, the use of funds also requires careful planning (for example, if you want to hold an offline conference every year, you may not have a budget)
2️⃣ Strong instability
This instability refers to “the extent to which protocol updates may break older versions.
For example, this time v0.10 will cause greater uncertainty due to the contract damage (incompatibility) of v0.11.
If the ecological projects under the protocol develop functions based on v0.10, they may need to be redone in v0.11, which will bring high risk costs. But from the perspective of the association itself, it is for overall renewal and planning, and will not consider this issue at this stage.
3️⃣Mismatch problem
The association itself considers the overall development plan of the agreement, which may not necessarily match the needs of the market.
4️⃣Insufficient attention to funds
At present, there are very few big funders paying attention to RGB. Institutions are still immersed in narratives that can be seen quickly, such as inscriptions. There is not enough attention to large and in-depth protocols like RGB, so the development of the ecology is temporarily There hasn’t been much improvement (although it’s better than before, but I personally think it’s due to the spillover effect of funds)
When expressing my opinions, I like to give my reasons very much, because this is also the basis for my judgment; I don’t like to call orders and fomo without thinking, because that is not in line with my true intention. So, let’s sort it out first:
—The ecological development of BTC is the result of the common hope of current miners, old funds, etc., and a new narrative is also needed in the market;
—The basic technical conditions for the development of the BTC ecosystem are already in place, of which taproot upgrade is a very important part;
—Asset issuance is the first step in ecological development. Without assets, nothing can be done. So we can see various protocols based on the issuance of assets on Bitcoin, and gradually overflow to other public chains;
—Ecological development cannot just be the issuance of assets, it can only be the first step. The second step is to implement application scenarios for these assets, that is, to process and exchange assets, etc. This requires smart contracts, which can be simple to complex;
—Of the current protocols, the only native ones I have seen are RGB and Bitvm, and as I said before, RGB is more practical.
This is why I like him!
However, the development process of things is often not as consistent as imagined. Let’s use a picture to express it:
Part 2: Agreement Part—Understanding LNP/BP
LNP: Lighting network protocol (Lightning network protocol)
BP: Bitcoin protocol
This is a Swiss non-profit organization,Responsible for overseeing the Layer 2 and 3 open standards and protocols for Bitcoin and the Lightning Network. They are the creators of L2 and L3 protocols such as RGB, Bifrost, Storm, Prometheus, Kaleidscope, and are active builders of the #BiFi (Bitcoin Finance) ecosystem on the Lightning Network. The association consists of@dr-orlovskyand@giacomozuccoFounded in 2019
Official website link Twitter link github link
Github contains a large amount of open source information about RGB and related protocols. Technical friends can take a closer look.
LNP/BP has a very strong lineup of donor organizations, including:
Moreover, TEDA has stated many times that it will issue USDT on the RGB protocol and promote the development of the RGB protocol!
2.1 LNPBP-1: Public Key
to be continued…
Part Three: Summary of Frequently Asked Questions
In this part, I will continue to summarize and update various issues related to RGB and BTC technology encountered in learning and community operations in this place.
There are four main types of bitmap addresses:
1️⃣Legacy/Payment Public Key Hash (P2PKH) address
This kind of traditional Bitcoin address is the form of the address when it was created in the early days, so it is also called a “legacy address” or a “payment public key hash (P2PKH) address” because when Bitcoin was launched in 2009, its generation method was Starting with the generation of a public/private key pair, which at the time was the only way to create an address.
This type of address all starts with “1”. Because it uses the most space in transactions, it is also the most expensive address type.
2️⃣Pay-to-Script-Hash (P2SH) address
This type of address does not use the hash operation result of the public key, but uses the hash operation of certain scripts to record demerits, and can be used for transfers that require multiple signatures, etc.
This type of address starts with “3” because you can use Segregated Witness to save transaction fees, sending to a P2SH address is about 26% cheaper than a wallet using the old address.
3️⃣Segregated Witness Address (SegWit) Bech32 Address
Segwit addresses are also known as Bech32 addresses. This type of Bitcoin address reduces the amount of information stored in a transaction. They do not store signatures and scripts in the transaction, but in the witness (commit).
This type of address starts with “bc1q”. Compared with P2SH addresses, Segwit addresses can save about 16% of transaction fees, and compared with traditional addresses, they can save more than 38% of fees.
4️⃣Taproot address
To increase block space efficiency and improve fees, SegWit has introduced some changes in how addresses are constructed. Therefore, based on the SegWit address, the Taproot address was developed, which is translated as the main root address.
This type of address starts with “bc1p”, which further reduces storage space, improves transaction efficiency, and provides better privacy.
This is a commonly used technical method on BTC: HD Wallet
This technology allows a pair of “public and private keys” to generate countless sub-public keys, which are the addresses we see; this feature is to protect the privacy of Bitcoin wallet users.
Because in traditional use, in order to confirm transactions, users will expose their public keys, then there is a risk of revealing their true identity (which can be continuously tracked), but after using HD Wallet, after every use, Convert it to another sub-public key so it cannot be traced.
For details, please refer to the following documents:
HD Wallets | Hierarchical Deterministic Wallets
An explanation of what an HD Wallet is, how they work in Bitcoin, and their history.
Many people will argue about the title “first” because people like to chase the first
If you want to talk about the first asset on RGB, it was probably released when Dr. Maxim himself tried it. Of course, neither you nor I saw it.
If you want to talk about the RGB sample assets opened by the LNP/BP Association, you can refer to the following website
If it is an asset issued on the project party bitmask under the RGB protocol, you can refer to the following website
But bitmask is only a project party under the RGB protocol, because RGB is “client verified”, so as long as you can build a client, you can also use the “command line” to issue your own “first RGB asset”
Therefore, I think arguing about who is number one is meaningful for short-term publicity, but in the long run, the value contained in the assets is more meaningful. This value may be community spirit, empowerment, etc.
In fact, you can’t ask this, because: RGB uses the Bitcoin network for “security endorsement” and “prevention of double spending”. In principle, it can be used on any other network with such characteristics.
If the RGB transaction runs on the main network, then its transactions are uploaded to the main network in real time; if the RGB transaction runs on the Lightning Network, then its transaction data is uploaded to the Lightning Network in real time, and the data of the Lightning Network is stored off-chain. Yes, it will only be chained on the BTC main network at the moment of withdrawal; if RGB transactions run on other networks, the data chaining situation will also be determined based on the conditions of other networks.
It must also be pointed out that the actual transaction data of RGB is stored on the client, and what is uploaded to the chain is the aggregation of transaction commitments.
For me, I think RGB is a general technology that can be connected to L1/L2/L3. It can do many things and is a very critical part of the development of BTC ecology; it can realize BIFI, that is, bitcoin+fi, which can It is defi, nftfi, gamefi, or other forms of fi
In fact, many people pay attention to the application of RGB in crypto, but RGB can do more, such as bonds, treasury bonds, the combination of real assets and virtual assets, etc.
The RGB protocol can run on the main network, on the Lightning Network, and even on side chains in the future.
RGB is designed to run on the Lightning Network for the sake of scalability. Because of running smart contracts, the tps of the main network obviously cannot meet this requirement. The high tps of the Lightning Network can, but the current Bolt Lightning Network cannot. It meets the complex smart contract requirements of RGB, so it needs to be upgraded to bifrost to become complete;
The current problem is due to the size of the Lightning Network channel, and the Lightning Network was originally designed for small payments; of course, if you build a large channel yourself, you can also make large payments (generally large amounts go to the mainnet) )
I think there are two reasons why Lightning Network is used instead of side chains:
1️⃣ Side chains are generally considered not native enough, because side chains have their own chain, their own nodes, their own blocks and their own consensus mechanism. You can even say that it has little to do with the BTC main network; but Lightning The network can be understood as something hanging on the BTC main network. It is very native and is called L2.
2️⃣The theoretical TPS of the Lightning Network is much higher than that of the side chain
I also have this kind of worry, especially since there don’t seem to be many donations at the moment (in fact, the return rate on investments like TEDA is very high), but I still appreciate the spirit of the association in a non-profit way. Do such great things.
Mainly speaking, most of the work on the RGB protocol has been completed. Of course, there are still many tasks to follow; I think if the RGB protocol gets more and more people’s attention, as more and more devs join, the development work will change. quick.
Yes, and multiple times
As of December 17, 2023, everyone is waiting for the update of v0.11. This update involves updates to smart contracts, wallets, etc.; we hope that v0.11 will become a larger stable version, so that projects in the ecosystem can A relatively safe development.
If v0.11 is released, the issuance and transfer of RGB assets based on the Lightning Network will soon be realized (it will be very fast), but complex smart contracts still rely on the development of the bifrost Lightning Network.
bitmask/bitlight: Two very formal project parties. The former was announced on the LNP/BP homepage and focuses on the development of wallets and diba (nft market). The latter focuses on the development of wallets and dex;
pprgb: The first rgb meme with market popularity, a project temporarily released on liquid (note the attributive)
seal: Projects that hope to issue NFT and empower tokens on rgb insist on issuing on rgb
UTXO exchange: I want to build dex on rgb and use zero-roll airdrops. The assets it issues must be rgb assets. However, given the current form, it is speculated that it will be in a centralized form and assess the risks by itself.
BiHelix: Originally named infinity, it was later renamed intas, and later renamed Bihelix. I wrote a lot of articles and did a lot of evangelistic work, but in the early days there was some unpleasantness with the LNP/BP agreement and it was identified as a scam. I suggest They need to deal with this problem well, otherwise it will be more difficult to do it on this track
rgbdoge: It is speculated that it is a Chinese project (I don’t care whether it is Chinese or foreign, it depends on the quality and strategy of the project). It has strong action, but lacks direction (from the initial battle for “number one”, to building a platform, to going issued on liquid)
bitrgb: A platform for making RGB smart contracts. It is currently using the nostrasset method. I have recommended the zealy task (Lubai idea) before, but in view of the “anonymity of the team/anonymity of investment institutions/charge mint (the price seems not low)” ”, feeling that the risk is very high
Recently, it was discovered that LNP/BP tg was identified as scam by Dr. Maxim.
Inscriptionwar: This is completely free, so there is no need to participate.
Off-chain security depends on the project party or the client itself, so the association needs to establish unified standards for storage, etc., to ensure the security of assets, etc.
The main data is stored on the off-chain client, and clients can share information and communicate through Storm nodes in the future.
Let me give a brief introduction. Adam Back founded the blockstream company. This company has many products, such as the elements side chain development platform. They also have green wallet products, real mining pools, and financial management products related to mining pools. Financial products, etc.;
Liquid is L2 developed using the elements platform, and sideswap is a project on Liquid.
The storage security of off-chain data is provided by the project party. Users can protect the security of their assets by backing up data. Of course, if there is a problem with the project party’s data and the user does not back up the data himself, then there will be problems with the assets. .
Some malicious project parties may commit crimes by creating malware, but the usage mechanism of RGB can avoid mechanism fraud. Of course, RGB is difficult to prevent in all blockchains.
Yes, using the Storm protocol, data is shared between peers, but current development is overdue
Can’t. The project party cannot collect information about individual transactions and may only collect number transfers completed within the application (such as aggregate statistics).
Of course, I personally think that if the user authorizes the relevant permissions, then the application can access this data (it will be somewhat similar to the unblinding key on Liquid to view the blinding information)
Yes, but every company needs to comply with regulations regarding securities.
1) The asset has ContractID and genesis initial value
2) Compatible with RGB wallet
3) Open source
This way you can know whether it is an RGB asset
UTXO is the “public” asset layer, but only between the same assets, for example: USDT<>USDT; in the future, we can achieve “interoperability” between different assets, but this requires Bifrost
This is possible, but the target chain must support the UTXO model and other available models in order to integrate with RGB Core and cross libraries. At this time, the assets need to follow the specifications of the RGB20 model.
In fact, RGB is compatible with LN and you can use it with any LN implementation, such as inserting CLN or LND. When using Storm, acknowledgment of each sample is possible on the LN; on L1, the acknowledgment and routing of the asset is only done if you open/close the channel or scan using HTLC.
Yes, this requires a lot of support libraries to work together,
In theory, the process can be simplified through authorization. Of course, this is only in theory.
Part 4: Reference links
Here, you can learn:
1️⃣What is RGB, what can it do, and what are its advantages (Jump)
2️⃣How to try the RGB library, such as command line, installing nodes, calling API, etc. (Jump)
3️⃣Learn RGB through official videos (of course, it is difficult for non-English speakers) (Jump)
Scalable & confidential smart contracts for Bitcoin & Lightning
This document explains the design principles and provides in-depth technical insights into how RGB systems are constructed and work, including:
1️⃣Overview and goals of protocol design (Jump)
2️⃣Introduction to “Client Verification”, describing “Single-use-seals”and”Deterministic bitcoin commitments”(Jump)
3️⃣Explanation of “RGB Contract, Status and Operation” (Jump)
4️⃣Some contents of “Try RGB Contract”: including writing contracts, interacting with contracts, P2P communication, interacting with wallets, etc. (Jump)
RGB Blackpaper | RGB Blackpaper
Turing-complete, Scalable & Confidential Smart Contract Layer for Bitcoin & LN
If you encounter problems, you can first check whether this official document has any answers.
Here, you can learn about the Turing-complete Alu virtual machine developed by the LNP/BP Association
1️⃣CoinEx Research
A Brief Analysis of RGB: A Scalable, Confidential Smart Contract Protocol Built on Bitcoin
Blog | CoinEx - The Global Cryptocurrency Exchange
2️⃣Federico Tenga
Understanding the RGB protocol
@FedericoTenga">Federico Tenga – Medium
@FedericoTenga">Read writing from Federico Tenga on Medium. Working on Bitcoin stuff. Every day, Federico Tenga and thousands of other voices re…
@FedericoTenga">medium.com
3️⃣Bitfinex
How Can RGB Improve Bitcoin?
How Can RGB Improve Bitcoin? - Bitfinex blog
4️⃣Waterdrip Capital
Detailed explanation of RGB protocol: finding a new way to create a new second layer of Bitcoin asset issuance
5️⃣ Design of RGB protocol
A Chinese gathering place for Bitcoin ideas