What is RGB?
Last updated
Last updated
RGB is officially described as "a protocol to issue and transfer digital assets and more generic rights on the Bitcoin blockchain through the use of customizable off-chain smart contracts." The protocol is published by the LNP/BP Standards Association, with support from Fulgur Ventures, Bitfinex, Hojo Foundation, Pandora Prime, and DIBA.
The concept of Single-Use-Seals was first introduced by Peter Todd in his 2016 article . When explaining the uniqueness of Bitcoin transaction histories, he introduced a general method of identification, namely the concept of encrypting a one-time seal. In simple terms, it is similar to the methods used to protect the transport and storage of goods by adding a one-time seal to the object that needs protection, allowing it to have only two states: open and closed, and this seal can only be closed once. This ensures that the contents inside have not been opened.
Unlike using trusted entities to prove the opening and closing of digital seals, RGB uses Bitcoin's Unspent Transaction Outputs (UTXOs) as seals. In practice, a UTXO can be seen as a seal that is closed when created and opened when spent. Due to Bitcoin's consensus rules, an output can only be spent once, and therefore, if used as a seal, the same incentive mechanisms enforcing Bitcoin's consensus rules will ensure that the seal can only be opened once.
With each ownership transfer, a revision to the original contract is essentially made, specifying which new Bitcoin UTXO now controls the ownership.
Blinding UTXOs
To enhance the privacy of the recipient during a transfer, RGB utilizes blinded UTXOs as payment output points instead of regular UTXOs. This means that when a user wants to receive funds, they do not share the UTXOs they want to receive assets in a plain format; instead, they share them in a blinded format, formed by concatenating the UTXO with a random blinding secret's hash. In this way, the payer cannot accurately discern where the assets are going, and they cannot monitor when they might be spent in the future (something the payer can typically do when paying on the regular Bitcoin chain).
To prove that their UTXO indeed represents ownership of certain assets during the spending phase, the sender needs to share the blinding secret used to generate the blinded UTXO with the recipient. This sharing is crucial for the verification phase to confirm whether the blinded UTXO receiving the assets is derived from the UTXO spending them.
Bulletproof
In order to conceal the monetary values of each state transition, preventing them from appearing in the transaction history of assets, RGB employs a zero-knowledge mechanism developed by Blockstream called Bulletproof. Bulletproof represents an improved and more efficient version of confidential transactions and has been utilized in the Liquid sidechain.
With the assistance of Bulletproof, users can attain privacy from the future owner of the assets when verifying transactions. While they will be able to see all the UTXOs that previously owned the assets, they won't be able to precisely determine the amount transferred in each state transition, thereby ensuring the privacy of the asset's state.
Bitcoin, as a global consensus system, employs a Proof-of-Work (PoW) mechanism, requiring each node to validate all transactions. This necessitates continuous downloading and validation of all block and transaction information in the memory pool by nodes, leading to issues of fully transparent transaction information and high transaction costs.
In contrast, the core idea of client-side validation is to maintain the critical value of consensus and believes that the consensus layer only needs to retain a concise cryptographic commitment to ledger events, while the ledger itself can be stored off-chain. In practice, RGB operates in such a way that transaction content data is only transmitted between the sender and receiver, while the content is stored off-chain, and the commitment to the data is placed on-chain. Users validate the data when receiving blockchain data to ensure its validity.
In the Bitcoin system, the UTXO is a core concept used to validate the validity of new transactions. When nodes validate the validity of a new transaction, they essentially verify whether all transaction inputs of the transaction are part of the latest state of the UTXO set. From a technical standpoint, the design of the Bitcoin system is a state transition system, encompassing the ownership states of all existing bitcoins and a "state transition function.
However, RGB does not have an equivalent concept to the UTXO set. It adopts a pattern of single-use seals, where each transaction contains a new commitment. During an RGB transaction, the owner of the first UTXO creates a state change, defining which UTXO will hold the asset. The validation process is also different. When a transfer occurs, only the recipient's client needs to validate the transaction. It needs to verify the latest state's validity and validate all state transitions until tracing back to the initial state of the issuance contract to ensure the authenticity and validity of the transfer. The sender needs to share a data structure called Consignment with the recipient, containing all the information needed to validate the transfer and all state transitions back to the initial contract state.
From another perspective, the RGB client only needs to focus on transactions related to its wallet without knowing or validating all transactions occurring globally, reducing the amount of data each client needs to validate.