Skip to content

Commit 36f89b6

Browse files
committed
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. Co-Authored-By: HAL 9000
1 parent 3f98887 commit 36f89b6

3 files changed

Lines changed: 39 additions & 8 deletions

File tree

contrib/ldk-server-config.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ 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, a fresh 24-word mnemonic is generated on
15+
# first start. Defaults to "<storage_dir>/keys_mnemonic".
16+
# CLI/env: --node-entropy-mnemonic-file / LDK_SERVER_NODE_ENTROPY_MNEMONIC_FILE
17+
#mnemonic_file = "/tmp/ldk-server/keys_mnemonic"
18+
# Legacy: path to a raw 64-byte seed file used by ldk-server installs initialized before
19+
# BIP39 mnemonic support. Configure this explicitly to keep using an existing keys_seed file.
20+
# CLI/env: --node-entropy-seed-file / LDK_SERVER_NODE_ENTROPY_SEED_FILE
21+
# Mutually exclusive with `mnemonic_file`.
22+
#seed_file = "/tmp/ldk-server/keys_seed"
23+
1224
# Storage settings
1325
[storage.disk]
1426
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: 22 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 used when explicitly configured)
155156
tls.crt # TLS certificate (PEM)
156157
tls.key # TLS private key (PEM)
157158
<network>/ # e.g., bitcoin/, regtest/, signet/
@@ -161,6 +162,23 @@ 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+
CLI/env: `--node-entropy-mnemonic-file` / `LDK_SERVER_NODE_ENTROPY_MNEMONIC_FILE`.
178+
- `seed_file`: path to a raw 64-byte seed file. Provided for backwards compatibility with installs
179+
initialized before BIP39 mnemonic support. Mutually exclusive with `mnemonic_file`.
180+
CLI/env: `--node-entropy-seed-file` / `LDK_SERVER_NODE_ENTROPY_SEED_FILE`.
181+
182+
Legacy raw-seed installs are not auto-detected. To keep using an existing
183+
`<storage_dir>/keys_seed`, set `seed_file` explicitly or use the corresponding CLI argument or
184+
environment variable.

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 used when explicitly configured. |
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 an explicitly configured legacy `keys_seed`, is shared across
200+
networks (stored at the storage root, not per-network). Keys are split by network at the
201+
derivation path level, so the same mnemonic/seed will produce different keys.

0 commit comments

Comments
 (0)