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

chantools forceclose --channeldb crashes on taproot channels: malformed signature: no header magic #108

Open
starius opened this issue Dec 31, 2023 · 0 comments

Comments

@starius
Copy link
Contributor

starius commented Dec 31, 2023

Problem

I stopped LND and ran the following command:

$ chantools --testnet forceclose --channeldb ./.lnd/data/graph/testnet/channel.db --fromchanneldb ./.lnd/data/graph/testnet/channel.db
Input your 24-word mnemonic separated by spaces: ***
Input your cipher seed passphrase (press enter if your seed doesn't have a passphrase):

If the node does not have a taproot channel, this command completes successfully:

2023-12-31 18:32:20.935 [INF] CHAN: Writing result to results/forceclose-2023-12-31-18-32-20.json

After I opened a taproot channel, it started crashing with the following error:

Error: malformed signature: no header magic
Usage:
  chantools forceclose [flags]
...

I verified this observation on two nodes (testnet and signet).

Analysis

I think, that the root cause is in the function LightningChannel.CreateSignDesc which is not aware of taproot channels.

lnd's function createSignDesc has taproot aware implementation.

In #95 I'm adding the code building SignDescriptor from a channel backup. I think most of that code can be factored into a generic function, which can be used by LightningChannel.CreateSignDesc as well. Maybe even chantools can use a common function from LND to avoid diversions in the future.

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

1 participant