Skip to content

Add LSPS5 webhook notification support - #993

Open
Camillarhi wants to merge 1 commit into
lightningdevkit:mainfrom
Camillarhi:lsps5
Open

Add LSPS5 webhook notification support#993
Camillarhi wants to merge 1 commit into
lightningdevkit:mainfrom
Camillarhi:lsps5

Conversation

@Camillarhi

@Camillarhi Camillarhi commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Integrates LSPS5 (bLIP-0055) from lightning-liquidity, enabling webhook-based push notifications so clients can be alerted to events while their app is offline. Built on the refactored multi-LSP liquidity module (src/liquidity/{client,service}).

  • set_webhook - register/update a webhook.
  • list_webhooks - query registered webhooks.
  • remove_webhook - remove a registration.

When node_id is None, set_webhook and remove_webhook fan out to every LSPS5-capable LSP, so a webhook can be configured once across all configured LSPs.

Lets a node act as an LSPS5 server:

  • Delivers outgoing webhook notifications over HTTP in response to LSPS5ServiceEvent::SendWebhookNotification.
  • Auto-triggers an onion_message_incoming notification when an intercepted onion message targets a client that is currently offline (wired from LdkEvent::OnionMessageIntercepted, gated on peer connectivity via the peer manager).

Reopening after an accidental force-push pushed the branch to main's tip and auto-closed #729.

Fixes: #1017

@ldk-reviews-bot

ldk-reviews-bot commented Jul 17, 2026

Copy link
Copy Markdown

🎉 This PR is now ready for review!
Please choose at least one reviewer by assigning them on the right bar.
If no reviewers are assigned within 10 minutes, I'll automatically assign one.
Once the first reviewer has submitted a review, a second will be assigned if required.

@ldk-reviews-bot
ldk-reviews-bot requested a review from tnull July 17, 2026 11:59
@Camillarhi
Camillarhi marked this pull request as draft July 17, 2026 12:06
@Camillarhi
Camillarhi force-pushed the lsps5 branch 7 times, most recently from 1d750fb to 9d4f022 Compare August 20, 2026 00:24
@Camillarhi
Camillarhi marked this pull request as ready for review August 24, 2026 14:06
@Camillarhi
Camillarhi force-pushed the lsps5 branch 4 times, most recently from 5412755 to 2601d0f Compare August 25, 2026 14:30
Implement the bLIP-55 / LSPS5 webhook registration protocol on top of the
multi-LSP liquidity module (src/liquidity/{client,service}).

Client side, exposed via Node::liquidity().lsps5():
- set_webhook / list_webhooks / remove_webhook to manage webhook
  registrations with a given LSP. Each takes the LSP's node ID explicitly:
  bLIP-55 has the notification service verify the x-lsps5-signature header
  against the signing LSP's node ID, so a registration is meaningful only
  for one LSP at a time.

Service side, enabled by passing an LSPS5ServiceConfig to
Builder::enable_liquidity_provider():
- Deliver outgoing webhook notifications over HTTPS in response to
  LSPS5ServiceEvent::SendWebhookNotification.
- Send lsps5.payment_incoming when an inbound HTLC forward to a client
  fails because the client is offline (wired from LdkEvent::
  HTLCHandlingFailed with LocalHTLCFailureReason::PeerOffline).
- Send lsps5.onion_message_incoming when an intercepted onion message
  targets a client that is currently offline.
- Send lsps5.expiry_soon from a periodic task that scans channels for outbound
  HTLCs approaching their cltv_expiry, so a client that went offline holding an
  HTLC has a chance to come online and settle before it expires.

Adds integration tests covering webhook registration and the
payment_incoming trigger, and wires the feature through the UniFFI
bindings.
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.

LSPS5 webhook notification support

2 participants