Skip to content

Add LSP opening fee to LspInvoiceResponse#683

Merged
cdecker merged 1 commit intomainfrom
2026w10-lsp-invoice-fees
Mar 11, 2026
Merged

Add LSP opening fee to LspInvoiceResponse#683
cdecker merged 1 commit intomainfrom
2026w10-lsp-invoice-fees

Conversation

@cdecker
Copy link
Collaborator

@cdecker cdecker commented Mar 11, 2026

Summary

  • Add opening_fee_msat field to LspInvoiceResponse protobuf message
  • Compute the fee from the selected LSP's LSPS2 fee parameters: max(min_fee_msat, ceil(amount * proportional / 1_000_000))
  • Report fee as 0 when the node has sufficient incoming capacity (no JIT channel needed)
  • Surface the fee through gl-sdk's ReceiveResponse for UniFFI bindings consumers (Kotlin/Swift/Python)

This allows clients (e.g., Breez SDK) to display the negotiated LSP fees when presenting an invoice to the user.

Test plan

  • test_lsps_plugin_calls updated and passing — verifies opening_fee_msat == 1000 for a 31337 msat invoice with LSPS2 policy min_fee_msat=1000, proportional=1000
  • Verify backward compatibility: old clients ignoring the new field should work fine (proto3 default of 0)

🤖 Generated with Claude Code

Include the LSP's JIT channel opening fee in the lsp_invoice response
so clients can display the negotiated fees when presenting an invoice.

The fee is computed from the selected LSP's LSPS2 fee parameters using
max(min_fee_msat, ceil(amount * proportional / 1_000_000)). When the
node has sufficient incoming capacity and no JIT channel is needed, the
fee is reported as 0.

Also surfaces the fee through gl-sdk's ReceiveResponse for UniFFI
bindings consumers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cdecker cdecker merged commit c89e980 into main Mar 11, 2026
16 checks passed
@cdecker cdecker deleted the 2026w10-lsp-invoice-fees branch March 11, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant