LIGHTNING-CHECKMESSAGE(7)

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

πŸ’… LIGHTNING-CHECKMESSAGE(7) β€” checkmessage

okay so bestie, welcome to lightning-checkmessage, one of the pages in the Core Lightning manual set (that's the LIGHTNING-CHECKMESSAGE(7) bit, iykyk) πŸ’– this one's short, sweet, and honestly kind of iconic β€” it's the vibe check for signatures ✨


🌸 NAME 🌸

checkmessage β€” the command that checks whether a signature actually came from a given node πŸ•΅οΈβ€β™€οΈπŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

checkmessage message zbase [pubkey]

that's it. three little slots. slay. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so checkmessage is the RPC command that's the literal counterpart to signmessage πŸ’« here's the tea: you hand it a node id (pubkey), a signature (zbase), and a message, and it verifies that the signature was generated by that node for that message. and if we're being technical about it (we are, bestie, this is a manpage): by someone who knows that node's secret πŸ”πŸ‘‘

special case alert 🚨 β€” if pubkey is not specified, we will try every known node key (as per listnodes), and verification succeeds if it matches for any one of them. and no cap, this is implemented far more efficiently than trying each one, so performance is not a concern πŸ’¨βœ¨ like she did the math so you don't have to.

  • message (string) β€” the message to be checked against the signature πŸ“
  • zbase (string) β€” the Zbase32 encoded signature to verify πŸ”
  • pubkey (pubkey, optional) β€” the Zbase32 encoded signature to verify πŸ‘€ (yes, that's what it says, we're reporting it faithfully, don't come for me πŸ™ˆ)

πŸ‘‘ RETURN VALUE πŸ‘‘

on success, you get an object back, containing:

  • verified (boolean) (always true) β€” whether the signature was valid βœ… (and it's always true here, because if it weren't, you'd be in the ERRORS section instead, bestie)
  • pubkey (pubkey) β€” the pubkey parameter, or the pubkey found by looking for known nodes 🎯

πŸ’€ ERRORS πŸ’€

on failure, an error is returned and core lightning exits with the following error code:

  • -32602 β€” parameter missed or malformed 🫠
  • 1301 β€” pubkey not found in the graph 😭
ngl, -32602 is giving "you forgot an argument, diva" and 1301 is giving "who is she? never heard of her" πŸ’…

✨ AUTHOR ✨

Rusty Russell rusty@rustcorp.com.au is mainly responsible πŸ«‘πŸ‘‘ honestly? legend behaviour.


🌈 SEE ALSO 🌈

lightning-signmessage(7) β€” the other half of this duo, go read it, it's the main character to this one's love interest πŸ₯°


⭐ RESOURCES ⭐

main web site: https://github.com/ElementsProject/lightning β€” go snoop, it's fine πŸ§šβ€β™€οΈ


πŸ“ EXAMPLES πŸ“

Example 1

request:

$ lightning-cli checkmessage -k "message"="testcase to check new rpc error" "zbase"="d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx" "pubkey"="03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7"

{
  "id": "example:checkmessage#1",
  "method": "checkmessage",
  "params": {
    "message": "testcase to check new rpc error",
    "zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx",
    "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7"
  }
}

response:

{
  "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7",
  "verified": true
}

look at her go, verified: true, we love a confirmed queen πŸ’–βœ¨


Example 2

request:

$ lightning-cli checkmessage -k "message"="this is a test!" "zbase"="d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7"

{
  "id": "example:checkmessage#2",
  "method": "checkmessage",
  "params": {
    "message": "this is a test!",
    "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7"
  }
}

response:

{
  "pubkey": "nodeid010101010101010101010101010101010101010101010101010101010101",
  "verified": true
}

see how there's no pubkey in the request? that's the special case in action, she went and found the node herself, main character energy fr fr πŸ•΅οΈβ€β™€οΈπŸ’…


and that's the whole page, bestie β€” go forth and verify some signatures πŸ’œ

this has been Core Lightning v26.06.9, LIGHTNING-CHECKMESSAGE(7) β€” mwah, catch you in the next manpage πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from