LIGHTNING-MAKESECRET(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’… 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 of hex or string must be specified. hex can be any hex data. any of it. go off πŸ’œ
  • string (string, optional) β€” one of hex or string must be specified. string is 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 from HSM_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 the commando thing. 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