Skip to content

Commit

Permalink
Release 0.1.0-alpha.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Jun 5, 2020
1 parent e5ed738 commit c533b68
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ addons:
matrix:
include:
- rust: nightly
env: DO_COV=true AS_DEPENDENCY=true
env: DO_COV=true AS_DEPENDENCY=true DO_LINT=true

script:
- ./contrib/test.sh
Expand Down
111 changes: 64 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,81 @@
# LNP/BP standard library
# LNP/BP Core Library

[![TravisCI](https://api.travis-ci.com/LNP-BP/rust-lnpbp.svg?branch=master)](https://api.travis-ci.com/LNP-BP/rust-lnpbp)

This is Rust library implementing LNP/BP specifications <https://github.com/lnp-bp/lnpbps>. It can be used for building
layer 3 solutions on top of Lightning Network and Bitcoin blockchain. The list of such projects include:
* [RGB](https://github.com/rgb-org): Different forms of assets and asset-managing smart contracts
* [Spectrum](https://github.com/rgb-org): Decentralized exchange for Lightning Network
* [Storm](https://github.com/storm-org): Incentivised trustless storage and messaging
* [Prometheus](https://github.com/pandoracore/prometheus-spec): Decentralized trustless computing

The development of these projects is supported by LNP/BP Standard Association.
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](https://github.com/LNP-BP/rgb-node): Confidential smart contracts for
Bitcoin & Lightning
* [LNP node](https://github.com/LNP-BP/lnp-node): Experimental rust-based
modular Lightning network node
* [BP node](https://github.com/LNP-BP/bp-node): Indexing service for bitcoin
blockchain; more efficient & universal Electrum server replacement

The planned projects:
* Spectrum: Decentralized exchange for Lightning Network
* [Storm](https://github.com/storm-org): Incentivised trustless storage and
messaging
* [Prometheus](https://github.com/pandoracore/prometheus-spec): 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:
* [RGB Technology Guide](https://github.com/LNP-BP/FAQ/blob/master/RGB%20Technology%20Guide%2C%20part%20I.pdf)
* [Networking with LNP](https://github.com/LNP-BP/FAQ/blob/master/LNP%20Networking%20%26%20RGB%20Integration.pdf)
* [LNP/BP Nodes Initiative](https://github.com/LNP-BP/devcalls/blob/master/LNP-BP%20Nodes%20Initiative.pdf)

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

## Library functionality

The library provides the code for:

* Deterministic commitments that can be embedded into for Bitcoin transactions and public keys

* Improvements & utilities for Bitcoin protocol
* Deterministic commitments that can be embedded into for Bitcoin transactions
and public keys
* Single-use seals
* Client-side validated data, including serialization, verification etc
* Client-validated state management
* 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
* seals: Single-use seals in generic form, which is not specific to Bitcoin blockchain and may be applied to any layer
* bp: Bitcoin protocol extensions external to [Bitcoin Core](https://github.com/bitcoin/bitcoin) functionality and
existing [BIPs](http://github.com/bitcoin/bips). These may also cover those of
[LNPBP standards](https://github.com/lnp-bp/lnpbps) which are not specific for other layers.
* lnp: Lightning Network protocol extensions external to
* 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](https://github.com/bitcoin/bitcoin)
functionality and existing [BIPs](http://github.com/bitcoin/bips). These may
also cover those of [LNPBP standards](https://github.com/lnp-bp/lnpbps) which
are not specific for other layers.
* lnp: Lightning Network protocol extensions: networking, generalized lightning
channels and better layerization of
[BOLT specifications](https://github.com/lightningnetwork/lightning-rfc)
* csv: Client-side validation generics for managing all possible off-chain data in standard way.
* cmt: Commitments layer for provable commitments in bitcoin transactions and public keys.
Can be used both jointly with single-use seal system or independently from it.
* rgb: More complex client-validated state management based on client-side validation, provable commitments and
single-use seals, applicable for both Bitcoin blockchain and Lightning Network.
* 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](https://github.com/rust-bitcoin/rust-bitcoin) and it's dependencies
* [bitcoin_hashes](https://github.com/rust-bitcoin/bitcoin_hashes)
* [rust-secp256k1](https://github.com/rust-bitcoin/rust-secp256k1)
* [rust-secp256k1-zkp](https://github.com/ElementsProject/rust-secp256k1-zkp) for Pedersen commitments and
Bulletproofs used in confidential state inside RGB protocols
* [rust-secp256k1-zkp](https://github.com/ElementsProject/rust-secp256k1-zkp)
for Pedersen commitments and Bulletproofs used in confidential state inside
RGB protocols
* [rust-lightning](https://github.com/rust-bitcoin/rust-lightning)

```text
+---------------------------------------------------------------------------------------+
| rgb - client-validated state system |
+-------------------------------------+-------------------+-----------------------------+
| csv - client-side validation | cmt - commitments | lnp - LN addons |
+-------------------------------------+-------------------+--------++==================++
| seals - single-use seals | bp - bitcoin addons || crate: lightning ||
+----------------------+--------++=================================++==================++
| common || crate: bitcoin ||
+--------++===============++==================++================++
|| crate: hashes || crate: secp256k1 || crate: bitcoinconsensus ||
++===============++==================++=========================++
|| C: libsecp256k1 || C: libbitcoinconsensus ||
++==================++=========================++
```

## Install

### Get the dependencies
Expand Down Expand Up @@ -92,7 +106,8 @@ You can run tests with:
cargo test
```

Please refer to the [`cargo` documentation](https://doc.rust-lang.org/stable/cargo/) for more detailed instructions.
Please refer to the [`cargo` documentation](https://doc.rust-lang.org/stable/cargo/)
for more detailed instructions.

### Use library in other projects

Expand All @@ -104,16 +119,18 @@ 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`](https://github.com/lnp-bp/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
We have developed a command-line tool [`lbx`](https://github.com/lnp-bp/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.
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

Expand Down
10 changes: 8 additions & 2 deletions contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,11 @@ then
rm -rf dep_test
fi

# Check formatting
cargo fmt --all -- --check
# Lint if told to
if [ "$DO_LINT" = true ]
then
(
rustup component add rustfmt
cargo fmt --all -- --check
)
fi

0 comments on commit c533b68

Please sign in to comment.