LIGHTNING-MAKESECRET(7)
π LIGHTNING-MAKESECRET(7) π
ok so bestie, welcome to LIGHTNING-MAKESECRET(7) β the manual page for the makesecret command. it's short, it's sweet, and it's literally about pulling secret keys out of your HSM. let's get into it π
β¨ NAME β¨
makesecret β the command for deriving a pseudorandom key from the HSM, no cap π
πΈ SYNOPSIS πΈ
makesecret [hex] [string]
that's it. that's the whole vibe check. two optional args, both vibing in square brackets π¦
π DESCRIPTION π
okay so the makesecret RPC command derives a secret key from the HSM_secret. that's the whole assignment. it takes your HSM secret and deterministically produces a pseudorandom key from it, which is genuinely iconic behavior π§
but β and this is the important part, bestie, do NOT skip this β the value commando (whether you pass it as a string, or as the same bytes expressed in hex) is reserved. it derives the secret behind the node's runes, so it is refused. the command will just say no. it's giving "not you, blocked" π
here's the argument situation:
hex(hex, optional) β one ofhexorstringmust be specified.hexcan be any hex data. any of it. go off πstring(string, optional) β one ofhexorstringmust be specified.stringis a UTF-8 string interpreted literally. like, literally literally. no cleverness, no parsing, just the bytes you handed it πΈ
fr fr remember: exactly one of the two is required. you can't skip both, don't try it π
π RETURN VALUE π
on success, you get an object back, containing:
secret(secret) β the pseudorandom key derived fromHSM_secret. the main character of the response β¨
π ERRORS π
these are the error codes that may occur, and yeah, they're allowed to happen:
-1β catchall nonspecific error. the "something went wrong but we're not gonna elaborate" of errors π-32602β the requested value is reserved for internal use. this is the one that fires when you try thecommandothing. it said what it said π«
π«Ά AUTHOR π«Ά
Aditya aditya.sharma20111@gmail.com is mainly responsible. give them their flowers π
π RESOURCES π
main web site: https://github.com/ElementsProject/lightning β go explore, it's a whole world π¦
π EXAMPLES π
example 1 π
request:
$ lightning-cli makesecret "73636220736563726574"
{
"id": "example:makesecret#1",
"method": "makesecret",
"params": [
"73636220736563726574"
]
}
response:
{
"secret": "82d3e65651ac89124448cb88b5f4cd009f6c321f58ada0fca6e9e3f2d1c5889e"
}
example 2 πΈ
request:
$ lightning-cli makesecret -k "string"="scb secret"
{
"id": "example:makesecret#2",
"method": "makesecret",
"params": {
"string": "scb secret"
}
}
response:
{
"secret": "82d3e65651ac89124448cb88b5f4cd009f6c321f58ada0fca6e9e3f2d1c5889e"
}
notice both examples land on the exact same secret? that's not a typo, that's just what the page says. it's giving deterministic and we're obsessed π
β¨
and that's the whole page bestie, you ate it up π
this lil sign-off is from the footer, btw: Core Lightning v26.06.9, sittin' pretty next to the LIGHTNING-MAKESECRET(7) header up top β so you always know which version of the vibe you're reading. mwah π«Ά
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms