Skip to content

Commit 6d50a8a

Browse files
committed
f Update README and crate-level docs
1 parent b099cb2 commit 6d50a8a

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

lightning-liquidity/README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1-
# `lightning-liquidity`
1+
# lightning-liquidity
22

3-
Types and primitives to integrate a [spec-compliant](https://github.com/BitcoinAndLightningLayerSpecs/lsp) LSP with an LDK-based node.
3+
The goal of this crate is to provide types and primitives to integrate a spec-compliant LSP with an LDK-based node. To this end, this crate provides client-side as well as service-side logic to implement the [LSP specifications].
4+
5+
Currently the following specifications are supported:
6+
- [LSPS0] defines the transport protocol with the LSP over which the other protocols communicate.
7+
- [LSPS1] allows to order Lightning channels from an LSP. This is useful when the client needs
8+
inbound Lightning liquidity for which they are willing and able to pay in bitcoin.
9+
- [LSPS2] allows to generate a special invoice for which, when paid, an LSP will open a "just-in-time".
10+
This is useful for the initial on-boarding of clients as the channel opening fees are deducted
11+
from the incoming payment, i.e., no funds are required client-side to initiate this flow.
12+
13+
To get started, you'll want to setup a `LiquidityManager` and configure it to be the `CustomMessageHandler` of your LDK node. You can then call `LiquidityManager::lsps1_client_handler` / `LiquidityManager::lsps2_client_handler`, or `LiquidityManager::lsps2_service_handler`, to access the respective client-side or service-side handlers.
14+
15+
`LiquidityManager` uses an evening system to notify the user about important updates to the protocol flow. To this end, you will need to handle events emitted via one of the event handling methods provided by `LiquidityManager`, e.g., `LiquidityManager::wait_next_event`.
16+
17+
[LSP specifications]: https://github.com/BitcoinAndLightningLayerSpecs/lsp
18+
[LSPS0]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS0
19+
[LSPS1]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS1
20+
[LSPS2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2

lightning-liquidity/src/lib.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,31 @@
88
// licenses.
99
#![crate_name = "lightning_liquidity"]
1010

11-
//! # `lightning-liquidity`
12-
//! Types and primitives to integrate a spec-compliant LSP with an LDK-based node.
11+
//! The goal of this crate is to provide types and primitives to integrate a spec-compliant LSP with an LDK-based node. To this end, this crate provides client-side as well as service-side logic to implement the [LSP specifications].
12+
//!
13+
//! Currently the following specifications are supported:
14+
//! - [LSPS0] defines the transport protocol with the LSP over which the other protocols communicate.
15+
//! - [LSPS1] allows to order Lightning channels from an LSP. This is useful when the client needs
16+
//! inbound Lightning liquidity for which they are willing and able to pay in bitcoin.
17+
//! - [LSPS2] allows to generate a special invoice for which, when paid, an LSP will open a "just-in-time".
18+
//! This is useful for the initial on-boarding of clients as the channel opening fees are deducted
19+
//! from the incoming payment, i.e., no funds are required client-side to initiate this flow.
20+
//!
21+
//! To get started, you'll want to setup a [`LiquidityManager`] and configure it to be the
22+
//! [`CustomMessageHandler`] of your LDK node. You can then for example call
23+
//! [`LiquidityManager::lsps1_client_handler`] / [`LiquidityManager::lsps2_client_handler`], or
24+
//! [`LiquidityManager::lsps2_service_handler`], to access the respective client-side or
25+
//! service-side handlers.
26+
//!
27+
//! [`LiquidityManager`] uses an evening system to notify the user about important updates to the
28+
//! protocol flow. To this end, you will need to handle events emitted via one of the event
29+
//! handling methods provided by [`LiquidityManager`], e.g., [`LiquidityManager::wait_next_event`].
30+
//!
31+
//! [LSP specifications]: https://github.com/BitcoinAndLightningLayerSpecs/lsp
32+
//! [LSPS0]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS0
33+
//! [LSPS1]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS1
34+
//! [LSPS2]: https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2
35+
//! [`CustomMessageHandler`]: lightning::ln::peer_handler::CustomMessageHandler
1336
#![deny(missing_docs)]
1437
#![deny(rustdoc::broken_intra_doc_links)]
1538
#![deny(rustdoc::private_intra_doc_links)]

0 commit comments

Comments
 (0)