RGB FAQ
  • Welcome to RGB!
  • πŸ’‘What is RGB?
  • πŸ“šRGB Resources
  • βš™οΈRGB design principles
  • πŸŽ“RGB paradigms
    • Single-use seals
    • Cryptographic commitments
    • Client-side validation
    • Strict encoding
  • πŸ”–RGB Smart contracts
    • What is a smart contract?
    • What is contract schema?
    • How does one program RGB smart contracts?
    • Do you define the validity of a state transition with Schema?
  • ☣️RGB & β‚Ώitcoin
    • Will RGB require a fork of Bitcoin or Lightning?
    • RGB testnet & mainnet
    • Taproot, Schnorr signatures and RGB
    • Does anything need to happen in Lightning or Bitcoin to enable Lightning on RGB?
    • Is there a plan to work on channel factories?
  • 🎨RGB NFT
    • RGB NFT vs other NFT
    • What's the difference between RGB design of NFTs and common NFT approach?
  • ❓FAQ
    • What is RGB?
    • What does 'RGB' stand for?
    • Is RGB a new blockchain?
    • What can I do with RGB?
    • Is it possible to create a DAO with RGB?
    • RGB vs alternatives
    • Is RGB Turing-complete?
    • Does RGB require Taproot?
    • What RGB is compatible with?
    • Will Simplicity be used in RGB?
    • Why there is no RGB MVP with updates rolling out after?
    • How is confidentiality reached in RGB?
    • How is safety reached in RGB?
    • What is client-side validation?
    • How scalable is RGB?
    • Is there an RGB "Hello World" guide?
  • πŸ“–Glossary
    • Contracts
      • ContractId
      • NodeId
      • Node
      • State
      • State assignment
      • State transition
      • Assignment
      • Assignment variant
      • State data
      • State type
      • Metadata fields
      • Metadata
      • Data type
      • Genesis
    • AluVM
    • Bifrost
    • Client-side validation
    • Contractum
    • Deterministic Bitcoin commitments
      • Container construction/deconstruction
      • Container
      • Commitment
      • Commitment embedding
      • LockScript
      • Proof
      • Protocol-specific entropy
      • Supplement
    • Right
    • Schema & Scripts
      • Schema
      • Field type
      • Assignment type
      • Bit dimensions
      • ABI
      • Script library
      • Occurence boundaries
      • Script extensibility
      • Transition type
    • Single-use seals
      • Witness
      • Seal definition
      • Seal blinding
      • Multimessage commitments
      • Seal closing over message
    • Stash
      • Stash
      • Consignment
      • Disclosure
      • Anchor
      • Forget procedure
      • Merge procedure
      • Validate procedure
      • Conceal procedure
      • Consign procedure
    • Encodings
      • Merklization commitment encoding
      • Storage encoding
      • Strict encoding
      • Pedersen commitments
      • Blinding factors
      • Buletproofs
      • Conceal
      • Commitment encoding
  • πŸ™‹Community
    • Developer calls
    • Presentation slides
    • YouTube
    • Getting familiar with RGB
    • Articles & interviews on RGB
Powered by GitBook
On this page

Was this helpful?

  1. RGB Smart contracts

What is a smart contract?

Simple explanation what a smart contract is as a concept, even with no relation to RGB.

In order to understand the concept of a smart contract one has to make a shift in their mindset - from thinking about Computer Science, blockchain, transactions to remembering how physical world works, about people interacting and proving something to each other. Imagine that there are no computers, they don't exist. After you design the interaction between humans and the way they can prove something in trustless or anonymous environments, the matter of digitalizing it by designing protocols that can fit it into computer and internet world becomes simply a question of application. You have to do first things first, meaning to design the game theory between humans and only then put time into contemplating computer science possibilities to make it work in digital form. This is also the best approach while trying to understand RGB.

So, what is a smart contract in this perspective? Smart contract is the way to enforce the fulfillment of a certain agreement between humans without an external centralized agency (military, government, court etc). Say, you don't have a physical contract and the parties of the agreement are anonymous, meaning you can't use physical force to make them follow the agreement. If in these conditions there are economical incentives to make the fulfillment of the agreement happen without applying any physical enforcement - this is what a smart contract is. As you can see, it has nothing to do with Computer Science per se. Computer Science can help to solve cryptographic part of the situation, can make it more efficient working over Internet and not requiring physical presence, but it can't solve the game theory problems. For that you need to use economics first. And if you analyse the smart contracts from that perspective, you will understand that you have to distinguish many things, for example ownership rights (ownership of different assets defined under that conctract) from the contract states (under which conditions the contract exists currently, as each contract between humans defines certain, let's call them, state machines). Thus we can say that the contract defines an event-consequence algorithm 'if this happens then that happens'. And of course, each of these algorithms also needs to follow certain verification rules. If you think about client-side validation in this regard, it is easy to create parallels and understand that in the described scenario you need to run client-side validation with single-use seals (without any blockchain). Let's imagine someone gave you $10 for you doing something or paid you for coffee. When you got this bank note of $10, you perform a client-side validation: you look at the bank note, you touch it with your hands, you check the watermarks, and you either accept it or you don't. That's the client side validation happening without any computer being involved. Also, in this situation you don't need to have all the information about every single other note that ever existed (no need to store the global state). And the only thing RGB adds in this regard is it simply puts this paradigm of client-side validation into a digital world, utilizing cryptography such that you could do the same, but in anonymous way. This and similar use cases can be seen in many other situations beyond finance. And that's why we say that RGB covers smart contracts use cases and different enforcement rules under them, while still having the game theory designed outside of its scope.

PreviousRGB Smart contractsNextWhat is contract schema?

Last updated 3 years ago

Was this helpful?

πŸ”–