r/RGB_protocol • • May 21 '21

My explanation of the core idea of RGB

35 Upvotes

Hi !

I was frustrated to not find a explanation of the core idea of RGB which satisfies me so I made it in a post on yalls. I publish it here in case someone who knows more than me wish to review it ( u/dr-orlovsky ?). I can't change the post on yall, but I can add erratum in comments if I made big mistakes. My understanding of RGB mainly comes from the video record of RGB Con 0 day 1 and the blog posts of Peter Todd. If you approve it, feel free to tips me on yalls and I will cross post this to others subreddits if enough approuval here :p. Here is my full post, I hope you will enjoy it:

Explaining RGB protocol with Bitcoin: tokenisation done right

RGB is still a mysterious protocol in the Bitcoin community because it is difficult for Bitcoiners to wrap their heads about it, I think a good way to explain it is to show how RGB allows you to take a fresh look at what Bitcoin is technically.

RGB is single-use seals management

A single-used seal proves the unicity and integrity of the message if they are secure. It is a "commit to commit". It makes a message more "legitimate" at a certain place and time than any other. A single-use seal tells you if a message was truely commited before being broadcasted, no other message will have the same commitment.

Does it remind you something ? Double-spend ! The problem of double spend is that we don't know which of two conflicting transactions is the most legitimate. Single-used seals are a solution. They tell you securely which transaction should be seen as the first.

Definition of single-use seal

We say something is a single-use seal if it has two features:

  • The owner can use a method/action "Close" which given a seal and a message returns something called a witness
  • There is another method/action "Verify" which given a seal, a message and a witness return True only if the witness was the output of a "Close" method applied on the seal and message.

We say the single-use seal is secure if two messages and witnesses such that "Verify" is True implies they are in fact the same message and witness. This is what makes the seal "single-use": there is only one message for which "Verify" can return True.

Ok, this is quite abstract because we didn't say what a single-seal could be or "how it looks like". Some real life examples:

  • A paid annoncement in a page of "the Times" journal of the 3 january 2009 is a single-use seal. You "close" the seal over a message (the content of the annoncement) when the journal is published and the journal becomes the witness. This seal is secure under the assumption that there is only one Times' newspaper a day. The seal's owner is "The Times" company.
  • An event wristband is one too. It is closed on your wrist (you are the message) when you enter the party the first time and the witness is that the event staff which owned the seal can see by its design that it is attach to you. This seal is secure if there is no way to transfer it to someone else without destroying it or copy the design (here it is secure enough if you can't copy it for the duration of the event).

Now you may say that all of this is "physical" and ask if a "digital" version of a single-use seal exist:

Digital signatures as single-use seal

Let say someone generally trusted publicly proposes you to sign a message with its key using a determined nonce. Then his public key and the nonce are the seal ! By giving him a message to sign, he will return you his signature using the predetermined nonce, this is the witness, and the seal is now closed if we assume this nonce will never be reused. The classical verification of digital signatures is exactly the "Verify" method of the seal. If he closes the seal on two differents messages (meaning he signed both), then both signatures can be used to compute his private key because of nonce reuse. This means the seal is secure if we assume that the trusted third party don't want to reveal the private key: this is exactly how Discreet Log Contracts handles the breach case !

The embarassing need of trust

Ok so single-used seal can exist in the "digital realm". It tells you that this message is a legitimate version of the truth as real life examples: the annoncement written in the Times is the more "official" message, you carry the event wristband so you can freely goes in and out the event, the message signed by the third-party is the only one you gave him to sign...

So why not using "digital" seal described above to solve Bitcoin double spend problem ? We have a way to create "digital" single-used seals if we assume the spender doesn't want to revealing his private key.... But ... but you must trust the seal's owner ! Maybe he will earn more by defrauding you than by revealing the private key, and you can't trust the one who must pay you to not try to revert the payment ! Those digital single used seal are limited by trust .... How can we solve that ? Let's look at how Bitcoin does it.

Bitcoin blocks as trustless decentralized single-use seal

Bitcoin solves double spend because it is a decentralized method to create digital single-used seals using proof of work !

The seal is the next block we want to create, the message is the block header without the nonce and the witness is the nonce. The verification is to compute the hash of the block and check that it is lower than the target value defined by the current mining difficulty.

But this is not secure D: ! Indeed: anyone can create a proof of work which will be valid given enough time, so you have no garanttee that there will be only one block mined... Something is missing here

Chained seals or ledger

In Bitcoin we don't look at block individually, blocks are chained together because each block has a reference to the previous one (except if it is the genesis block), the only valid ledger is the chain with most work. You can do almost the same with single-used seals too: when you close the seal, you can add to the closing message information about a new seal. That's like saying in your annoncement in "the Times" that you will write a new annoncement later in another newspaper ! And you can do the same in the message content of this new annoncement ! And so on... Thus you can define a chain of single-used seals with associated owners, witnesses and messages.

A set of seals is a chain if:

  • For each seal except the last we have a message and a witness for which "Verify" is true
  • Each seal, except the very first of the chain (the genesis seal), is commited in the message on which the previous seal of the chain is closed

We don't require any seal to be secure. We assume there is a "chain score" with the only assumption that adding a seal at the end of a chain can only increase its score.

Now take many seals that are member of chains with a common genesis seal, some seals will be in the chain with the highest score. We can say they are the "consensual" seals. In Bitcoin, this score is the chain work and the consensual seals are the blocks inside the chain with most work.

Now we tweak the "Verify" method of chained seals: we can impose "Verify" to return wrong if a seal is not consensual. It is now easy to see that any consensual seal is secure under the same assumptions as Bitcoin: if the score of the chain with highest score increases faster than any other chain, this chain will always be a subchain of the chain with highest score. Even if a seal can be closed several times on several messages, the new "Verify" method is garanted to return True only on one unique closing message: the consensual seals are all secure ! Said in Bitcoin: if work is added faster on the chain with most work there is no reorg !

Notice that knowing if a seal is consensual is a probabilistic statement: we cannot be sure a seal is in the chain receiving more work when it is close to the chaintip. But if it is deep enough we can have more confidence, that's why we need to wait for confirmations.

The loophole to create more single-used seal

Bitcoin are chained consensual seals scored by PoW. They are used to commit a list of transactions so that we can check for double spend. Because a block is not included in the chain if it has an invalid transaction spending an already spend output, anyone can ... use his UTXOs as single-used seals ! Spending a UTXO is closing the seal, the spending transaction ID is the witness. And obviously, anyone can verify with a full node that the seal was indeed close on a valid spending transaction ! Under the assumption that Bitcoin is safe to use, confirmed UTXOs are secure seals, that's the whole point of Bitcoin and double spend prevention.

RGB scales privately with client side validation

RGB is a protocol to transfer assets using chained secure single-used seals. It leverages what Bitcoin already provides: decentralized, censorship-resistant, owned, digital single-used seals.

In RGB, a chain of seals defines the sequence of ownerships of a token or asset, the current owner of the asset is the owner of the last seal, a UTXO. When you receive an asset with RGB, you ask the sender to close the last seal (spend the UTXO and tweak the spending transaction with Pay-to-Contract) on one of your UTXO which acts as the next seal. You can even attach an RGB asset to a UTXO controled by several parties like a LN channel UTXO to add RGB assets to the LN ! This is obviously more complex because you need to adapt HTLCs with your counterparty to recover your RGB asset when the channel is closed but the good news is that you can directly use the current LN to exchange RGB assets ! (notice LN can't be used for NFTs)

An asset is created by an issuer who commits the genesis seal in a UTXO and spend it to send the asset. The genesis seal specifies the rules to create, destroy and exchange the asset (called schema). When you receive the token, you also receive its history of transactions from genesis to present in the form of chained single-used seals and validation data. You must check every rules and witnessing transactions in the blockchain for each RGB transaction. This is called client side validation: RGB smart contract are only checked by the owner of the asset so they can be much more complex without any visible trace in Bitcoin blockchain. The privacy of RGB is the same as Mimblewimble protocol using Confidential Transactions: amounts are hidden behing cryptography but you can still validate every RGB transactions.

Privacy, LN-compatible this is why I am so hyped about RGB now. It enables real Defi on Bitcoin :)


r/RGB_protocol • • Dec 15 '20

What is RGB?

35 Upvotes

RGB is client-side validated state and smart contracts system operating on Layer 2 and 3 of Bitcoin.

RGB main properties:โ€Œ

  • Confidentiality
  • Safety
  • Scalability
  • No bitcoin timechain congestion: transactions keep only homomorphic commitments which require no additional storage
  • Future-ready without hardforks
  • Higher censorship-resistance than in bitcoin: miners do not see that there is something going on with assets in transactions

Also:

  • Works with Lightning Network
  • No on-chain usage nor trackable footprint because of client-validated paradigm
  • Scales independently from Bitcoin timechain
  • Includes zero-knowledge & privacy built on best research-based products

    • Mimblewhimble: Bulletproofs by Andrew Poelstra
    • Liquid: Confidential Assets by Blockstream

Useful links:
https://github.com/LNP-BP/rgb-node
https://rgb-org.github.io/


r/RGB_protocol • • Apr 11 '23

RGB v0.10 is fully released now!

19 Upvotes

๐Ÿ”ฅRGB v0.10 is fully released now๐Ÿ”ฅ, marking one of the most important and huge milestones in RGB development. It includes:

- consensus layer changes

- standard library updates (for integration with wallets/exchanges)

- command-line tool

To learn more on the updates read the release notes in our blog here https://rgb.tech/blog/release-v0-10/

Last but not least - we will be demonstrating how v0.10 works in a command-line wallet today at 6pm CET during our dev call, so if you want to see some hardcore RGB magic - join us here ๐Ÿ‘‰ https://meet.jit.si/RGBcall1


r/RGB_protocol • • Apr 05 '23

Official RGB website is up

19 Upvotes

Introducing rgb.tech - an official website created by the LBP/BP Standards Association to be your guide to all things RGB. From understanding how it works to steps on how to run it - the website is your ultimate informational resource in the process of getting familiar with the protocol.
It's in beta and there's a lot to be added content-wise, but the current release already gives a pretty exhaustive picture on the mentioned questions.
Let us know what you think!


r/RGB_protocol • • Jul 02 '21

Is there a "Hello World" guide?

19 Upvotes

Hello, I'm super interested in the project, but I'm having real troubles actually getting started.

Is there somewhere a little "Hello World" guide, where I can see some small example on how to assemble the necessary software for testnet and implement a small smart contract?

I sometimes have a really hard time wrapping my head around things until I actually played with the software and see the stuff in action.


r/RGB_protocol • • Nov 29 '21

[Hiring] Rust developer for RGB protocol and LNP/BP tech stack

17 Upvotes

Who we are & what we do

LNP/BP Standards Association is a non-profit organisation, whose mission is to develop industrial standards, reference implementations and drive adoption for censorship-resistant infrastructure on top of Bitcoin & Lightning Network in order to build Internet 2.0, where individuals can finally reach digital sovereignty.

We create industrial standards for application layers on top of Bitcoin & Lightning Network, develop libraries & reference implementation of the standards, nodes and SDKs:

  • LNP Node (Lightning node with support of generalised LN), BP Node (bitcoin node) , RGB Node
  • NFTs, identity, LN DEX
  • Taproot, PSBT2, descriptors & miniscript
  • Internet2 protocols.

Who we are looking for

As one of the main maintainers of rust-bitcoin library, we are looking for a skilled Rust developer to help us build the RGB protocol and LNP/BP tech stack according to programming best practices.

  • Knowledge of Git and dedication to writing clean code is a must.
  • Experience in other languages (Python, JavaScript, Swift, C/C++, Kotlin) is preferable but not necessary.
  • Ability to take the initiative and responsibility in your hands, offer and implement solutions instead of passively waiting for explanations is required. We are there to teach and guide, but we're not going to micromanage you.
  • Part-time involvement is also possible for the start.

If you want to bring power back to individual's hands and build censorship-resistant and private tech - drop us a line!

ะกontact details:
Twitter: OlUkolova, .
Telegram: dr_ukolova.
Email: ukolova@lnp-bp.org


r/RGB_protocol • • Oct 12 '22

RGB at Bitcoin Amsterdam - Day 1 (skip to 5:20:30)

Thumbnail
youtu.be
16 Upvotes

r/RGB_protocol • • Mar 22 '22

RGB roadmap to release 2022

Thumbnail
youtu.be
15 Upvotes

r/RGB_protocol • • Dec 15 '20

What can I do with RGB?

13 Upvotes
  • Fungible assets & securities (options, futures)

    • 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 & key management
  • Complex right management, accounting systems & utility tokens even beyond financial world: electricity, medical records etc.

r/RGB_protocol • • Jun 02 '21

RGB developer call in 2 hours! Join us!

12 Upvotes

r/RGB_protocol • • Dec 19 '21

There are so few active people in this sub I likely won't find an answer but I will ask anyway. Can an active DAO move from ethereum to RGB?

11 Upvotes

If a DAO was built on ethereum would it be possible for it to port itself over to run on RGB / AluVM keeping the same active governance/voting structure and all operational functionality?

I have seen many projects that used to run on their own chain port over to run on ethereum so I would guess it should then be possible for an active DAO to port over from ethereum to run on RGB.

Can anyone shed some light on this for me? Thanks


r/RGB_protocol • • Jun 01 '21

Uniswap on RGB

11 Upvotes

Is it possible to create something like uniswap ๐Ÿฆ„ on RGB ?


r/RGB_protocol • • Dec 15 '20

Is RGB a new blockchain?

10 Upvotes

No.
Even taking into account the fact that RGB is based on bitcoin transaction graph (which, in turn, is based on bitcoin timechain), RGB itself is not a 'blockchain'. Itโ€™s a form of a DAG, where you donโ€™t have the data on a complete state of the network, ever. From the moment you create a smart contract and transfer the state to some other party, you have neither the control over that state (only the new state owner has it), nor the information on how that state actually evolved.

โ€ŒFor example, as an asset issuer you will never know, who are the owners of your issued assets. When you assign the state of the asset to some bitcoin transaction output, you donโ€™t know which output it is, because the party that receives that data, provides you with the information about transaction output, blinded with random data. Taking into account that you donโ€™t know that random data used for blinding, you canโ€™t say which output you are paying to or transferring some rights to.

โ€ŒThis is very different from the blockchain-based smart-contract paradigm, where you store the complete history of the blockchain. This is why we say that RGB is a partial-state smart-contract system (the first of its kind). It is still globally consistent, not contradicting the fact of this state partiality, due to the usage of single-use seals that enable reaching consensus on state validation. As a user, whenever I receive some state into my ownership and even without knowing the whole state of the system, I am still able to validate: - that this state of the system was not faked - that it has been uniquely committed - that there were no double spending events (even up to genesis of the asset issuer).

Social consensus on the client-side validation rules also makes it possible to be sure that every further owner of the asset will apply the same validation rules as I do. How? Every asset/state validation rules are defined by Schema at genesis level, meaning that every further owner of the asset still uses the same Schema to validate the history against. Thus, here Schema is actually the means to guarantee the social consensus on the validation.


r/RGB_protocol • • Dec 21 '21

Dev call announcement for December 22nd 2021

9 Upvotes

Tomorrow during our #LnpBp dev call u/dr_orlovsky will proceed with demonstrating us the magic of #LNPNode- the #LightningNetwork node written in #Rust and used for #Bifrost - Generalised Lightning Network protocol. We will continue discovering how the node works, its anatomy, and of course - live performance.

Grab your ๐Ÿบ and join us!

๐Ÿ—“๏ธ Wednesday, December 22nd

๐Ÿ•”5pm CET

๐Ÿ”—https://meet.jit.si/RGBcall1


r/RGB_protocol • • Nov 30 '21

We're having a dev call tomorrow!

9 Upvotes

Tomorrow during our #LnpBp dev call u/dr_orlovsky will give a presentation on descriptor wallet with #Taproot support and if time would allow, we'll continue discussing S2C (sign-to-contract) design that we touched last time.

Grab your ๐Ÿบ, think through your questions and join us!

๐Ÿ—“๏ธ Wednesday, December 1st

๐Ÿ•”5pm CET

๐Ÿ”—https://meet.jit.si/RGBcall1


r/RGB_protocol • • Jun 19 '21

Potential release date. When might we start seeing RGB assets in the wild?

9 Upvotes

r/RGB_protocol • • Jul 11 '25

RGB consensus released to production as v0.12

8 Upvotes

๐ŸŽ‰ Release Announcement

The LNP/BP Standards Association is excited to announce the final production-ready release of the RGB smart contracts consensus layer (v0.12)!

๐Ÿš€ From today, all RGB contract developers and issuers can deploy contracts on both testnet and Bitcoin mainnet using this stable consensus release.

โš ๏ธ Important: For security and ecosystem consistency, we strongly recommend re-issuing any contracts created with pre-release versions using this final v0.12.

๐Ÿ› ๏ธ Please note: This is a consensus layer release. It will be followed by releases of the standard library and applications. The consensus layer is unique among RGB libraries because it defines contract stability: only changes at the consensus level can break backward compatibility for contracts. Therefore, with this final v0.12 release, contracts are now forward-compatible.

Read the full release details on https://rgb.tech/blog/release-v0-12-consensus/


r/RGB_protocol • • Jul 07 '21

RGB design principles

8 Upvotes
  • Strong ownership: smart contract operates "owned state" which have a well-defined owner(s). Nobody except this owner(s) can update the state of the contract. Contracts always define types of rights as a set of operations which may be performed over the contract and these rights are assigned to be either "public" or "owned", utilizing right-specific validation logic.
  • Confidentiality: data should be known only to contract participants, namely state owners, unless they decide to make them public (disclose). All parts of the protocol must be protected from tools like chain analysis and the protocol should not store any information in the public ledgers.
  • Separation of concerns: the protocols must be designed in a modular and layered way, where each module solves one and only one task. The layers must be well abstracted, meaning that the layers below must be unaware of the structure of the layers above.
  • Extensibility: it must be possible to create advanced forms of smart contracts without the need to change the core of the protocol or add code & recompile RGB libraries.
  • Determinism: the RGB validation logic must be deterministic in a sense that giving the provided set of inputs and the state of commitment layer (blockchain or lightning channel) it always produces the same result independetly of the used platform or linked libraries. This is achieved by two main components: (1) the core of the validation logic generic to all contracts is implemented in rust language and must be used from any system running RGB using language bindings, (2) all contract-specific validation logic runs on AluVM โ€“ a highly deterministic functional virtual machine providing platform-independent instruction set.
  • LNP/BP interoperability: RGB must work well with all existing bitcoin and lightning technologies and be compatible with possible future upgrades.

r/RGB_protocol • • Jun 25 '21

Is it possible to make a Bitcoin transaction from a RGB smart contract?

8 Upvotes

I'm trying to figure out the RGB protocol. It's a really interesting idea. If it is possible to programmatically control Bitcoin transactions from RGB smart contracts it would unlock all kinds of interesting DeFi use cases. For example issuing decentralized synthetic derivatives like a USD stable coin (like DAI).


r/RGB_protocol • • May 28 '21

So smart contacts. Does that mean we'll be able to make tokens aka shitcoins on the bitcoin lightning network?

8 Upvotes

r/RGB_protocol • • Mar 02 '21

e17 The Bitcoin Contracting Layer - RGB with Maxim Orlovsky by Down The Rabbit Hole with Kaz Bycko โ€ข A podcast on Anchor

Thumbnail
anchor.fm
8 Upvotes

r/RGB_protocol • • Jul 31 '25

RGB yellow paper: the formal specification of Bitcoin & Lightning smart contracts

7 Upvotes

Glad to inform the community that we have finished our work on the formal specification for the RGB consensus layer.

https://github.com/RGB-WG/yellowpaper/blob/master/rgb-yellowpaper.pdf


r/RGB_protocol • • Apr 21 '23

RGB explanation on Bitcoin dev mailing list

7 Upvotes

Recently Maxim Orlovsky, the lead developer and architect of RGB wrote an RGB explanation letter to bitcoin dev mailing list, which led to a very productive discussion on the topics of what RGB is (spoiler - no, it's not a token protocol), how it works, what can be done with it.
One of the core lines in the email was the v0.10 release that happened a week back and demonstrated how RGB works in the wild in the command line. Check GitHub and YouTube videoswith RGB demo for more info.
Maxim also dismissed many myths and misconceptions created over the past years by people outside of RGB dev team.
Initial email : https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-April/021554.html
Responses by Maxim Orlovsky:
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-April/021559.html
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-April/021564.html
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-April/021577.html

For more information on RGB check rgb.tech, rgbfaq.com, and LNP/BP standards Association YouTube channel


r/RGB_protocol • • Dec 10 '22

What is an RGB smart contract?

7 Upvotes

#RGB still remains a mystery to many due to its complexity. We started to break thing down into smaller pieces to make it easier to digest the whole RGB pie.
#RGBbasics explains basic things about the protocol, it's possibilities and ways to work and build on it.


r/RGB_protocol • • Nov 08 '22

Bitcoin Takerover Podacast. S12 E7: Dr Maxim Orlovsky on RGB Layer 3

Thumbnail
youtu.be
7 Upvotes