Giter Site home page Giter Site logo

lightning_encoding's Introduction

LNP/BP Core Library

Build Tests Lints codecov

crates.io Docs unsafe forbidden MIT licensed

This is LNP/BP Core Library: a 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 the projects based on the library include:

  • RGB: Confidential & scalable smart contracts for Bitcoin & Lightning
  • Generalized Lightning Network and it's reference implementation named LNP node enabling:
    • RGB extensions
    • DLC extensions
    • Lightspeed payments
    • Multi-peer channels
    • Faster lightning experiments (quicker adoption of eltoo, Taproot etc)
  • LNP: Networking protocol for privacy-keeping and censorship-resistant applications, operating in both P2P and RPC modes (currently used as a part of Lightning network, but our effort is to make it more generic and usable even outside of LN). All services, developed by LNP/BP Standards Association (see points below) are made with LNP.
  • BP node: Indexing service for bitcoin blockchain; more efficient & universal Electrum server replacement. In perspective - validating Bitcoin network node (using libbitcoinconsus)

The planned projects:

  • Decentralized exchange for Lightning Network
  • Bifrost Node: P2P LNP/BP network infrastructural node running
    • Decentralized exchange information workflows
    • Watchtowers (RGB-enabled)
    • DLC oracle provider
    • Anonymous intermediate storage for client-validated data (like RGB consignments)
    • Storm storage providers (see below)
  • Storm: Incentivised trustless storage and messaging protocol
  • 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:

  • RGB: confidential smart contracts with client-side validation, with Lightning network support
  • Improvements & utilities for Bitcoin protocol
  • Deterministic commitments that can be embedded into for Bitcoin transactions and public keys (DBC)
  • 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:

  • 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.
  • standards: 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 libssl-dev libzmq3-dev pkg-config g++ cmake

On Mac OS, run

brew cargo pkg-config zmq

Clone and compile library

Minimum supported rust compiler version (MSRV): 1.56.1, due to edition 2021 requirements

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:

./contrib/test.sh

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.2.0"
lnpbp_derive = "~0.2.0"
lnpbp_services = "~0.2.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.

lightning_encoding's People

Contributors

dr-orlovsky avatar rajarshimaitra avatar nicbus avatar afilini avatar kixunil avatar ukolovaolga avatar fedsten avatar grunch avatar crisdut avatar zoedberg avatar inaltoasinistra avatar btcparadigm avatar yancyribbens avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.