Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/liquidity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,18 @@ pub struct LSPS2ServiceConfig {
pub min_payment_size_msat: u64,
/// The maximum payment size that we will accept when opening a channel.
pub max_payment_size_msat: u64,
/// Use the client trusts lsp model
/// Use the 'client-trusts-LSP' trust model.
///
/// When set, the service will delay *broadcasting* the JIT channel's funding transaction until
/// the client claimed sufficient HTLC parts to pay for the channel open.
///
/// Note this will render the flow incompatible with clients utilizing the 'LSP-trust-client'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps make it more clear that this bool switches between the two models, and that it should be false for LSP-trust-client. Maybe an enum would have been better here?

Copy link
Collaborator Author

@tnull tnull Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the thing is that if we set this to false the client can do whatever (wait or immediately claim). While technically there are two modes, no client that I'm aware of will actually run LSP-trusts-client model. I even attempted to get it removed from the spec, but there are .. reasons .. why we can't at this point. Really, any client should just claim the HTLCs ASAP. So this flag is really only concerning the LSP, allowing to determine how strict/safe it wants to be.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why offer the boolean then if there is no demand yet and you think it shouldn't even be in the spec?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the LSP might opt to be less strict. Some require to support 'LSP-trusts-client' from their (legal) side, but none actually expects the client to be strict and implement mempool-checking-before-claiming.

/// trust model, i.e., in turn delay *claiming* any HTLCs until they see the funding
/// transaction in the mempool.
///
/// Please refer to [`bLIP-52`] for more information.
///
/// [`bLIP-52`]: https://github.com/lightning/blips/blob/master/blip-0052.md#trust-models
pub client_trusts_lsp: bool,
}

Expand Down