Skip to content
/ bp-core Public

BP Core Lib: consensus data structures and client-side-validation library for bitcoin protocol

License

Notifications You must be signed in to change notification settings

BP-WG/bp-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LNP/BP Core Library

TravisCI codecov

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.

Library functionality

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.

Project structure

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:

Install

Get the dependencies

On Debian, run

sudo apt-get install cargo

On Mac OS, run

brew cargo

Clone and compile library

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.

Use library in other projects

Include this line into your Cargo.toml file:

lnpbp = { git = "https://github.com/lnp-bp/rust-lnpbp.git", branch = "master" }

Use command-line tool for LNP/BP:

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

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.

About

BP Core Lib: consensus data structures and client-side-validation library for bitcoin protocol

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  
  •  

Packages

No packages published