Skip to content

Commit f9c2d4f

Browse files
committed
doc: document output descriptors in hsmtool
Touch a bit about it as a backup/recovery mechanism in the FAQ Signed-off-by: Antoine Poinsot <[email protected]>
1 parent bd26353 commit f9c2d4f

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

doc/FAQ.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ it can recover all its funds.
107107
C-lightning has an internal bitcoin wallet, which you can use to make "on-chain"
108108
transactions, (see [withdraw](https://lightning.readthedocs.io/lightning-withdraw.7.html).
109109
These on-chain funds are backed up via the HD wallet seed, stored in byte-form in `hsm_secret`.
110+
The [`hsmtool`](https://lightning.readthedocs.io/lightning-hsmtool.8.html) can be used to
111+
backup the onchain wallet as [`output descriptors`](https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md)
112+
with the `dumponchaindescriptors` command (with the `private` parameter).
113+
These descriptors may then be recovered on any wallet supporting output descriptors, for
114+
example on `bitcoind` by using the `importmulti` or (introduced in `0.21`)
115+
`importdescriptors` RPC commands.
110116

111-
and which you can backup thanks to a seed stored in the `hsm_secret`.
112117
`lightningd` also stores information for funds locked in Lightning Network channels, which are stored
113118
in a database. This database is required for on-going channel updates as well as channel closure.
114119
There is no single-seed backup for funds locked in channels.

doc/lightning-hsmtool.8

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ and is usually no greater than the number of channels that the node has
5151
ever had\.
5252
Specify \fIpassword\fR if the \fBhsm_secret\fR is encrypted\.
5353

54+
55+
\fBdumponchaindescriptors\fR \fIhsm_secret\fR [\fIpassword\fR] [\fIprivate\fR] [\fItestnet\fR]
56+
Dump output descriptors for our onchain wallet\.
57+
The descriptors can be either expressed using \fIprivate\fR keys, for use as a back up and
58+
recovery mechanism (for example on \fBbitcoind\fR using the \fBimportmulti\fR or
59+
\fBimportdescriptors\fR RPC calls), or public for external services to be able to generate
60+
addresses for our onchain wallet\.
61+
We need the path to the hsm_secret containing the wallet seed, and an optional (skip using
62+
\fB""\fR) password if it was encrypted\.
63+
To generate descriptors using testnet master keys, you may specify \fItestnet\fR as the last
64+
parameter\. By default, mainnet-encoded keys are used\.
65+
5466
.SH BUGS
5567

5668
You should report bugs on our github issues page, and maybe submit a fix
@@ -76,4 +88,4 @@ Note: the modules in the ccan/ directory have their own licenses, but
7688
the rest of the code is covered by the BSD-style MIT license\.
7789
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
7890

79-
\" SHA256STAMP:11b3e6c050eb31e7faac10e8b75c3f7b7d57269f7f8c47c67f6d115b7a479c09
91+
\" SHA256STAMP:f2bc7ee339a01e6317593485778ec2a9c0cf11e1e6e26b7e44deb9cfdcedd987

doc/lightning-hsmtool.8.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ and is usually no greater than the number of channels that the node has
4848
ever had.
4949
Specify *password* if the `hsm_secret` is encrypted.
5050

51+
**dumponchaindescriptors** *hsm_secret* \[*password*\] \[*private*\] \[*testnet*\]
52+
Dump output descriptors for our onchain wallet.
53+
The descriptors can be either expressed using *private* keys, for use as a back up and
54+
recovery mechanism (for example on `bitcoind` using the `importmulti` or
55+
`importdescriptors` RPC calls), or public for external services to be able to generate
56+
addresses for our onchain wallet.
57+
We need the path to the hsm_secret containing the wallet seed, and an optional (skip using
58+
`""`) password if it was encrypted.
59+
To generate descriptors using testnet master keys, you may specify *testnet* as the last
60+
parameter. By default, mainnet-encoded keys are used.
61+
5162
BUGS
5263
----
5364

0 commit comments

Comments
 (0)