RV Blog What is RGB?

What is RGB?

What is RGB?

Bitcoin scales in layers. This way, Bitcoin not only gains speed and throughput capacity but also expressiveness. While the Lightning Network is considered the most popular option to increase Bitcoin’s speed and throughput, other solutions like sidechains (RSK, for example) have been developed in order to bring greater functionality to Bitcoin.

While sidechain solutions are based on blockchain technology, there is another approach that is aiming to allow for smart contract functionality without relying on any blockchain to implement it. Rather, smart contracts are issued by a standalone party and exist as a set of contracts with the participants that are relevant to this very contract. So, instead of deploying smart contracts on a global state machine — usually called a blockchain — smart contracts reside with the respective clients.

The project following this approach is called RGB, which stands for Really Good Bitcoin. This name is the result of early attempts to improve Bitcoin’s colored coin implementation when early pioneers experimented with a way of tokenizing assets on the Bitcoin blockchain. Based on the ideas of Peter Todd, an early Bitcoin Core contributor, an Italian Bitcoiner by the name of Giacomo Zucco envisioned RGB as a non-blockchain-based asset system. 

How Does RGB Differ From Other Smart Contract Solutions?

The dominant notion within the blockchain industry currently is that the code as well as the data associated with smart contracts is to be embedded into the underlying blockchain itself. This code must then be executed on-chain, creating a global state machine that is continuously validated by each and every node of the blockchain network.

RGB on the other hand diverges from this blockchain paradigm by having smart contracts as well as their data executed and validated separately from the blockchain. This way, not every node is tasked with the execution and validation of the smart contract but only the entities affected by the contract.

This principle of keeping all data comprising a smart contract with the relevant contract parties i.e., separated from the Bitcoin blockchain or Lightning payment channels, is usually referred to as the principle of client-side validation. Everything that is relevant to the smart contract stays with the respective clients.

In choosing this setup, RGB believes to be functioning closer to the way human interaction based on contracting works in the real world. Imagine you have been given a $10 bill for a service you provided. Upon receiving the note, you, as the client, will perform client-side validation. You check the $10 note and decide for yourself whether you want to accept it. In order to make the right decision — deciding whether the note is fake — you won’t need to refer to a global state that contains all the information about every other $10 note that is out there. Incomplete information suffices to make the right decision. And this is exactly the paradigm shift that RGB is working on bringing to the virtual world. By utilizing cryptography, people should be able to create digital contracts and have them executed the same way they work in the physical realm — meaning that they are enforced locally without having to refer to any global database in the process.

Understand the Future of Everything

Join the Crypto Revolution
Start Your Free Membership Now

100% Free. Yep, You Heard Us

What Are the Benefits of Doing It the RGB Way?

The benefits of this approach are mainly twofold. Firstly, the scalability of smart contracts can be brought to new levels. Secondly, confidentiality can be improved, leading to increased privacy for users of RGB-based protocols.

Because smart contracts reside outside the blockchain, they are potentially infinitely scalable and are not constrained by a blockchain’s limited block space. Congestion, which is currently the default state with Ethereum and leads to higher transaction fees, which again discourage the use of smart contracts, is a non-issue with RGB. Also, with traditional smart contract platforms, smart contracts reside on their public ledger, which makes them visible to everyone. This compromises confidentiality, which is a key feature of real-world contracts. Conversely, RGB-based smart contracts provide absolute confidentiality, if desired. Because these smart contracts are not stored on any public ledger, they don’t have in-built transparency. Similar to real-world contracts that can be presented to the public, making them visible for everyone, the terms of RGB-based smart contracts can also be made transparent by their respective issuer, but are not public by default.

Standardizing the Use of RGB-Based Smart Contracts

Although RGB-based smart contracts are issued and defined on the client-side, there is no randomness to them. Just like Ethereum has so-called ERC standards that define token standards for the issuance of fungible as well as non-fungible tokens, RGB knows what is called a schema. Fungible assets in RGB follow the LNP/BP RGB-20 specification, while non-fungible tokens (NFTs) are defined by the LNP/BP RGB-21 specification.

Above all, a schema is also important because it codifies the smart contract validation rules for the client-side validation and its concrete implementation is always defined by the issuer at the launch of any RGB-based smart contract. As such, a schema is actually the means to guarantee the social consensus on the validation. As a receiver of an asset created by an RGB-based smart contract, you validate any change in the form of state transition to the smart contract against its schema rules. A change is only valid if it has been made according to the schema rules set out at the beginning of the smart contract launch.

How Does RGB Work?

At this point in time, one might ask: How are these RGB-based smart contracts secured? The answer is: Through an underlying blockchain. But instead of embedding any of the smart contract logic into the blockchain, RGB uses the Bitcoin blockchain as a layer of state commitment. Through so-called single-use seals, an RGB-based smart contract’s current state is assigned to Bitcoin transactions. This way, off-chain RGB smart contracts and their assets are linked to transaction outputs (UTXO set), which define their ownership and prevent double-spending.

By leveraging Bitcoin transactions as an ownership-control system for smart contracts, RGB-based smart contracts can exist totally apart from any blockchain but still benefit from Bitcoin’s security. Also, whoever controls and is able to spend the corresponding transaction outputs has the right to change parts of the smart contract state. By being the one that has access to spend a certain Bitcoin output through a transaction, a new state transition changing the smart contract can be initiated. This way, through the rightful owner, smart contracts can evolve in relation to market needs.

What Can Be Done With RGB?

So, can RGB be used already and what exactly can be done with it? While RGB is not in any production-ready state, savvy developers can already play around with it. There are two demos: RGB Beta Demo as well as Bitcoin Pro Demo. Because RGB is an evolving project that is of critical importance to the advancement of Bitcoin, development is taken seriously and no “Hello world product” (also referred to as minimum viable product) should be launched prematurely.

Also, RGB is not a token protocol — meaning there is no RGB token — and won’t therefore be released as one. As a non-blockchain-based asset system though, RGB can be used to create all types of fungible and non-fungible assets. The following can be done using RGB:

  • Fungible assets & securities (options, futures, stablecoins, etc.)
    • Centrally or federation-issued
    • Issued anonymously or publicly
    • With possible secondary issuance, demurrage, inflation, etc.
  • Different forms of bearer rights (voting, etc.)
  • Non-fungible assets (tokenized art, game skins, collectibles)
  • Decentralized digital identity, roaming profiles, and key management
  • Complex rights management, accounting systems, and utility tokens even beyond the financial world: electricity, medical records, etc.
  • Create a DAO with particular voting rights through RGB

Importantly, although RGB-based smart contracts are stored locally and are validated on the client-side only, different RGB-based smart contracts can interact with each other, which allow for functionality like decentralized exchanging of assets over the Lightning Network. This interaction is enabled by different distribution channels that are provided by RGB.

RGB seems very abstract and has chosen a fundamentally different approach to smart contract functionality when compared to the common approach pursued by smart contract blockchains. In theory, RGB’s approach seems like a way to do away with many of the shortcomings native smart contract blockchains face. In practice, this case has yet to be proven.

RELATED CATEGORIES: Crypto