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

[UX/UI] Payment of twice the amount expected warning/error message (Bolt #4) #232

Closed
braydonf opened this issue Jan 5, 2022 · 7 comments
Labels
UI-android User Interface issue in the Android app

Comments

@braydonf
Copy link

braydonf commented Jan 5, 2022

Steps to reproduce:

  1. Create an invoice for something around 5 satoshis
  2. Attempt to pay the invoice with another wallet, however change the amount to something greater such as 12000 satoshis.
  3. The payment will fail with the error "Recipient is not reachable, or does not have enough inbound liquidity." Note: If the invoice is created for 12000 satoshis it will go through without an error.
@dpad85
Copy link
Member

dpad85 commented Jan 5, 2022

This is related to your incoming liquidity. If your existing channels don't have the liquidity to accept a incoming amount, a new LN channel will have to be created to receive the payment. However this only happens if the payment is large enough (10k sat at least) otherwise it's not worth it (because there's an on-chain tx under the hood) and payment will just fail.

See those entries in the FAQ:

Knowing your incoming liquidity in advance is unfortunately not possible for now so the UX can be poor. Work is being done to fix that.

@braydonf
Copy link
Author

braydonf commented Jan 6, 2022

Okay, thanks for the info.

I believe the wallet had enough inbound capacity without the need for a new channel. We would need to test again to determine the incoming liquidity. The issue resolved immediately without the pending confirmation time that would be associated with an on-chain transaction. So far as I know, there wasn't a new channel created.

So what worked:

  1. Payee creates invoice at 12000 sats and payer sends 12000 sats
  2. Payee creates invoice at 5 sats and payer sends 5 sats

What did not work:

  1. Payee creates invoice at 5 sats and payer sends 12000 sats

@dpad85
Copy link
Member

dpad85 commented Jan 6, 2022

What did not work:

Payee creates invoice at 5 sats and payer sends 12000 sats

Yep an invoice cannot be overpaid by that much. At most, the protocol (and Phoenix) will let you pay twice the requested amount of an invoice, and that's only for privacy reason

See specifications: https://github.com/lightning/bolts/blob/f6c4d7604150986894bcb46d67c5c88680740b12/04-onion-routing.md#L1103
if the amount paid is more than twice the amount expected: SHOULD fail the HTLC..

@braydonf
Copy link
Author

braydonf commented Jan 6, 2022

Bingo! That explains it.

I think this is a UX improvement: If a payer changes the amount of the invoice greater than twice, it could display a warning stating that it is too much for the requested amount. This way it does not seem that the payment failed for another reason.

@braydonf braydonf changed the title Changing invoice amount will sometimes cause issues [UX/UI] Payment of twice the amount expected warning/error message (Bolt #4) Jan 6, 2022
@robbiehanson
Copy link
Contributor

For reference, here's what it currently looks like on iOS:

@braydonf
Copy link
Author

Is that something in development or already exists, just not with the Android release?

dpad85 added a commit that referenced this issue Jan 12, 2022
For compliance with bolt#11, the wallet should not let the user try to
send more than twice the requested amount. Otherwise the payment will
most probably be rejected by the receiver anyway, and the error returned
by the receiver will be confusing. So UX wise it's better to error early.

See #232
@dpad85
Copy link
Member

dpad85 commented Jan 12, 2022

Next android release will add an error message. The screen above is the live iOS version which is a bit fancier. At some point the iOS and Android versions will converge.

@robbiehanson robbiehanson added the UI-android User Interface issue in the Android app label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI-android User Interface issue in the Android app
Projects
None yet
Development

No branches or pull requests

3 participants