Backup

From lightningwiki.net
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Error creating thumbnail: File missing
Alert! Be careful!
Reliable backups are being worked on at the moment

Making backups is not easy. You can backup your key, but to recover a disk failure (for example), you still need the channel state.

The problem is that if you announce an old channel state (after you recovered a backup), this is detected as Fraud and you might lose your funds.

Poor mans solution

Probably just take your wallet-file... See github for more info.

Hardware

If you’re putting a lot of money on your Lightning routing node, please use a reliable hard drives (with mirroring).

Data Loss Protection

Data loss protection

Channel information

LND

Error creating thumbnail: File missing
Side note:
On 2019-04-02 Static Channel Backup was merged into LND Master
Error creating thumbnail: File missing
Side note:
See recovery docs by lnd

Once you start a channel, take a static channel backup. This has to be done only once.

After that, if your node dies, you can recover using the seed + the static-channel-backup and retrieve both your onchain and channel balance!

Example Static channel backup commands

>tlncli exportchanbackup --all

{
        "chan_points": [
                "a173ca220bb644b4be03e44285b1541382c85fc3de1f9f1e0f317892c55cfd29:0",
                "30ad897d900d837728e09bdb2f4859354207599522fab72d20582f5a713f983d:0",
                "2f86e0049c4488b2cad1a6cffffc56ffd56ba5e639b79994baed64e87e6849f2:0"
        ],
        "multi_chan_backup": "0f955a78d0df14db44769c946a537a9c81174a097e3***6ecf7f4ab1afaa0e06"
}

>tlncli verifychanbackup --multi_backup 0f955a78d0df14db44769c946a537a9c81174a097e3***6ecf7f4ab1afaa0e06

{
    "singles_valid": true,
    "multi_valid": true
}

>tlncli restorechanbackup --multi_backup 0f955a78d0df14db44769c946a537a9c81174a097e3***6ecf7f4ab1afaa0e06

>tlncli pendingchannels

{
    "total_limbo_balance": "0",
    "pending_open_channels": [
    ],
    "pending_closing_channels": [
    ],
    "pending_force_closing_channels": [
    ],
    "waiting_close_channels": [
        {
            "channel": {
                "remote_node_pub": "031673e26fa50f5e1598caff98b8be466998486bd876751b7824ad8def3aa7e76d",
                "channel_point": "30ad897d900d837728e09bdb2f4859354207599522fab72d20582f5a713f983d:0",
                "capacity": "500000",
                "local_balance": "0",
                "remote_balance": "0"
            },
            "limbo_balance": "0"
        },
        {
            "channel": {
                "remote_node_pub": "03b8e1dfc4bf42adec135350dd51784e5b55055f5647d031771bdf439f5de87b88",
                "channel_point": "2f86e0049c4488b2cad1a6cffffc56ffd56ba5e639b79994baed64e87e6849f2:0",
                "capacity": "700000",
                "local_balance": "0",
                "remote_balance": "0"
            },
            "limbo_balance": "0"
        },
        {
            "channel": {
                "remote_node_pub": "03ecd95e86e780ae82139c3217b527073622d28c4d8a53b76142a7b7b1d1e36975",
                "channel_point": "a173ca220bb644b4be03e44285b1541382c85fc3de1f9f1e0f317892c55cfd29:0",
                "capacity": "600000",
                "local_balance": "0",
                "remote_balance": "0"
            },
            "limbo_balance": "0"
        }
    ]
}
>tlncli walletbalance

{
    "total_balance": "108199538",
    "confirmed_balance": "108199538",
    "unconfirmed_balance": "0"
}
>tlncli pendingchannels

{
    "total_limbo_balance": "0",
    "pending_open_channels": [
    ],
    "pending_closing_channels": [
    ],
    "pending_force_closing_channels": [
    ],
    "waiting_close_channels": [
    ]
}
>tlncli walletbalance

{
    "total_balance": "109818740",
    "confirmed_balance": "109818740",
    "unconfirmed_balance": "0"
}
>tlncli listunspent --min_confs 0

{
        "utxos": [
                {
                        "address_type": 0,
                        "address": "tb1qxx25r275r08z3ygagg4cawxp60gj8ptynkvnwc",
                        "amount_sat": 1619202,
                        "pk_script": "0014319541abd41bce28911d422b8eb8c1d3d1238564",
                        "outpoint": "d7f037b2757e27ab16018c03c811f0f494fdad2dc029fc0810b108e103725da5:0",
                        "confirmations": 13
                },

Commitment revocation private key

Every commitment transaction has a unique commitment revocation private-key value that allows the other peer to spend all outputs immediately: revealing this key is how old commitment transactions are revoked. To support revocation, each output of the commitment transaction refers to the commitment revocation public key.