bordalix / helm-wallet

The lightning wallet even your grandma can use
https://helm-wallet.pages.dev
MIT License
18 stars 8 forks source link

Missing funds #7

Closed bilthon closed 2 months ago

bilthon commented 2 months ago

I was testing this wallet and decided to deposit the minimum allowed amount of 1K sats. I paid the invoice, but my balance is still zero.

I tried reloading with an increased gap, but nothing. I'm using the version at: https://helm-wallet.pages.dev.

The preimage for the lightning payment is: a1b2f6c9a20c7d2cf6bdf9902af395cb424e2e7195b03e0aca1af3764903b5f4

bordalix commented 2 months ago

Asked Boltz for help (they should have visibility on that swap). I will tell you something as soon as I get a response.

bordalix commented 2 months ago

So, it seems something went wrong when doing the swap, and Helm didn't claim the funds.

This means Boltz has some funds locked onchain, waiting for Helm to claim it. When Helm claims it, it must show the preimage, and when Boltz sees that, they are able to receive the funds on the Lightning channel.

All swaps have an expiration period, and if nothing happens until than, the swap is reversed, i.e., the money goes back to the Lightning payer.

The Lightning payment should bounce back in 1.5 hours from now (2024-08-01T15:34:45.000Z)

Sorry about the inconvenience, I'll develop a fix that will save claims to be done, and retry them if they fail.

Please let me know when the payment bounces back.

bilthon commented 2 months ago

I don't think that's the case. The payment was settled, I have the preimage as shown before. Here's the invoice:

lnbc10u1pn2kqj4sp53fhmeuk9jp58kmugy62qh725p904wnlgnqsnwv05u68wyac3eddqpp5dmewp7rrdu7w8cj24mpr5ryyt790qd4fp6gj847emjkzc8hve8dsdpz2djkuepqw3hjqnpdgf2yxgrpv3j8yetnwvxqyp2xqcqz95rzjqgar9prdzqugav8e4y3l77gar3jed5utyg9a0wv3pszls9972g90gzzxeyqq28qqqqqqqqqqqqqqq9gq2y9qxpqysgqsss0ctdtgfeauvxzjfjzrh7ewv84he62zjht4ecg0ccxvgux8g2yntv03h29wjl0sxuz28mq2d5xwwfce78xm0ged2raznauqu9zjjsqcny73f

I also remember seeing a txid in the logs, and I think it was this one: https://liquid.network/tx/26f2c0bf168a16308d99ce02d8084cb413d8224964d02c218ded2c9bd01632a7

Wouldn't that be indication that the swap did happen?

Also I'm using brave browser if that makes a difference, I think I had to turn off the browser "shields". Could the ad blocking features could have interfered here?

kilrau commented 2 months ago

We figured it out. You are completely right, the invoice was settled, the swap happened. What happened is that Helm uses our endpoint to broadcast claim transactions for swaps and we screwed up an edge case and rejected the broadcast. So broadcasting failed, that's why you never got your L-BTC. @bordalix reproduced and has a fix, he'll let you know when it's deployed. Sorry about this!

bilthon commented 2 months ago

Amazing! thanks for diving into this and I'm glad I could help to ironing out those edge cases. I'll keep an eye out for the update. Do I need to do anything on my side?

bordalix commented 2 months ago

First the bad news:

Unless someone has access to the failed claim tx hex, and is able to broadcast it, those satoshis are lost to the world.

@bilthon could get the claim tx hex if he still has access to the browser console, tab network and is able to copy the payload sent to the endpoint https://api.boltz.exchange/v2/chain/L-BTC/transaction. At this time, I think it would be a miracle if that page is still open and he could get the tx hex.

Other way would be if @kilrau is able to get the failed tx from Boltz endpoint logs. I don't know if that is possible.

Now the good news:

I just deployed a new version that:

bilthon commented 2 months ago

No I don't have the failed claim tx hex. But don't sweat over it, I tried using the minimum amount precisely knowing that something could go wrong. Glad it's fixed!

kilrau commented 2 months ago

@michael1011 went through our logs, unfortunately there was no broadcast attempt for this swap, so we do not have the tx hex neither :/