checkmessage

checkmessage -- Command to check if a signature is from a node

SYNOPSIS

checkmessage message zbase [pubkey]

DESCRIPTION

The checkmessage RPC command is the counterpart to signmessage: given a node id (pubkey), signature (zbase) and a message, it verifies that the signature was generated by that node for that message (more technically: by someone who knows that node's secret).

As a special case, 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. Note: this is implemented far more efficiently than trying each one, so performance is not a concern.

  • message (string): Message to be checked against the signature.
  • zbase (string): The Zbase32 encoded signature to verify.
  • pubkey (pubkey, optional): The Zbase32 encoded signature to verify.

RETURN VALUE

On success, an object is returned, containing:

  • verified (boolean) (always true): Whether the signature was valid.
  • pubkey (pubkey): The pubkey parameter, or the pubkey found by looking for known nodes.

ERRORS

On failure, an error is returned and core lightning exit with the following error code:

  • -32602: Parameter missed or malformed;
  • 1301: pubkey not found in the graph.

AUTHOR

Rusty Russell [email protected] is mainly responsible.

SEE ALSO

lightning-signmessage(7)

RESOURCES

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

EXAMPLES

Example 1:

Request:

lightning-cli checkmessage -k "message"="message for you" "zbase"="rnu3qotbr47u7uzgodtq51fraszhp47xfen4yxbzhsisrekqwzshysu7sq4f74g5jobnh35fsh1a3ysoa7who6cqbti47qkxp6w1qwan" "pubkey"="033845802d25b4e074ccfd7cd8b339a41dc75bf9978a034800444b51d42b07799a"
{
  "id": "example:checkmessage#1",
  "method": "checkmessage",
  "params": {
    "message": "message for you",
    "zbase": "rnu3qotbr47u7uzgodtq51fraszhp47xfen4yxbzhsisrekqwzshysu7sq4f74g5jobnh35fsh1a3ysoa7who6cqbti47qkxp6w1qwan",
    "pubkey": "033845802d25b4e074ccfd7cd8b339a41dc75bf9978a034800444b51d42b07799a"
  }
}

Response:

{
  "pubkey": "033845802d25b4e074ccfd7cd8b339a41dc75bf9978a034800444b51d42b07799a",
  "verified": true
}

Example 2:

Request:

lightning-cli checkmessage -k "message"="this is a test!" "zbase"="d63t8j9xmusnx6f6j3tauwoewi1g3a94t9xrastmou8i5rzn3gm9nuahkx6zfnm9ry145w4j88ctteim4mtxc7qreyity55zq63sj6n5"
{
  "id": "example:checkmessage#2",
  "method": "checkmessage",
  "params": {
    "message": "this is a test!",
    "zbase": "d63t8j9xmusnx6f6j3tauwoewi1g3a94t9xrastmou8i5rzn3gm9nuahkx6zfnm9ry145w4j88ctteim4mtxc7qreyity55zq63sj6n5"
  }
}

Response:

{
  "pubkey": "033845802d25b4e074ccfd7cd8b339a41dc75bf9978a034800444b51d42b07799a",
  "verified": true
}

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.