LIGHTNING-SIGNMESSAGEWITHKEY(7)

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

πŸ’… LIGHTNING-SIGNMESSAGEWITHKEY β€” the manual, but make it cute

okay bestie so this is lightning-signmessagewithkey, a section 7 manual page, and it's literally the whole guide to one (1) RPC command. we're gonna get you signing things, no cap 🫢


✨ NAME ✨

signmessagewithkey β€” the command that makes a signature using a key from the wallet. that's it, that's the vibe πŸŽ€


🌸 SYNOPSIS 🌸

signmessagewithkey message address

two arguments, in that order, don't @ me πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this command was added in v25.05 (yes, version check, always).

signmessagewithkey creates a digital signature of message using the key associated with the address you hand it. the signature scheme follows the BIP137 specification. iconic behavior honestly πŸ‘‘

here's the deets on the args:

  • message (string): the message you wanna sign, and it has to be less than 65536 characters long. keep it cute, keep it short ✨
  • address (string): a Bitcoin accepted type address, which gets looked up in the list of addresses issued to date. ⚠️ and listen β€” only P2WPKH type addresses are supported. any other type? not happening, bestie πŸ™ˆ

πŸ’– RETURN VALUE πŸ’–

on success you get an object back, and it's giving full receipts:

  • address (string): the bitcoin address that was used for signing.
  • pubkey (pubkey): the public key associated with the bitcoin address you provided.
  • signature (hex): the signature itself.
  • base64 (string): that same signature, encoded in base64. two formats, one icon πŸŽ€

🫢 AUTHOR 🫢

Lagrang3 lagrang3@protonmail.com is mainly responsible. thank you king, we appreciate you πŸ’œ


🌈 SEE ALSO / RESOURCES 🌈


⭐ EXAMPLES ⭐

Example 1 β€” let's go πŸš€

Request:

$ lightning-cli signmessagewithkey -k "message"="a test message" "address"="bcrt1qgrh5vtf63mtayzhxwp480aww3j3qfr5qpq65un"
{
  "id": "example:signmessagewithkey#1",
  "method": "signmessagewithkey",
  "params": {
    "message": "a test message",
    "address": "bcrt1qgrh5vtf63mtayzhxwp480aww3j3qfr5qpq65un"
  }
}

Response:

{
  "address": "bcrt1qgrh5vtf63mtayzhxwp480aww3j3qfr5qpq65un",
  "pubkey": "03bc4a456585ba21ba26af4a0e5399ec76410b2e0ca67db0f3bcb2f47b232fa4b0",
  "signature": "28564edf260a72d991cbb38cf608e293124f8b8f478d13d4544fe27b9d76c65df1284ca395ccdfd3d5f151729ef18f56c028f5f860155d6aa4d0aaaa176a00db01",
  "base64": "KFZO3yYKctmRy7OM9gjikxJPi49HjRPUVE/ie512xl3xKEyjlczf09XxUXKe8Y9WwCj1+GAVXWqk0KqqF2oA2wE="
}

look at that signature. ate and left no crumbs πŸ’€πŸ”₯


and that's the whole page bestie β€” go forth and sign responsibly πŸ’…βœ¨

this lil masterpiece ships with Core Lightning v26.06.9, dated in the footer of the original, and yes the header up top said LIGHTNING-SIGNMESSAGEWITHKEY(7) twice because that's just how manpages roll πŸŽ€ bye ily 🫢

πŸ“¦ where this page comes from