Skip to content

Migrate wallets off the shared default password - #13

Merged
rockstardev merged 1 commit into
lnd/v0.21.3-betafrom
password-migration
Sep 2, 2026
Merged

rockstardev merged 1 commit into
lnd/v0.21.3-betafrom
password-migration

Conversation

@rockstardev

Copy link
Copy Markdown
Member

New wallets no longer get the hardcoded hellorockstar password - they receive a random per-instance password, written to walletunlock.json next to wallet.db (the same file BTCPay's seed backup view exposes), so the backup-file flow is unchanged.

On startup, wallets whose unlock file still carries hellorockstar (or an empty password field that falls back to it) are migrated: changepassword on the still-locked wallet rotates to a freshly generated random password and unlocks in one call, and the unlock file is rewritten only after the RPC succeeds. A failed rotation leaves the old password working and is retried on the next start. The hellorockstar\n line-feed legacy variant falls through to a second changepassword attempt and migrates the same way. The cipher seed mnemonic (or the Seed removed placeholder) is preserved untouched.

Also fixes a latent quirk in the restart path: successful unlockwallet returns {}, which the old else-branch logged as failure and exited before reaching the Loop startup section.

Verified locally against regtest:

  • fresh wallet: random password created, lnd unlocked and functional
  • legacy hellorockstar wallet upgraded to this image: password rotated, file rewritten, restart unlocks from the file
  • legacy hellorockstar\n line-feed wallet: rotates via the fallback attempt
  • mnemonic preserved (24 words) in all migrations

New wallets get a per-instance random password instead of the hardcoded
hellorockstar default; it is written to walletunlock.json next to
wallet.db as before, so the backup-file flow is unchanged.

On startup, wallets whose unlock file still carries hellorockstar (or an
empty password field that falls back to it) are migrated: after a
successful unlock the script calls changepassword with a freshly generated
random password and only then rewrites the unlock file. A failed rotation
leaves the file untouched and is retried on the next start. The
hellorockstar line-feed legacy variant still resolves first, then the
migration runs on top of it.

The seed mnemonic (or the Seed removed placeholder) is preserved byte for
byte; only the wallet_password field is updated.
@rockstardev
rockstardev merged commit 6b26cb3 into lnd/v0.21.3-beta Sep 2, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant