bitkit icon indicating copy to clipboard operation
bitkit copied to clipboard

[Bug]: It is possible to receive payments twice with same LN invoice

Open limpbrains opened this issue 1 year ago • 2 comments

Describe the bug

Using bitkit or WOS we were able to send to the same LN invoice a few times.

Reproduce

  1. Create LN invoice
  2. Payit using different wallets
  3. You will receive funds a few times

Screenshots / Recording

receiver history: image

receiver payment1: image

receiver payment2: image

sender1 payment details: image

sender2 payment details: image

Operating system

iOS, Android

Bitkit version

v94

Log output

LDK logs from the receiver

limpbrains avatar Jan 12 '24 10:01 limpbrains

After restarting the app I only see one payment. But before I did so, I was able to send 10 sats to another wallet

limpbrains avatar Jan 12 '24 10:01 limpbrains

This issue it's still not fix

JeanlChristophe avatar Apr 19 '24 12:04 JeanlChristophe

Fix is here. Will update when in Bitkit.

Jasonvdb avatar May 09 '24 07:05 Jasonvdb

Tested on acf22eef1c63cad1dff84bc3304173825d01f6c0

The good: I haven't been able to pay an invoice twice, I always see an error. The bad: The error is displayed later in the flow than it could be. It'd be good to reject the action at the point of input/scan. The ugly: Presentation of the error message.

https://github.com/synonymdev/bitkit/assets/74595920/dc33090f-05c1-4963-91c6-14ae1b746394

catch-21 avatar May 29 '24 13:05 catch-21

So I agree with the bad and ugly part but this is a separate issue can be made for this. The fix I did here was to prevent duplicate payments from the receiver side. It's always been blocked on the sender side when trying to pay same invoice twice.

What was happening was 2 different lightning wallets were able to pay the same invoice, in this case they both thought they were the first so there was no check. So now with the fix the receiver enforces this check and only accepts the 1st payment.

Jasonvdb avatar May 29 '24 13:05 Jasonvdb

Yup, agreed. Raised https://github.com/synonymdev/bitkit/issues/1911.

Retested this using two different wallets to pay the same invoice and was not able to, so I'm happy to close this one.

catch-21 avatar May 29 '24 15:05 catch-21