Contract Implementation in RGB

We have finally arrived at describing how an RGB contract is actually defined and implemented. In addition to Genesis, which we have discussed earlier, the definition of a contract in RGB ecosystem is realized by 2 + 1 independent and complementary components:

  • Schema which represent the data file containing the fundamental contract declarations, possible states and operations constituting its business logic.

  • Interface which contains the instruction to parse the contract and shows state data to users and wallet interface.

  • Interface Implementation is a third complementary component which is responsible to bridge the latter two together.

At this regard, it is important to point out that each one of this component can be freely and independently developed by different persons, provided that they respect the RGB consensus regarding the validation of client-side data and strict types formats. This represent a notable feature of RGB ecosystem which allows an even higher degree of competition among different components of the contract itself.

In the picture below a general scheme of all the components together with a summary explanation is reported. In addition to this, the creation of a compiled Genesis with suitable procedures derived from the 3 components just described complete the issuance phase of a contract, which become then fully operational to users.

It's worth pointing out that, in order to work with an RGB contract a wallet need to import all the 4 compiled components (Schema, Interface and Interface Implementation and Genesis) through a contract consignment.

In order to give a better general view, the following table summarizes the main characteristics of each one and the equivalent terminology adopted both in Object Oriented Programming (OOP) languages and in Ethereum contract system.

Contract componentMeaningOOP termsEthereum terms


Initial Contract State

Class constructor

Contract constructor


Contract business logic




Contract semantics

Interface (Java),

trait (Rust), protocol (Swift)

ERC* Standard

Interface Implementation

Mapping semantics to business logic

Impl (Rust), Implements (Java)

Application Binary Interface (ABI)

In the next sections we shall explore in more depth the role and the technicalities of each one of these constructs.

Last updated