This is Rust library implementing LNP/BP specifications https://github.com/LNP-BP/LNPBPs. It can be used to simplify development of layer 2 & 3 solutions on top of Lightning Network and Bitcoin blockchain.
The current list of such projects include:
- RGB: Confidential smart contracts for Bitcoin & Lightning
- LNP node: Experimental rust-based modular Lightning network node
- BP node: Indexing service for bitcoin blockchain; more efficient & universal Electrum server replacement
The planned projects:
- Spectrum: Decentralized exchange for Lightning Network
- Storm: Incentivised trustless storage and messaging
- Prometheus: Decentralized trustless computing
Potentially, with LNP/BP Core library you can simplify the development of
- Discreet log contracts
- Implement experimental lightning features
- Do complex multi-threaded or elastic/dockerized client-service microservice architectures
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.
The library provides the code for:
- Improvements & utilities for Bitcoin protocol
- Deterministic commitments that can be embedded into for Bitcoin transactions and public keys
- Single-use seals
- Client-side validation
- Lightning networking protocol (LNP)
- Generalized lightning network
This code supports both Bitcoin blockchain and Lightning network.
The library is built as a single Rust crate with the following top-level mods:
- common: traits, structures, functions and generics which are used by all parts of the project
- paradigms: generic paradigms (API best practices) which are not bitcoin-specific
- bp: Bitcoin protocol extensions external to Bitcoin Core functionality and existing BIPs. These may also cover those of LNPBP standards which are not specific for other layers.
- lnp: Lightning Network protocol extensions: networking, generalized lightning channels and better layerization of BOLT specifications
- rgb: smart contracts for Bitcoin and Lightning network based client-side validation, deterministic bitcoin commitments and single-use seals.
- lnpbps: other LNPBPs standard implementation which does not fit into any of the categories above
The library is based on other projects:
- rust-bitcoin and it's dependencies
- bitcoin_hashes
- rust-secp256k1
- rust-secp256k1-zkp for Pedersen commitments and Bulletproofs used in confidential state inside RGB protocols
- rust-lightning
On Debian, run
sudo apt-get install cargo
On Mac OS, run
brew cargo
git clone https://github.com/lnp-bp/rust-lnpbp
cd rust-lnpbp
cargo build --release
The library can be found in target/release
directory.
You can run tests with:
cargo test
Please refer to the cargo
documentation
for more detailed instructions.
Include this line into your Cargo.toml
file:
lnpbp = { git = "https://github.com/lnp-bp/rust-lnpbp.git", branch = "master" }
We have developed a command-line tool lbx
which implements most of this library functionality, so it can be accessed and
played with. Download it and build according to the instructions in
https://github.com/lnp-bp/lbx
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.