rust-lightning/lightning-liquidity
Elias Rohrer f19016f900
Drop (currently) unused BP dev-dependency from lightning-liquidity
.. we planned to use the BP for some more advanced integration tests, but we
haven't actually implemented them as of now. Here we drop the
unnecessary dev-dependency for now.
2025-01-28 16:45:09 +01:00
..
src liquidity: Allow setting process_events callback in c_bindings 2025-01-15 09:58:43 +01:00
tests Add lightning-liquidity crate to the workspace 2024-12-11 17:01:03 +01:00
Cargo.toml Drop (currently) unused BP dev-dependency from lightning-liquidity 2025-01-28 16:45:09 +01:00
README.md Add notes to docs/README to indicate beta status of service-side 2024-12-19 17:12:09 +01:00

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

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

Currently the following specifications are supported:

  • LSPS0 defines the transport protocol with the LSP over which the other protocols communicate.
  • 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.
  • 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.