exposesecret

exposesecret -- Command for extracting the hsm_secret file for backup

SYNOPSIS

exposesecret passphrase [identifier]

DESCRIPTION

Command added in v24.11.

The exposesecret RPC command allows you to read the HSM secret, and does not work with encrypted hsm secrets. It only operates if the exposesecret-passphrase has been set in the configuration.

  • passphrase (string): The passphrase, which must match the exposesecret-passphrase configuration parameter.
  • identifier (string, optional): A four-character, valid lowercase bech32 string (not 1, i, o or b) to use in the resulting BIP-93 output. If not specified, this is generated from the node alias.

RETURN VALUE

On success, an object is returned, containing:

  • identifier (string): The four-character identifier used in the codex32 output. Redundant, but presented separately for clarity.
  • codex32 (string): The full codex32-encoded (i.e. BIP-93 encoded) HSM secret.
  • mnemonic (string, optional): The BIP39 mnemonic phrase for the HSM secret (only present for mnemonic-based secrets). (added v25.12)

AUTHOR

Rusty Russell [email protected] is mainly responsible.

SEE ALSO

lightning-hsmtool(8)

RESOURCES

Main web site: https://github.com/ElementsProject/lightning

EXAMPLES

Example 1:

Request:

lightning-cli exposesecret -k "passphrase"="test_exposesecret"
{
  "id": "example:exposesecret#1",
  "method": "exposesecret",
  "params": {
    "passphrase": "test_exposesecret"
  }
}

Response:

{
  "identifier": "slmy",
  "codex32": "cl10slmyszjm0t54d79dyeccpryq6wap5tnm7f7sjhx8fy2mtgtmdghvccp4ss0tl6ap64mhl2",
  "mnemonic": "hockey enroll sure trip track rescue original plate credit abandon abandon account"
}

Example 2:

Request:

lightning-cli exposesecret "test_exposesecret" "cln2"
{
  "id": "example:exposesecret#2",
  "method": "exposesecret",
  "params": [
    "test_exposesecret",
    "cln2"
  ]
}

Response:

{
  "identifier": "cln2",
  "codex32": "cl10cln2szjm0t54d79dyeccpryq6wap5tnm7f7sjhx8fy2mtgtmdghvccp4swftsqcue6jgqt",
  "mnemonic": "hockey enroll sure trip track rescue original plate credit abandon abandon account"
}

Core Lightning is Blockstream's open-source implementation of the Lightning Network optimised for performance. It is highly customizable through modular expandability.

© 2026 Core Lightning, a Blockstream project.
All rights reserved.

X Twitter Logo Streamline Icon: https://streamlinehq.com

X

The official Core Lightning X(Twitter) handle to follow project updates and announcements.

Github Logo 2 Streamline Icon: https://streamlinehq.com

Github

Github repository for source code, issues, and contributions. Visit our project here to explore or contibute.

Telegram

Community-driven telegram group where most of the node operators hang out. Go to https://t.me/lightningd to join.

Discord

Community-driven discord server where the devs flock together. Go to https://discord.gg/V6ay9yNhBQ to join.