latest-revision | original-author | created | status | title | contributors | type | description | discussions-to | category |
---|---|---|---|---|---|---|---|---|---|
2019-01-27T00:00:00.000Z |
Ryan Shea (ryan-shea) |
2019-01-01T00:00:00.000Z |
Accepted |
Channel Backups |
Ryan Shea (ryan-shea) |
article |
GitHub URL |
lightning-channels |
Channel backup features aim to provide a simple safe to allow users to recover settled funds in channels in the case of partial or complete data loss.
Backing up Lightning channels is difficult due to the complexity compared to backing up on-chain funds. Two problems arise when backing up of Lightning funds. First, the backup needs to be updated every time the state of the channel changes (which happens several times during a single payment). Second: if you restore channels from a backup that you think is up to date, but is actually an outdated stale state, then your counterparty could believe you are attempting to cheat on them and take all your money as a punishment.
Workarounds for this are being built in various implementations of the Lightning protocol.
Lightning Labs has implemented a new safe scheme for static channel backups (SCB's) for lnd
. The backups are encrypted using the a key derived from the user's seed, protecting the privacy of the users channels in the back up state, ensuring that a random node can't attempt to import another user's channels.
Given their seed and the latest back up file, the users are able to recover both their on-chain funds and funds that are fully settled within their channels.
{% hint style="info" %} "Fully settled" refers to funds that are in the base commitment outputs, not HTLCs. {% endhint %}
lnd
can only restore funds as right after the channel is created. Resolving HTLCs is currently not possible.
Users can also recover from certain kinds of database corruption. Core code for handling recoveries is now in place, and combined with future planned developments, recovery of all funds in cases of data or device loss will be possible.
Channel Backups in c-lightning
[2] https://medium.com/@ACINQ/enabling-automated-backup-on-eclair-wallet-9f58dc3d8407