Skip to content

Commit 86e4efb

Browse files
tnulltnull
authored andcommitted
Document mnemonic-based node entropy configuration
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. Generated with the assistance of AI (Claude). Co-Authored-By: HAL 9000
1 parent 0cf9213 commit 86e4efb

3 files changed

Lines changed: 33 additions & 8 deletions

File tree

contrib/ldk-server-config.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ alias = "ldk_server" # Lightning node alias
99
#rgs_server_url = "https://rapidsync.lightningdevkit.org/snapshot/v2/" # Optional: RGS URL for rapid gossip sync
1010
#async_payments_role = "client" # Optional async payments role: "client" or "server"
1111

12+
# Node entropy settings
13+
[node.entropy]
14+
# Path to a BIP39 mnemonic file. If unset and no legacy `keys_seed` file exists, a fresh
15+
# 24-word mnemonic is generated on first start. Defaults to "<storage_dir>/keys_mnemonic".
16+
#mnemonic_file = "/tmp/ldk-server/keys_mnemonic"
17+
# Legacy: path to a raw 64-byte seed file used by ldk-server installs initialized before
18+
# BIP39 mnemonic support. Mutually exclusive with `mnemonic_file`.
19+
#seed_file = "/tmp/ldk-server/keys_seed"
20+
1221
# Storage settings
1322
[storage.disk]
1423
dir_path = "/tmp/ldk-server/" # Path for LDK and BDK data persistence, optional, defaults to ~/Library/Application Support/ldk-server/ on macOS, ~/.ldk-server/ on Linux

docs/configuration.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ Two resolution methods are supported via the `mode` field:
151151

152152
```
153153
<storage_dir>/
154-
keys_seed # Node entropy/seed
154+
keys_mnemonic # BIP39 mnemonic (default for new installs)
155+
keys_seed # Legacy raw seed (only present on installs initialized before mnemonic support)
155156
tls.crt # TLS certificate (PEM)
156157
tls.key # TLS private key (PEM)
157158
<network>/ # e.g., bitcoin/, regtest/, signet/
@@ -161,6 +162,20 @@ Two resolution methods are supported via the `mode` field:
161162
ldk_server_data.sqlite # Payment and forwarding history
162163
```
163164

164-
The `keys_seed` file is the node's master secret, required to recover on-chain funds.
165-
`ldk_node_data.sqlite` holds channel state, both are required to recover channel funds. See
166-
[Operations - Backups](operations.md#backups) for backup guidance.
165+
The mnemonic (or, for legacy installs, the raw seed) is the node's master secret, required to
166+
recover on-chain funds. `ldk_node_data.sqlite` holds channel state, both are required to recover
167+
channel funds. See [Operations - Backups](operations.md#backups) for backup guidance.
168+
169+
### Node entropy (`[node.entropy]`)
170+
171+
By default, ldk-server reads or generates a 24-word BIP39 mnemonic at `<storage_dir>/keys_mnemonic`,
172+
which can be imported into any standard BIP39-compatible wallet to recover on-chain funds. The
173+
defaults can be overridden under `[node.entropy]`:
174+
175+
- `mnemonic_file`: path to the BIP39 mnemonic file. Defaults to `<storage_dir>/keys_mnemonic`. If
176+
the file does not exist on first start, a fresh 24-word mnemonic is generated and written.
177+
- `seed_file`: path to a raw 64-byte seed file. Provided for backwards compatibility with installs
178+
initialized before BIP39 mnemonic support. Mutually exclusive with `mnemonic_file`.
179+
180+
For backwards compatibility, if neither field is configured and a `keys_seed` file exists at the
181+
storage root, ldk-server will continue to use it.

docs/operations.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ setup):
4848

4949
| File | Priority | Description |
5050
| -------------------------------------- | ------------ | -------------------------------------------------------------------------- |
51-
| `<storage_dir>/keys_seed` | **Critical** | Node identity and master secret. Required to recover on-chain funds. |
51+
| `<storage_dir>/keys_mnemonic` | **Critical** | BIP39 mnemonic. Required to recover on-chain funds. Default for new installs. |
52+
| `<storage_dir>/keys_seed` | **Critical** | Legacy raw seed file. Only present on installs initialized before mnemonic support. |
5253
| `<network_dir>/ldk_node_data.sqlite` | **Critical** | Channel state and on-chain wallet data. Required to recover channel funds. |
5354
| `<network_dir>/ldk_server_data.sqlite` | Nice-to-have | Payment and forwarding history |
5455

@@ -195,6 +196,6 @@ Data is stored in per-network subdirectories (`bitcoin/`, `testnet/`, `signet/`,
195196
etc.) under the storage root. This means you can run multiple networks from one storage
196197
directory without conflicts.
197198

198-
The `keys_seed` file is shared across networks (stored at the storage root, not per-network).
199-
Keys are split by network at the derivation path level, so the same seed will produce
200-
different keys.
199+
The `keys_mnemonic` file (or, on legacy installs, `keys_seed`) is shared across networks
200+
(stored at the storage root, not per-network). Keys are split by network at the derivation
201+
path level, so the same mnemonic/seed will produce different keys.

0 commit comments

Comments
 (0)