Repository navigation
Description
Two documented procedures leave an operator with a recovery artifact that doesn't recover anything. Neither is a code bug on its own, but both end in fund loss at the moment the operator needs the artifact.
1. After migrating an existing lnd, the seed file on disk belongs to a discarded wallet
modules/lnd.nix creates ${dataDir}/lnd-seed-mnemonic and a new wallet on the first start when wallet.db is missing, and because lnd is wantedBy multi-user.target, this happens on the first deploy, before the operator gets to the migration.
"Migrate existing services to bitcoinix" in docs/configuration.md then says to rsync -a the old data directory over /var/lib/lnd and copy the wallet password, but rsync -a without --delete keeps the generated lnd-seed-mnemonic. The file now has nothing to do with the wallet that runs, and nothing checks this on later starts, because the seed logic only runs when wallet.db is missing.
examples/configuration.nix tells the operator to back up exactly that file as "your wallet mnemonic seed", and modules/backups.nix includes it, so at disaster recovery the seed restores an empty wallet.
Fix: in the migration section, add an lnd step that stops lnd and removes /var/lib/lnd/lnd-seed-mnemonic and the generated wallet (or uses rsync -a --delete) before the copy, and says the real seed is the one from the old node. In lnd.nix, it would also be possible to refuse to start when both wallet.db and lnd-seed-mnemonic exist and the seed file is older than the wallet directory it didn't create, but that's a heuristic, so the docs fix is the important part.
2. With generateSecrets, the backup password exists only inside the backup it unlocks
modules/backups.nix generates backup-encryption-password into the secrets directory and encrypts every backup with it. The secrets directory is part of the backup when nix-bitcoin.generateSecrets is on, and nothing else stores the password.
The backups section of examples/configuration.nix explains destinations, the sftp password and bulk data, but it never says to copy backup-encryption-password off the node. The generateSecrets option text says "back up the generated secrets", which is easy to read as "the backup service does that", and it does, but into the archive that needs the password.
When the node's disk dies, the backup is unreadable, and with it the lnd seed, channel.backup, hsm_secret and the bitcoind wallets it holds.
Fix: in the backups comment block in examples/configuration.nix and in the services.backups.enable description, add one line that says to copy $secretsDir/backup-encryption-password to a place that doesn't depend on the node. The duplicity unit could also log a warning at every run when generateSecrets is on, since that's the only run-time moment the operator is likely to look.
I can send the docs change for both if you want it.
Found by Opus 5.5 in a code read of the fund-handling modules at master 4452d89 and checked by Fable 5.1 against docs/configuration.md, examples/configuration.nix, modules/lnd.nix and modules/backups.nix.
Activity
docs: warn about the stale lnd seed and the backup password
docs: warn about the stale lnd seed and the backup password (bitcoini…