MCPcopy Index your code
hub / github.com/LNP-BP/rust-lnpbp

github.com/LNP-BP/rust-lnpbp @v0.9.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.0 ↗ · + Follow
148 symbols 242 edges 6 files 36 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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: - Client-side-validation foundation libraries (client_side_validation) - Bitcoin protocol core library (bp-core) - Lightning network protocol core library (lnp-core) - RGB core library implementing confidential & scalable smart contracts for Bitcoin & Lightning (rgb-core) - Universal invoicing library

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.

Install

Clone and compile library

Minimum supported rust compiler version (MSRV): 1.59.0.

```shell script 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:

```shell
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"

Contributing

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.

Licensing

See LICENCE file.

Extension points exported contracts — how you extend this code

ToBech32String (Interface)
Creates Bech32 string with appropriate type data representation. Depending on the specific type, this may be `id`-string [4 …
bech32/src/lib.rs
NativeAsset (Interface)
(no doc) [2 implementers]
chain/src/lib.rs
FromBech32Str (Interface)
Constructs type from the provided Bech32 string, or fails with [`enum@Error`] [4 implementers]
bech32/src/lib.rs
AsBech32Payload (Interface)
Extracts data representation from a given type which will be part of Bech32 payload [1 implementers]
bech32/src/lib.rs
FromBech32Payload (Interface)
Convertor which constructs a given type from Bech32 payload data [1 implementers]
bech32/src/lib.rs
Strategy (Interface)
Helper trait for implementing specific strategy for Bech32 construction [1 implementers]
bech32/src/lib.rs

Core symbols most depended-on inside this repo

chain_params
called by 17
chain/src/lib.rs
len
called by 7
identity/src/lib.rs
as_magic
called by 6
chain/src/lib.rs
as_ref
called by 5
bech32/src/lib.rs
verify
called by 4
identity/src/lib.rs
run_test_bin
called by 4
elgamal/src/lib.rs
sign
called by 3
identity/src/lib.rs
nym
called by 3
identity/src/lib.rs

Shape

Method 59
Function 41
Interface 19
Enum 16
Class 13

Languages

Rust100%

Modules by API surface

bech32/src/lib.rs46 symbols
chain/src/lib.rs41 symbols
identity/src/lib.rs36 symbols
elgamal/src/lib.rs13 symbols
src/bin/lnpbp.rs12 symbols

For agents

$ claude mcp add rust-lnpbp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact