LIGHTNING-SIGNINVOICE(7)

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

🌸 NAME 🌸

okay so this page is all about lightning-signinvoice(7) β€” literally low-level invoice signing πŸ’… it's the deep-lore manpage bestie, and it's here to explain signinvoice in full ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

signinvoice invstring

πŸ’œ DESCRIPTION πŸ’œ

so this command got added in v23.02 β€” vintage-ish but still serving πŸŽ€

the signinvoice RPC command signs an invoice. and here's the part where it's not like createinvoice, bestie: it does not save the invoice into the database, and because of that it does not require the preimage. no preimage, no storage, no problem πŸ’…

  • invstring (string) β€” Bolt11 form, but the final signature is ignored. and lowkey only minimal sanity checks are done on it, so don't expect a full vibe check 😭

⭐ RETURN VALUE ⭐

when it works? you get an object back, containing:

  • bolt11 (string) β€” The bolt11 string. that's it, that's the whole payload 🫢

πŸ’€ ERRORS πŸ’€

these error codes may show up:

  • -1 β€” Catchall nonspecific error. yep, the classic "something happened, don't ask me what" πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

Carl Dong contact@carldong.me is mainly responsible. main character energy fr fr 🌈


πŸ”₯ SEE ALSO πŸ”₯


🌈 RESOURCES 🌈

Main web site: https://github.com/ElementsProject/lightning β€” go be nosy, iykyk πŸ¦‹


πŸ“ EXAMPLES πŸ“

✨ Example 1 ✨

Request:

$ lightning-cli signinvoice -k "invstring"="lnbcrt100n1pnt2bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000"

{
  "id": "example:signinvoice#1",
  "method": "signinvoice",
  "params": {
    "invstring": "lnbcrt100n1pnt2bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000"
  }
}

Response:

{
  "bolt11": "lnbcrt100n1pnt2bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000"
}

πŸ’– Example 2 πŸ’–

Request:

$ lightning-cli signinvoice "lnbcrt100n1pnt2bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000"

{
  "id": "example:signinvoice#2",
  "method": "signinvoice",
  "params": [
    "lnbcrt100n1pnt2bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000"
  ]
}

Response:

{
  "bolt11": "lnbcrt100n1pnt2bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000"
}

ngl those bolt11 strings are long long, but that's the whole point β€” sign it, hand it back, no database drama πŸ’…

and that's the page!! this lil fairy godmother of a manpage is from Core Lightning v26.06.9, LIGHTNING-SIGNINVOICE(7), mwah πŸ’‹ slay, go sign some invoices πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from