accounts.sqlite3
and emergency.recover
are created in my ~/.lightning/bitcoin
when I launch lightningd
- they weren't created there some years ago. What are accounts.sqlite3
and emergency.recover
and why might I want to back them up?
1 Answer
The accounts.sqlite3
file is managed by the built-in plugin bkpr
(the bookkeeper plugin). It tracks each individual coin movement that was performed while the plugin was running, and will give detailed information as to where your funds are at any point in time.
The emergency.recover
file was introduced in version v0.12.0 and is equivalent to LND's Static Channel Backups (which is more of a emergency recovery rather than a backup, hence the name change). It contains the minimal set of information to know with whom you had a channel, what the funding parameters where, and how to contact them to ask them to shut down the channel. It requires cooperation from the peer, but in absence of a better backup it can be used to recover some funds. It is by no means a replacement for backups, rather a last ditch attempt at clawing back some funds. This file has to be backed up after each funding of a new channel, so ideally set up a cron job to do that for you.
-
emergency.recover
was not generated back in 2021 when my friend funded their channel. They noticed the file some time in late 2022. Isemergency.recover
's creation based on the content oflightningd.sqlite3
? Isemergency.recover
created for each open channel (even for those channels funded before version 0.12.00)? Commented May 31, 2023 at 13:21 -
It is indeed recreated each time a new channel gets funded from the
lightningd.sqlite3
, so a single channel opening after the upgrade will create that file.– cdeckerCommented Jun 1, 2023 at 14:04