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

CLN Hold Invoice Plugin: Handle Overpayments #413

Closed
kilrau opened this issue Oct 20, 2023 · 0 comments · Fixed by #414
Closed

CLN Hold Invoice Plugin: Handle Overpayments #413

kilrau opened this issue Oct 20, 2023 · 0 comments · Fixed by #414
Assignees
Labels
enhancement New feature or request P1

Comments

@kilrau
Copy link
Member

kilrau commented Oct 20, 2023

Currently we are processing swaps as usual when users overpay and there is no limit on how much they can overpay. Onchain (Normal Swaps) there is nothing we can do and rely on the user contacting us with swap details for a refund but for Lightning (Reverse Swaps) we should adhere to BOLT04 behavior:

if the amount paid is more than twice the amount expected:
SHOULD fail the HTLC.
SHOULD return an incorrect_or_unknown_payment_details error.
Note: this allows the origin node to reduce information leakage by altering the amount while not allowing for accidental gross overpayment.
  • immediately fail incoming payments for a hold invoice that already has a pending payment and
  • immediately fail payments that overpay 2x or more as per above BOLT04 definition.

LND's integrated holdinvoice implemenation already behaves like this. Our own CLN hold invoice plugin should too.

@kilrau kilrau added enhancement New feature or request question Further information is requested labels Oct 20, 2023
@kilrau kilrau added P1 and removed question Further information is requested labels Oct 20, 2023
@kilrau kilrau changed the title [CLN Hold Invoice Plugin] Handle lightning overpayments CLN Hold Invoice Plugin: Handle Overpayments Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants