rust-lightning/lightning-liquidity/README.md
Elias Rohrer dfc71390b8
Introduce bLIP numbers in lightning-liquidity documentation
Recently, LSPS0, 1, and 2 were upstreamed as bLIP-50, 51, and 52,
respectively. Here, we

1. start linking to the bLIPs instead of the LSP spec repository, which
   is likely going to be deprecated.
2. start consistently citing the specs as `bLIP-5X / LSPSX` to avoid any
   confusions and to potentially initiate a process in which the LSP
   specs will be referred to by their bLIP number rather than their LSPS
   number (especially given that any upcoming specs by the LSP
   spec group will directly be drafted as bLIPs going forward).
2025-02-03 09:15:55 +01:00

1.8 KiB

lightning-liquidity

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 LSPS specifications.

Note: Service-side support is currently considered "beta", i.e., not fully ready for production use.

Currently the following specifications are supported:

  • bLIP-50 / LSPS0 defines the transport protocol with the LSP over which the other protocols communicate.
  • bLIP-51 / LSPS1 allows to order Lightning channels from an LSP. This is useful when the client needs inbound Lightning liquidity for which they are willing and able to pay in bitcoin.
  • bLIP-52 / LSPS2 allows to generate a special invoice for which, when paid, an LSP will open a "just-in-time" channel. This is useful for the initial on-boarding of clients as the channel opening fees are deducted from the incoming payment, i.e., no funds are required client-side to initiate this flow.

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.

LiquidityManager uses an eventing 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::next_event.