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.


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.
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.

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

Understand the protocol
Dive into the technical specification — client-side validation, single-use seals, schemas, state transitions, and commitment schemes.
From zero to first
RGB transaction.
The fastest path to a working RGB environment using RGB Lib — the recommended SDK for application developers.
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
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
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
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
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 ↗.
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.
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.

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.

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

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.

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

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.
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.
Clone the sandbox repository
git clone https://github.com/RGB-Tools/rgb-sandbox
cd rgb-sandbox
Start the sandbox environment
Docker starts a local Bitcoin regtest node, Electrum server, and all required RGB infrastructure.
docker-compose up -d
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
What to read
next.

Client-side validation
Understand the cryptographic model that makes RGB Protocol on Bitcoin work.

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

Full protocol documentation
Complete technical specification — schemas, state transitions, commitment schemes.

Ecosystem & tools
Wallets, DEXes, and infrastructure projects built on RGB Protocol on Bitcoin.
Questions?
Join the developer community.
Ask questions, share what you’re building, and get support from the RGB community.
