#bitcoin #lightning #rgb #smart-contracts #lnp-bp

bin+lib rgb-core

RGB Core Library: private & scalable client-validated smart contracts for Bitcoin & Lightning

18 releases

new 0.7.0-alpha.1 May 26, 2022
0.5.1 Dec 10, 2021
0.5.0 Nov 28, 2021
0.4.4 May 14, 2021
0.4.3 Mar 19, 2021

#1866 in Magic Beans

Download history 11/week @ 2022-02-02 18/week @ 2022-02-09 27/week @ 2022-02-16 37/week @ 2022-02-23 22/week @ 2022-03-02 18/week @ 2022-03-09 268/week @ 2022-03-16 41/week @ 2022-03-23 40/week @ 2022-03-30 26/week @ 2022-04-06 25/week @ 2022-04-13 28/week @ 2022-04-20 152/week @ 2022-04-27 117/week @ 2022-05-04 256/week @ 2022-05-11 75/week @ 2022-05-18

600 downloads per month
Used in less than 9 crates

MIT license

13K SLoC

RGB Core Library

Build Tests Lints codecov

crates.io Docs unsafe forbidden MIT licensed

Rust library implementing confidential & scalable client-validated smart contracts for Bitcoin & Lightning.

The current list of the projects based on the library include:

  • RGB Node: standalone & embeddable node for running RGB
  • RGB SDK: SDK for developing mobile, web, desktop & server-side wallets and doing other forms of software integration with RGB Node

To learn more about the technologies enabled by the library please check:

The development of the library projects is supported by LNP/BP Standards Association.

Previously the code of the library was part of LNP/BP Core Library but later was extracted into a separate library in this repository via fork. The reasons for that were the facts that LNP/BP Core Lib has a lot of usage outside RGB project scope, and the overall dependencies & feature management complexity, compile times etc grow significantly. Another reason is the need for different review policies & security requirements (LNP/BP Core Lib may be more experimental than RGB).

The library is based on other projects:


Get the dependencies

On Debian, run

sudo apt-get install cargo libssl-dev libzmq3-dev pkg-config g++ cmake

On Mac OS, run

brew install rust pkg-config zmq

Clone and compile library

Minimum supported rust compiler version (MSRV): 1.41.1 (if used without tokio)

git clone https://github.com/rgb-org/rgb-core
cd rgb-core
cargo build --release --all-features

The library can be found in target/release directory.

You can run full test suite with:


Please refer to the cargo documentation for more detailed instructions.

Use library in other projects

Add these lines to your Cargo.toml file at the very end of the [dependecies] section:

rgb-core = "~0.3.0"


Contribution guidelines can be found in a separate CONTRIBUTING file

More information

Policy on Altcoins/Altchains

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.


See LICENCE file.


~289K SLoC