lightningdevkit / lightning-liquidity

Other
27 stars 17 forks source link

LSPS2: Fee Verification #61

Open johncantrell97 opened 9 months ago

johncantrell97 commented 9 months ago

A wallet user should be verifying that the counterparty_skimmed_fee_msat is the agreed upon amount before claiming a payment from the LSP. This feels like something the library should be able to help them do. Something similar to htlc_intercepted where the end-user can pass the details of a PaymentClaimable event to the library and we respond with whether or not we think they should claim it.

We can't do this today because we don't generate the Invoice (or at a minimum the PaymentHash) that they should use. Maybe a simpler step to take is to use the channel manager and add a PaymentHash / PaymentSecret they should use in the invoice to InvoiceGenerationReady.

Depends on #60