8 releases

new 0.1.9 May 30, 2023
0.1.8 Apr 27, 2023
0.1.7 Feb 8, 2023
0.1.6 Dec 29, 2022
0.1.0-alpha.1 Aug 30, 2022
Download history 30/week @ 2023-02-11 58/week @ 2023-02-18 49/week @ 2023-02-25 3/week @ 2023-03-04 36/week @ 2023-03-11 9/week @ 2023-03-18 26/week @ 2023-03-25 33/week @ 2023-04-01 7/week @ 2023-04-08 16/week @ 2023-04-15 31/week @ 2023-04-22 4/week @ 2023-04-29 18/week @ 2023-05-06 2/week @ 2023-05-13 1/week @ 2023-05-20 39/week @ 2023-05-27

60 downloads per month

MIT license

14K SLoC


rgb-lib is a Rust library which provides tools to build cross-platform RGB compatible wallets in a simple fashion, without having to worry about Bitcoin and RGB internals.

It primarily uses bdk to provide Bitcoin walleting functionalities, and several RGB libraries such as rgb-node to provide RGB specific functionalities.

The library has been designed to offer an offline usage (some APIs do not require using Internet) and also a watch-only usage (the library can work without private keys, sign operations will need to be performed with another tool).

N.B.: this library is still a work in progress and in its testing phase. Also, as long as the version is 0.*, API breaking changes should be expected.

Important remark

⚠️ Warning: never use the same wallet on more than one device!

Using the same wallet (mnemonic phrase) on multiple devices can lead to RGB asset loss due to improper UTXO management.

This library is intended to exclusively handle all UTXOs for the wallet. Using the same mnemonic phrase on any other device, including with this same library, can lead to serious issues and ultimately to RGB asset loss.

Each time the wallet is brought online, a consistency check is carried out to make sure the UTXO set has not changed since the last synchronization and an error is returned in case discrepancies are detected.

Native language bindings

Native language bindings for this library are also available via the rgb-lib-ffi project.


In order to run the available tests, execute:

cargo test

This command will run a bitcoind node and an electrs node in order to perform integration tests in a regtest environment.

Services will not be stopped automatically after the test run. To stop them and remove all containers, from the project root execute:

docker compose -f tests/docker-compose.yml down

Known issues

  • running all tests in parallel opens a lot of file descriptors and may hit the default limit (e.g. 1024); should that happen, the limit needs to be increased (e.g. ulimit -n 3072); running tests in smaller batches (e.g. cargo test send is also possible)


  • add an API to extend BlindData expiration
  • add a backup/restore system
  • add support for more databases
  • improve UTXO management
  • improve RGB services handling
  • improve the library's performance


~1.5M SLoC