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

rescuefunding for a transaction that generated neither channel nor pending channel #41

Closed
Marimox opened this issue Mar 11, 2022 · 15 comments

Comments

@Marimox
Copy link

Marimox commented Mar 11, 2022

I tried to open 4 channels in one transaction by running the bos open command, but although the transaction was confirmed, only 3 channels were created and the remaining one generated neither a channel nor a pending channel.

The transaction is shown below, and based on the channel points of the other channels that worked, I am guessing that the index that did not create a channel is 1.
https://mempool.space/tx/67a15827b95c68b7e708e82732ff33f92ce39c1547e09714acecc09789fcebfc

The detailed situation is described in this bos issue.

Fortunately I was able to get cooperation from the pier I tried to open the channel with, so I am planning to use the resucuefunding command to recover the funds. In this case, I think I need to run the command without using channel.db, but how do I get the "--localkeyindex" that I need?

@guggero
Copy link
Member

guggero commented Mar 11, 2022

Take a look at the zombierecovery subcommands. Those can be used if no channel DB information is available.
Those aren't well documented yet, so if you'd like to write a HOWTO on how to use them, I'd throw in 200k sats as a bounty for a PR that adds the HOWTO.

@guggero guggero closed this as completed Mar 11, 2022
@Marimox
Copy link
Author

Marimox commented Mar 11, 2022

Thanks for the reply. It gave me some hope.
I immediately registered my node ID in Lightning Network Node Recovery.

If I am successful, I will try to create a HOWTO.

@guggero
Copy link
Member

guggero commented Mar 12, 2022

You don't need to register at node-recovery.com if you already know who your other node of the channel to rescue is.

Then you can directly create a JSON file like this and start with step [1/3] (which I think you did, just commenting here in case someone else finds this issue):

{
 "node1": {
  "identity_pubkey": "03.....",
  "contact": "node1 contact info (not really relevant)"
 },
 "node2": {
  "identity_pubkey": "03.....",
  "contact": "node2 contact info (not really relevant)"
 },
 "channels": [
  {
   "short_channel_id": "zzzzzz",
   "chan_point": "xxxxx:y",
   "address": "bc1q....",
   "capacity": 123...
  }
 ]
}

@Marimox
Copy link
Author

Marimox commented Mar 16, 2022

Thanks for the reply. I created the following match_file.

{
    "node1": {
        "identity_pubkey": "03910da61c1b42e135f134ed92a537c758d1edac5436efbec5ee8cec1928e1a095"
    },
    "node2": {
        "identity_pubkey": "022eb09a7993a0edde69537b420f4119c0de833e0ee47651753b46bf884db75235"
    },
    "channels" : [{
        "short_channel_id" : "7262096251",
        "chan_point" : "67a15827b95c68b7e708e82732ff33f92ce39c1547e09714acecc09789fcebfc:1",
        "address" : "bc1qrzhnszht65ukvcjlnmkk08mvd6glqa0uyq4jway0dqm49mrykmasnqhf0v",
        "capacity" : 3000000
    }]
}

I have also successfully sent this file to the other party to run preparekeys. However, when I ran makeoffer along with my pubkeys, chantools output the following message and did not work.

didn't find matching multisig keys for channel 67a15827b95c68b7e708e82732ff33f92ce39c1547e09714acecc09789fcebfc:1

Is there something wrong with my match_file? Or is it possible that the first 2500 pubkey does not match?

@guggero
Copy link
Member

guggero commented Mar 16, 2022

I recently fixed a bug in chantools that derived the node identity incorrectly. Can you try with the most recent version please?
Also, I think your short channel ID should be 798475239736541185. The rest looks okay.

@Marimox
Copy link
Author

Marimox commented Mar 16, 2022

I am running preparekeys and makeoffer with v0.10.2 after the update.
I replaced the short_channel_id as you pointed out for my and the other party's preparedkeys file, and ran makeoffer again, but unfortunately the result did not change.

@guggero
Copy link
Member

guggero commented Mar 16, 2022

Hmm... Without any log or pending channel, how did you determine what peer this channel was supposedly opened with? Might sound like a stupid question... Just trying to make sure everything is correct. I assume (by looking at the BOS issue) that it's just process of elimination? Since all the other channels to the other peers opened successfully?

Maybe you were really unlucky and the other party running preparekeys with the previous version of chantools ran into the issue I fixed recently. I'm sorry, you might have to ask them to run the command again with the new version.

If that still doesn't match, then it's possible it really isn't the right peer? Are you sure you can't dig up more of your lnd logs?

@Marimox
Copy link
Author

Marimox commented Mar 17, 2022

Yes, you are right, I estimated the peers by process of elimination from the indexes of the other three successful channels, as I could not find any channel or pending channel in my lnd.
And this is what we found out recently, that on the peer side, when running the lncli closedchannels command, this txid was seen as a funding canceled channel.

My peer tried to run the preparekeys command and it didn't work, so he put up issue #42. So I am sure my peer ran the command using the latest version.

The logs have been lost due to log rotation, which is very sad and regrettable, but it does not appear to be possible to investigate further.

@guggero
Copy link
Member

guggero commented Mar 17, 2022

And this is what we found out recently, that on the peer side, when running the lncli closedchannels command, this txid was seen as a funding canceled channel.

Ah, that is good news though, it means we can get some additional info. @cryptosharks131 could you please run chantools dumpchannels --closed --channeldb <your_channel.db> and send the output to me please?
Email or Slack works.
This means you have to shut down lnd to access the channel DB though, so I'm sorry for the inconvenience. But I think that output should contain the public key that was used for the multi-sig output.

@cryptosharks131
Copy link

I keep getting the following error when trying to run chantools dumpchannels --closed even when having more than 2x the memory available than the size of the channel.db file.

Error: error opening rescue DB: CreateFileMapping: Not enough memory resources are available to process this command.

@guggero
Copy link
Member

guggero commented Mar 18, 2022

Are you using the 64bit (either amd64 or arm64 depending on your machine) version of chantools?

@cryptosharks131
Copy link

Yes, this was using a 64bit version.

@guggero
Copy link
Member

guggero commented Mar 21, 2022

Leaving this comment here for anyone finding this issue through a search engine.

The Error: error opening rescue DB: CreateFileMapping: Not enough memory resources are available to process this command. error seems to be Windows specific. If that happens to you, try to find a Unix based machine to run the command on (for example MacOS or Linux).

@Marimox
Copy link
Author

Marimox commented Mar 23, 2022

We finally unlocked the multisig and recovered the funds we thought we had lost!

https://mempool.space/address/bc1qrzhnszht65ukvcjlnmkk08mvd6glqa0uyq4jway0dqm49mrykmasnqhf0v

I could not have accomplished so much without your kind advice and quick fixes. Thank you so much!

@guggero
Copy link
Member

guggero commented Mar 23, 2022

So happy to hear that!
Thank you for your patience with all the bugs you (and @cryptosharks131) uncovered along the way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants