Skip to content

Add Recovering Channel Funds from a Stale Backup #257

Description

@tankyleo

This works against LND, and Eclair, filed two issues to make this work at CLN. Do we want to add this to the docs ? IIUC the past answer to SCB has been, no, please use VSS ?

Recovering Channel Funds from a Stale Backup

Use this last-resort procedure only when current channel state is lost but the mnemonic and an
older ldk_node_data.sqlite remain.

  1. Stop every process using the node identity. Preserve the mnemonic and stale database as
    opaque files; do not open or modify the database.
  2. Start a temporary node on the same network from a new storage directory containing only the
    recovered keys_mnemonic.
  3. From the temporary node, call connect-peer for each channel counterparty. The state mismatch
    causes the counterparty to force-close without operator action on that node.
  4. Wait until each counterparty commitment transaction is confirmed on chain, then stop the
    temporary node. Do not start the stale database before confirmation.
  5. Block inbound and outbound Lightning peer connections while leaving the chain backend
    reachable. Copy the mnemonic and complete stale database into a clean storage directory,
    preserving the standard layout, and start LDK Server:
<storage_dir>/keys_mnemonic
<storage_dir>/<network>/ldk_node_data.sqlite
  1. Keep peer connections blocked while the stale monitor detects the confirmed commitment and
    broadcasts the sweep of its static to_remote output. Verify that the sweep confirms before
    restoring peer connectivity or considering recovery complete.

Practice this procedure on regtest and retain untouched copies of all recovery material.

If we want this, an --offline flag against ldk-server will be useful for the "keep peer connections blocked" part.

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