ACINQ / phoenix

Phoenix is a self-custodial Bitcoin wallet using Lightning to send/receive payments.
https://phoenix.acinq.co
Apache License 2.0
632 stars 95 forks source link

Wrong amount read from LNURL withdraw #394

Closed TKone7 closed 11 months ago

TKone7 commented 11 months ago

Hey there,

We are providing LNURL withdraw to our customers to claim their sats that they bought with Pocket.

In the latest version (2.0.0) of the Phoenix beta app we experience issues with certain amounts.

With the below LNURL we offer to withdraw exactly 1'113'244 sats. However, Phoenix interprets the amount wrong and creates an invoice of 1'113'244'032 msats. This in turn is validated on our end and rejected because the amounts mismatch. This then prevents the user from withdrawing his funds.

Note: Feel free to test with the below LNURL. It expects a testnet invoice. But you won't be able to claim the funds even with a correct invoice because we restrict to wich pubkey it can be paid out. But for testing it should suffice.

LNURL https://api.staging.pocketbitcoin.com/api/lnurl/withdraw/d58088e1-4c14-4712-a119-7d2fb064a43d Response

{
  "tag": "withdrawRequest",
  "callback": "https://api.staging.pocketbitcoin.com/api/lnurl/withdraw/d58088e1-4c14-4712-a119-7d2fb064a43d/callback",
  "k1": "none",
  "defaultDescription": "Pocket 💜",
  "minWithdrawable": 1113244000,
  "maxWithdrawable": 1113244000
}

Invoice screen phoenix_wrong_amount

dpad85 commented 11 months ago

Hi, this issue is fixed by https://github.com/ACINQ/phoenix/commit/66b2687ce2949fa5674823900069b497e415d9b7. The fix will be available in 2.0.1, available very soon.

TKone7 commented 11 months ago

Awesome, thanks for the update 🙏🏽

dpad85 commented 11 months ago

Version 2.0.1 is available on Google Play for users that were already on v2.0.0 (as well as the beta testers). Thanks for reporting this issue 👍