Home /
Build /
Get started
Build /
Developer onboarding

Get started with

RGB Protocol on Bitcoin.

Everything you need to build on RGB Protocol on Bitcoin — from choosing the right library to issuing your first asset on Bitcoin mainnet.

15 min read
Developer guide
v0.11.1 · mainnet
Prerequisites

Basic familiarity with Bitcoin and UTXOs is helpful. RGB Protocol on Bitcoin is implemented primarily in Rust, with higher-level SDKs available for other languages. No prior RGB experience required.

01 /
Choose your path

What will you build on

RGB Protocol on Bitcoin?

Three common starting points for developers on RGB Protocol on Bitcoin. Choose the one that matches your goal.

Build an application

Integrate RGB asset support into a wallet, exchange, or product. Use RGB Lib — the high-level SDK designed for application developers.

Jump to RGB Lib →

Issue an asset

Create a fungible token, stablecoin, NFT, or custom asset on Bitcoin. Choose the right schema and issue via CLI or SDK.

Jump to schemas →

Understand the protocol

Dive into the technical specification — client-side validation, single-use seals, schemas, state transitions, and commitment schemes.

Read the docs ↗

02 /
Set up your environment

From zero to first

RGB transaction.

The fastest path to a working RGB environment using RGB Lib — the recommended SDK for application developers.

01

Install Rust

RGB Protocol on Bitcoin’s core libraries are written in Rust. Install the Rust toolchain via rustup if you haven’t already.

# Install Rust via rustup

curl –proto ‘=https’ –tlsv1.2 -sSf https://sh.rustup.rs | sh

Rust stable 1.70+ required

02

Set up a Bitcoin node connection

RGB requires access to Bitcoin UTXOs — you need a connection to a Bitcoin node (full node or Electrum server). RGB Lib supports both Electrum and Esplora backends.

# Add to your Cargo.toml

[dependencies]

GitHub: RGB-Tools/rgb-lib

03

Set up a Bitcoin node connection

RGB requires access to Bitcoin UTXOs — you need a connection to a Bitcoin node (full node or Electrum server). RGB Lib supports both Electrum and Esplora backends.

// Example: connect via Electrum

let wallet = Wallet::new(WalletData {
  bitcoin_network: BitcoinNetwork::Mainnet,
  database_type: DatabaseType::Sqlite,
  electrum_url: “ssl://electrum.example.com:50002”.to_string(),
  ..Default::default()
})?;

Electrum or Esplora supported

04

Issue your first RGB asset

Use the NIA (Non-Inflatable Asset) schema to issue a simple fungible token. Define ticker, name, precision, and supply — then issue to a Bitcoin UTXO you control.

// Issue a fungible asset using NIA schema

let asset = wallet.issue_asset_nia(
  online.clone(),
  “MYTKN”.to_string(),   // ticker
  “My Token”.to_string(), // name
  2,                    // precision
  vec![1_000_000],      // amounts
)?;

Electrum or Esplora supported

05

Transfer an asset

Generate an invoice from the receiver, then send the asset. The transfer creates an RGB state transition committed to a Bitcoin transaction — all contract data is exchanged off-chain between sender and receiver.

// Receiver generates an invoice

let invoice = wallet.blind_receive(
  Some(asset_id), None, None, vec![], 1
)?;

// Sender transfers the asset

wallet.send(
  online, recipient_map, false, fee_rate, 1
)?;

Off-chain data, on-chain commitment

For the complete RGB Lib API reference and more detailed examples, see the full protocol documentation ↗ and the RGB Lib GitHub repository ↗.

03 /
Supported schemas

Choose the right schema

for your asset.

Schema specifications from official RGB documentation at docs.rgb.info/rgb-contract-implementation/schema/supported-schemas ↗

An RGB Schema is a template that defines the structure of a contract — its state, transitions, and validation rules. As documented in docs.rgb.info, a Schema is “the analog of a class for an OOP language.” Five schemas are officially supported as of v0.11.1.

Fungible · Fixed supply

NIA

Non-Inflatable Asset

Transfer

Fixed-supply fungible token. Defines ticker, name, precision, and total issued supply. Supply cannot be increased after issuance. Use for tokens, stablecoins, or any asset with a hard cap.

Non-fungible · Unique

UDA

Unique Digital Asset

Transfer

Non-fungible asset (NFT). Supports embedded media (up to ~64KiB) and external media attachments via hash digest. Can include a proof of reserves for backed assets.

Fungible · Collectible

CFA

Collectible Fungible Asset

Transfer

Similar to NIA with an additional “Article” string that represents the collectible. For fungible assets that carry a collectible identity alongside their transferable value.

Fungible · Inflatable

IFA

Inflatable Fungible Asset

Transfer

Inflate

Replace

Burn

Fungible asset with secondary issuance rights. Supports inflation up to a defined total supply, burn operations, and replace rights for history validation shortcuts.

Fungible · Permissioned

PFA

Permissioned Fungible Asset

Transfer (signed)

Non-inflatable fungible asset where the issuer must explicitly authorize every transfer via signature. Designed for regulated assets such as company shares with legal transfer constraints.

Custom

Your schema

RGB schemas are composable and extensible. Build custom schemas for identity, DAO governance, proof of publication, or any application that requires programmable state on Bitcoin.

Schema documentation ↗

04 /
Libraries & tools

The RGB Bitcoin Protocol

library stack.

Library map from official RGB documentation at docs.rgb.info/annexes/rgb-library-map ↗

RGB Bitcoin Protocol is organized as a stack of Rust libraries, each addressing a specific layer of the protocol. Start with RGB Lib for application development — it abstracts the layers below.

RGB Lib

Rust · Recommended for apps

High-level library for wallet and application integration. Abstracts all protocol complexity into clean APIs for issuing assets, managing UTXOs, and transferring.

github.com/RGB-Tools/rgb-lib ↗

RGB Lightning Node

Rust · Lightning integration

Run an RGB-enabled Lightning Network node. Manage asset-specific payment channels and route RGB asset payments over Lightning.

github.com/RGB-Tools/rgb-lightning-node ↗

RGB Consensus

Rust · Protocol core

The core RGB protocol implementation — state transitions, schema validation, contract operations. For protocol-level development.

↗https://github.com/rgb-protocol/rgb-consensus↗

RGB Sandbox

Docker · Testing environment

Containerized testing environment for RGB development. Run a local Bitcoin regtest network with RGB fully configured — issue and transfer assets without touching mainnet.

github.com/RGB-Tools/rgb-sandbox ↗

RGB Schemata

Rust · Standard schemas

Official implementations of all supported RGB schemas — NIA, UDA, CFA, IFA, PFA. Reference implementations for asset issuance.

https://github.com/RGB-WG/rgb-schemata

Client-side Validation

Rust · Cryptographic primitives

Low-level implementation of client-side validation and single-use seals. The cryptographic foundation that RGB Bitcoin Protocol is built on.

github.com/LNP-BP/client_side_validation ↗

05 /
Sandbox & testing

Test locally before

going to mainnet.

The RGB Sandbox provides a Docker-based environment with a local Bitcoin regtest network, fully configured for RGB development. Issue and transfer assets without spending real sats.

01

Clone the sandbox repository

git clone https://github.com/RGB-Tools/rgb-sandbox

cd rgb-sandbox

02

Start the sandbox environment

Docker starts a local Bitcoin regtest node, Electrum server, and all required RGB infrastructure.

docker-compose up -d

03

Run the demo scripts

The sandbox includes demo scripts that walk through issuing and transferring assets end-to-end on regtest.

./demo.sh

Full issue → transfer → receive cycle

06 /
Go deeper

What to read

next.

Client-side validation

Understand the cryptographic model that makes RGB Protocol on Bitcoin work.

Client Side Validation ↗

RGB & Lightning Network

Build Lightning-native asset channels on RGB Protocol on Bitcoin.

RGB Lightning Network ↗

Full protocol documentation

Complete technical specification — schemas, state transitions, commitment schemes.

docs.rgb.info ↗

Ecosystem & tools

Wallets, DEXes, and infrastructure projects built on RGB Protocol on Bitcoin.

Ecosystem & Tools ↗

Questions?

Join the developer community.

Ask questions, share what you’re building, and get support from the RGB community.