Skip to content

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

Open
@starius

Description

@starius

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions