Skip to content

Make entropy source configurable, default to mnemonic#197

Draft
tnull wants to merge 2 commits intolightningdevkit:mainfrom
tnull:2026-04-mnemonic-seed
Draft

Make entropy source configurable, default to mnemonic#197
tnull wants to merge 2 commits intolightningdevkit:mainfrom
tnull:2026-04-mnemonic-seed

Conversation

@tnull
Copy link
Copy Markdown
Collaborator

@tnull tnull commented Apr 21, 2026

Draft for now

tnull added 2 commits April 21, 2026 15:15
Previously ldk-server unconditionally loaded its node entropy from a raw
64-byte file at `<storage_dir>/keys_seed`, which is opaque and cannot be
imported into other wallets. Switch the default to a BIP39 mnemonic
written to `<storage_dir>/keys_mnemonic`, so operators can back up their
node identity as a 24-word phrase and recover on-chain funds with any
standard BIP39-compatible wallet.

Add a `[node.entropy]` config section with two mutually exclusive
fields:

  - `mnemonic_file`: path to the BIP39 mnemonic file (defaults to
    `<storage_dir>/keys_mnemonic`).
  - `seed_file`: legacy raw-seed file path, for installs initialized
    before this change.

For backwards compatibility, if neither field is set and a `keys_seed`
file already exists at the storage root, ldk-server continues to use
it. No implicit migration: a raw 64-byte seed cannot be reversed back
into its source mnemonic.

Co-Authored-By: HAL 9000
Update the example config and operator-facing docs to reflect the new
default of a BIP39 mnemonic at `<storage_dir>/keys_mnemonic`, the
mutually exclusive `[node.entropy]` options, and the legacy `keys_seed`
backwards-compatibility path. Update the backup table to list both
files so legacy operators don't lose track of their existing seed.

Co-Authored-By: HAL 9000
@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Apr 21, 2026

👋 Hi! This PR is now in draft status.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

@tnull tnull marked this pull request as draft April 21, 2026 13:16
@benthecarman
Copy link
Copy Markdown
Collaborator

concept ack

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.

3 participants