Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webook for receiving payments #63

Closed
roeierez opened this issue Feb 13, 2023 · 4 comments
Closed

Webook for receiving payments #63

roeierez opened this issue Feb 13, 2023 · 4 comments
Assignees
Labels

Comments

@roeierez
Copy link
Member

This feature set the basis of the ability to receive funds when the user node is offline.
Event though lots of the end users nodes are operated from mobile, we can't use mobile notifications directly as there are multiple apps involved and the LSP doesn't have the certificates

An optional flow when there are already channels:

  1. LSP receive htlc to forward.
  2. LSP detects the channel to forward is not active.
  3. LSP notifies the webhooks associated with this channel.
  4. LSP waits a certain time for the channel to be active, then forward the htlcs.

An optional flow when there is no channel:

  1. LSP receive htlc to forward.
  2. LSP needs to open a channel but the peer is offline.
  3. LSP fetch the webhook associated with the registered invoice and notifies it.
  4. LSP waits a certain time for the channel to be active, then forward the htlcs.
@JssDWt
Copy link
Collaborator

JssDWt commented Mar 6, 2023

Some thoughts of things to build:

  • endpoint for registering webhook subscriptions
  • table to store the relation node id/webhook
  • maintain a log of published notifications (for diagnostics/support)
  • mechanism to remove webhook subscriptions by expiry and/or when the webhook call fails
  • usually some retry mechanism is useful when interacting with third party services (so webhook data needs an identifier for deduplication?)
  • could be useful to send an initial 'subscribed' notification when ready.
  • the time when waiting for the channel to be active is interesting, especially regarding restarts of lspd/the underlying lightning node.

@roeierez
Copy link
Member Author

roeierez commented Mar 6, 2023

Nice points @JssDWt !

  • mechanism to remove webhook subscriptions by expiry and/or when the webhook call fails

I think at the LSP level expiry is enough. Only the actual delivery service has feedback on whether the hook is delivered or not.
We can require the delivery service return that feedback backwards but might be too much IMO (especially because of the async nature of such service).

@JssDWt
Copy link
Collaborator

JssDWt commented Mar 6, 2023

I think at the LSP level expiry is enough. Only the actual delivery service has feedback on whether the hook is delivered or not.
We can require the delivery service return that feedback backwards but might be too much IMO (especially because of the async nature of such service).

I was thinking about the case where the LSP calls the webhook, but the call is not successful (non-200 statuscode). I agree there is no way to determine delivery all the way to the client from the LSP point-of-view. If the Notification Delivery Service receives it, that's enough.

@JssDWt JssDWt mentioned this issue Apr 15, 2023
@JssDWt JssDWt self-assigned this Apr 17, 2023
@JssDWt JssDWt mentioned this issue Jun 16, 2023
@JssDWt
Copy link
Collaborator

JssDWt commented Aug 7, 2023

Fixed in #88
Followup in #103

@JssDWt JssDWt closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants