Skip to main content

Installation

Applies to both RGB lines

Each line has its own CLI, crates and data directory, so the tabs below are separate. See Two RGB lines for which one to use.

Both lines install a binary called rgb, and the two binaries are incompatible. Install only one per PATH, or use cargo install --root <dir> to keep them apart.

Rust toolchain​

Both CLIs are built from source with Cargo. Both declare rust-version = "1.85.0" (Cargo.toml of RGB-WG/rgb at v0.12.0-rc.3 and of rgb-protocol/rgb-api at 0.11.1). rgb-lib needs Rust 1.88.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup update stable

Command-line tool​

rgb-cmd 0.11.1 was published on 2026-09-16 from rgb-protocol/rgb-api.

cargo install --locked rgb-cmd --version 0.11.1
rgb --version

rgb --version prints rgb-cmd 0.11.1.

rgb-cmd does RGB work only. To sign transactions you need a Bitcoin wallet that holds the keys. The official sandbox uses bp-wallet for this, installing its bp and bp-hot tools:

cargo install --locked bp-wallet --version 0.11.1-alpha.2 --root ./bp-wallet --features=cli,hot

Defaults: the data directory is ~/.lnp-bp (env LNPBP_DATA_DIR) and the network is testnet3 (env LNPBP_NETWORK). Data goes in a per-network subdirectory, such as ~/.lnp-bp/regtest. There is no init step: the directory is created on first use.

Blockchain access​

Neither CLI talks to Bitcoin Core RPC. Both read the chain through an indexer that you choose per command: --electrum=<URL> or --esplora=<URL>, and on Line B also --mempool=<URL>. The = is required. Give a full URL with the network already in it.

  • Line A: a bare --electrum uses mycitadel.io:50001, and a bare --esplora uses https://mempool.space/{network}/api, with {network} replaced by the network name (cli/src/args.rs, resolver).
  • Line B: a bare --electrum uses the placeholder example.com:50001, so always give a URL. A bare --esplora uses https://blockstream.info/{network}/api. In 0.11.1, {network} is replaced only when the wallet syncs (bp-wallet 0.11.1-alpha.2 src/cli/args.rs, indexer). The RGB resolver used by validate, accept and contract import gets the URL unchanged (rgb-cmd src/args.rs, resolver), so a URL that still contains {network} breaks those commands. The Electrum environment variable in bp-wallet 0.11.1-alpha.2 has the same typo, ELECRTUM_SERVER. Reported upstream: rgb-api#14.

For local testing, run regtest with an Electrum server. rgb-sandbox (below) packages bitcoind and electrs with Docker Compose.

Line B: regtest sandbox​

rgb-protocol/rgb-sandbox is the official regtest demo. It needs git, cargo, Docker with Compose, and the SQLite development headers (libsqlite3-dev).

git clone https://github.com/rgb-protocol/rgb-sandbox --recurse-submodules --shallow-submodules
cd rgb-sandbox
bash demo.sh

demo.sh installs bp-wallet and rgb-cmd into the project directory, starts the services, issues an asset, runs transfers and cleans up. As of its last commit (2026-09-22) the sandbox isn't on 0.11.1 final: demo.sh installs rgb-cmd 0.11.1-rc.7 (RGB_CMD_VER), and the README says it is "based on RGB version 0.11.1 RC 6" and installs rc.6 in its manual steps. The quick start walks through the manual version.

Libraries​

Wallets and apps: use rgb-lib (RGB-Tools). It handles Bitcoin walleting (through BDK) and RGB together, and has official bindings for Kotlin, Swift, Python, Node.js and C/C++ (bindings list). Version 0.3.0-beta.7 (2026-07-17) is built on rgb-ops 0.11.1-rc.11 and needs Rust 1.88.

[dependencies]
rgb-lib = "=0.3.0-beta.7"
A new project doesn't resolve without rgb-lib's lock file

As of 2026-10-21, a fresh cargo build stops with failed to select a version for the requirement `secp256k1 = "^0.32.0-beta.2"` : rgb-consensus 0.11.1-rc.11, which rgb-lib pins, needs that version, and it has been yanked from crates.io. Cargo still uses a yanked version that is already in Cargo.lock, so start from rgb-lib's lock file. In your project directory, run curl -LO https://raw.githubusercontent.com/RGB-Tools/rgb-lib/0.3.0-beta.7/Cargo.lock before the first build.

Use each wallet on one device only

The rgb-lib README warns that using the same mnemonic on more than one device "can lead to RGB asset loss due to improper UTXO management".

Lower-level crates, the ones rgb-cmd is built from:

[dependencies]
rgb-api = "=0.11.1"
rgb-ops = "=0.11.1"
rgb-consensus = "=0.11.1"
rgb-schemas = "=0.11.1"

Pin these exactly. 0.11.2 (release candidate since 2026-10-09) changes the consignment format.

rgb-lib 0.3.0-beta.7 still depends on rgb-ops 0.11.1-rc.11 and the strict libraries 1.0.2 (rgb-lib Cargo.toml), while rgb-cmd 0.11.1 uses 1.0.4 and 0.11.2-rc.1 uses 1.0.5 (release notes). rgb-lib's next branch moves to 0.11.2-rc.1, unreleased as of 2026-10-21.

API docs: docs.rs/rgb-lib builds. As of 2026-10-21, docs.rs failed to build rgb-api and rgb-ops 0.11.1, so run cargo doc --open in your project or read the source on GitHub. rgb-consensus and rgb-invoicing 0.11.1 do build.

Next steps​