diff --git a/doc/developers-guide/plugin-development/hooks.md b/doc/developers-guide/plugin-development/hooks.md index 54d98f950..4bc15c9e0 100644 --- a/doc/developers-guide/plugin-development/hooks.md +++ b/doc/developers-guide/plugin-development/hooks.md @@ -57,6 +57,19 @@ The returned result must contain a `result` member which is either the string `d Note that `peer_connected` is a chained hook. The first plugin that decides to `disconnect` with or without an `error_message` will lead to the subsequent plugins not being called anymore. +### `recover` + +This hook is called whenever the node is started using the --recovery flag. So basically whenever a user wants to recover their node with a codex32 secret, they can use --recover= to use that secret as their HSM Secret. + +The payload consists of the following information: +```json +{ + "codex32": "ms10leetsllhdmn9m42vcsamx24zrxgs3qrl7ahwvhw4fnzrhve25gvezzyqqtum9pgv99ycma" +} +``` + +This hook is intended to be used for recovering the node and funds by connecting to some known peers who keep your peer storage backups with them. + ### `commitment_revocation` This hook is called whenever a channel state is updated, and the old state was revoked. State updates in Lightning consist of the following steps: diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md index 2e4c9c024..4488ff5cc 100644 --- a/doc/lightningd-config.5.md +++ b/doc/lightningd-config.5.md @@ -290,6 +290,11 @@ connections; default is not to activate the plugin at all. ### Lightning node customization options +* **recover**=*codex32secret* + + A 32-byte secret encoded as a codex32 secret string. This would be used to construct +`hsm_secret`` in case it doesn't exist. + * **alias**=*NAME* Up to 32 bytes of UTF-8 characters to tag your node. Completely silly, since