lightninglabs / chantools

A loose collection of tools all somehow related to lnd and Lightning Network channels.
MIT License
222 stars 32 forks source link

Incomplete instructions for fakechanbackup #102

Closed ohenrik closed 10 months ago

ohenrik commented 10 months ago

I'm trying to follow your guide for chantools fakechanbackup and the article you wrote a while back (https://guggero.medium.com/did-you-lose-funds-on-the-lightning-network-because-of-a-disk-crash-8971b6a92494) but there seems to be some gaps in the logic.

Firstly, when I use the fake backup the message in the LND log containing the commit_point goes by so fast that I'm not able to copy it down before it's gone. The guide should probably include a hint to grep the logs like this:

grep -P 'commit_point=\K[a-f0-9]{66}'  .lnd/logs/bitcoin/mainnet/lnd.log

# or 
# Old log files (here i'm using file 44, adjust accordingly. 
# Check what files you have using "ls -la .lnd/logs/bitcoin/mainnet/"
zgrep -P 'commit_point=\K[a-f0-9]{66}'  .lnd/logs/bitcoin/mainnet/lnd.log.44.gz

However, the bigger problem is that the guide says nothing about where I can find the force close address.

chantools rescueclosed --force_close_addr <??????> --commit_point 02b[redacted]923

Hope you can help me get this working.

guggero commented 10 months ago

The guide is very old and doesn't apply anymore as you don't need the commit point for newer channel types. You can find the force close address by following the channel funding transaction on-chain. Just look up the channel funding (the first part before the colon is the transaction ID).

guggero commented 10 months ago

By the way, you can just use chantools sweepremoteclosed if the peer force closed. I'll see if I find time to update the medium post.

guggero commented 10 months ago

Also, the instructions are all there...

(it will also be save to the default log file so you can also look it up there)

...

To now recover the private key for the address that our part of the channel balance should now be on, we first need to find out the address where the force-close transaction output has been locked to. For this, it's easiest if we have a look at the channel funding transaction (found on 1ml.com, we used this in a previous step) in a block explorer like www.blockstream.info for example. We should now see that this funding transaction has been spent. If that is not the case, then the remote node has not yet force-closed the channel. There might be a way to approach the owner of the node and ask them to force-close manually.

guggero commented 10 months ago

Okay, I've updated the medium post to no longer recommend using rescueclosed but sweepremoteclosed instead.

ohenrik commented 10 months ago

ah, sorry I'm blind. But thank you for the update on using sweepremoteclosed. Now I just need to be able to reach the other node operators and ask them to close channels... 😬

guggero commented 10 months ago

That shouldn't be necessary, that's the whole point of using the fake channel backup, to automate the force closing. So best to check mempool.space if there is a force closing transaction in the mempool. Because of the high fees it's also possible the transaction cannot even be broadcast at the moment, so depending on the channel state some (or a lot) of patience might also be required.