5 releases

0.5.1 Dec 15, 2021
0.5.0 Nov 27, 2021
0.5.0-beta.3 Aug 27, 2021
0.5.0-beta.1 Aug 25, 2021

#3 in #lightning-network

Download history 178/week @ 2021-10-04 63/week @ 2021-10-11 102/week @ 2021-10-18 142/week @ 2021-10-25 298/week @ 2021-11-01 271/week @ 2021-11-08 574/week @ 2021-11-15 683/week @ 2021-11-22 1211/week @ 2021-11-29 1683/week @ 2021-12-06 2302/week @ 2021-12-13 570/week @ 2021-12-20 665/week @ 2021-12-27 131/week @ 2022-01-03 48/week @ 2022-01-10 70/week @ 2022-01-17

961 downloads per month
Used in 11 crates (via lnpbp)

MIT license

1.5K SLoC

LNP/BP Library

Build Tests Lints codecov

crates.io Docs unsafe forbidden MIT licensed

The repository represents a set of libraries implementing LNP/BP specifications https://github.com/LNP-BP/LNPBPs not fitting into a scope of other existing LNP/BP core libraries (client-side-validation, BP, LNP, RGB, invoicing). It can be used to simplify development of layer 2 & 3 solutions on top of Lightning Network and Bitcoin blockchain.

Currently, the repository contains the following crates:

  • lnpbp_bech32: library implementing LNPBP-14 standard of Bech32 encoding for client-side-validated data.
  • lnpbp_chain: library providing chain parameters for bitcoin-related blockchains;
  • lnpbp_elgamal: library implementing LNPBP-31 standard for ElGamal encryption using Secp256k1 curve;
  • LNPBP umbrella crate containing all aforementioned libraries.

Other libraries, implementing LNP/BP specifications, not included in this crate:

The current list of the projects based on these libraries include:

  • RGB Node
  • LNP Node enabling:
    • RGB extensions
    • DLC extensions
    • Lightspeed payments
    • Multi-peer channels
    • Faster lightning experiments (quicker adoption of eltoo, Taproot etc)
  • BP Node: Indexing service for bitcoin blockchain; more efficient & universal Electrum server replacement. In perspective - validating Bitcoin network node (using libbitcoinconsus)

Potentially, with LNP/BP libraries you can simplify the development of

  • Discreet log contracts
  • Implement experimental lightning features
  • Do complex multi-threaded or elastic/dockerized client-service microservice architectures

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


Clone and compile library

Minimum supported rust compiler version (MSRV): 1.47.0 (if command-line tool is not used) and 1.54.0 (otherwise).

git clone https://github.com/lnp-bp/rust-lnpbp
cd rust-lnpbp
cargo build --release --all-features

The library can be found in target/release directory.

You can run full test suite with:

cargo test --workspace --all-features

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:

lnpbp = "~0.5.0"
lnpbp_bech32 = "~0.5.0"
lnpbp_chain = "~0.5.0"
lnpbp_elgamal = "~0.5.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.


~37K SLoC