MCPcopy Index your code
hub / github.com/RGB-WG/rgb

github.com/RGB-WG/rgb @v0.10.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.1 ↗ · + Follow
49 symbols 70 edges 10 files 3 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

RGB smart contracts

Build Tests Lints codecov

crates.io Docs unsafe forbidden Apache-2 licensed

RGB is confidential & scalable client-validated smart contracts for Bitcoin & Lightning. It embraces the concepts of private & mutual ownership, abstraction and separation of concerns and represents "post-blockchain", Turing-complete form of trustless distributed computing which does not require introduction of "tokens". To learn more about RGB please check RGB black paper and RGB Tech websites.

This repository provides client-facing library which can be used by desktop apps and mobile wallets for integrating RGB support. It also provides binary rgb which runs in the command-line and exposes all RGB functionality locally, requiring only Electrum server.

The development of the project is supported and managed by LNP/BP Standards Association. The design of RGB smart contract system and implementation of this and underlying consensus libraries was done in 2019-2023 by Dr Maxim Orlovsky basing or earlier ideas of client-side-validation and RGB as "assets for bitcoin and LN" by Peter Todd and Giacomo Zucco.

Installing

First, you need to install cargo. Minimum supported rust compiler version (MSRV): 1.66, rust 2021 edition.

Next, you need to install developer components, which are OS-specific:

  • Linux sudo apt update sudo apt install -y build-essential cmake pkg-config

  • MacOS brew install cmake pkg-config

  • Windows: download and install the latest Build Tools for Visual Studio, including the 'Desktop development with C++' workflow and recommended optional features

Finally, install RGB command-line utility shipped with this repo by running

cargo install rgb-contracts --all-features

To use the library from other rust code add dependency to the Cargo.toml file:

[dependencies]
rgb-contracts = "0.10"

Then all RGB library main components can be imported with use rgb::prelude::*.

Using command-line

Contributing

Altcoins and "blockchains" other than Bitcoin blockchain/Bitcoin protocols are not supported and not planned to be supported; pull requests targeting them will be declined.

License

See LICENCE file.

Extension points exported contracts — how you extend this code

SpkDescriptor (Interface)
(no doc) [2 implementers]
src/descriptor.rs
Resolver (Interface)
(no doc) [1 implementers]
src/wallet.rs
StockFs (Interface)
(no doc) [1 implementers]
fs/src/stock.rs
DefaultResolver (Interface)
(no doc) [1 implementers]
src/wallet.rs

Core symbols most depended-on inside this repo

wallet
called by 2
src/runtime.rs
import_contract
called by 2
src/runtime.rs
store
called by 2
fs/src/stock.rs
update
called by 1
src/wallet.rs
utxo
called by 1
src/wallet.rs
default_resolver
called by 1
src/wallet.rs
resolve_utxo
called by 1
src/wallet.rs
create_wallet
called by 1
src/runtime.rs

Shape

Method 30
Class 8
Enum 5
Interface 4
Function 2

Languages

Rust100%

Modules by API surface

src/wallet.rs14 symbols
src/runtime.rs13 symbols
src/descriptor.rs8 symbols
src/bin/rgb/loglevel.rs5 symbols
fs/src/stock.rs3 symbols
src/bin/rgb/opts.rs2 symbols
src/bin/rgb/main.rs2 symbols
src/bin/rgb/command.rs2 symbols

For agents

$ claude mcp add rgb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact