#smart-contracts #bitcoin #lightning #lnp-bp #virtual-machine #rgb #data-encoding

bin+lib rgb-core

RGB Core Library: confidential & scalable smart contracts on Bitcoin & Lightning (consensus layer)

59 releases

0.11.0-beta.5 Mar 19, 2024
0.11.0-beta.4 Dec 30, 2023
0.11.0-beta.2 Nov 19, 2023
0.10.7 Jul 25, 2023
0.4.3 Mar 19, 2021

#1341 in Magic Beans

Download history 162/week @ 2023-12-17 514/week @ 2023-12-24 130/week @ 2023-12-31 85/week @ 2024-01-07 45/week @ 2024-01-14 43/week @ 2024-01-21 22/week @ 2024-01-28 59/week @ 2024-02-04 86/week @ 2024-02-11 156/week @ 2024-02-18 171/week @ 2024-02-25 381/week @ 2024-03-03 172/week @ 2024-03-10 307/week @ 2024-03-17 624/week @ 2024-03-24 450/week @ 2024-03-31

1,595 downloads per month
Used in 27 crates (12 directly)

Apache-2.0

350KB
7K SLoC

RGB Core Library

Build Tests Lints codecov

crates.io Docs unsafe forbidden Apache-2 licensed

RGB is confidential & scalable client-validated smart contracts for Bitcoin & Lightning. To learn more about RGB please check RGB website.

RGB Core library provides consensus-critical and validation code for RGB. It is a standard implementation, jointly with LNP/BP Standards defining RGB consensus and validation rules.

The consensus-critical code library is shared with the following libraries:

  1. Client-side-validation Lib. It is non-bitcoin-specific library, covering concepts related to client-side-validation (commitments, single-use-seals abstracted from bitcoin, consensus-critical data encoding protocols).
  2. BP Core Lib. This is client-side-validation applied to bitcoin protocol with deterministic bitcoin commitments (tapret) and TXO-based single-use-seals.
  3. AluVM virtual machine used by RGB for Turing-complete smart contract functionality.
  4. Strict types, defining memory layout and serialization of structured data types used in RGB smart contracts.

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-2024 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. Upon the release of RGBv1 the protocol will be immutable and this library will accept only bugfixes; i.e. it will be ossified by requiring consensus ACK for the new changes across the large set of maintainers.

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

  • RGB Standard Lib: library providing high-level RGB smart contract API in rust.
  • RGB Wallet: runtime and command-line tool for working with RGB.

Contributing

Currently, library functionality is frozen and as a part of ossification only bugfixes are accepted.

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.

Dependencies

~19MB
~276K SLoC