signmessagewithkey -- Command to create a signature using a key from the wallet
SYNOPSIS
signmessagewithkey message address
DESCRIPTION
Command added in v25.05.
The signmessagewithkey RPC command creates a digital signature of message using the key associated with the address provided in the input.
The signature scheme follows the BIP137 specification.
- message (string): Less than 65536 characters long message to be signed by the node.
- address (string): A Bitcoin accepted type address for lookup in the list of addresses issued to date.
Only P2WPKH type addresses are supported
RETURN VALUE
On success, an object is returned, containing:
- address (string): The bitcoin address used for signing.
- pubkey (pubkey): The public key associated with the bitcoin address provided.
- signature (hex): The signature.
- base64 (string): The signature encoded in base64.
AUTHOR
Lagrang3 [email protected] is mainly responsible.
SEE ALSO
RESOURCES
Main web site: https://github.com/ElementsProject/lightning
EXAMPLES
Example 1:
Request:
lightning-cli signmessagewithkey -k "message"="signing this message with key" "address"="bcrt1qzpr5cu5tfrcegrfzkusqyt6nj5tfx7qeqpdd4n"{
"id": "example:signmessagewithkey#1",
"method": "signmessagewithkey",
"params": {
"message": "signing this message with key",
"address": "bcrt1qzpr5cu5tfrcegrfzkusqyt6nj5tfx7qeqpdd4n"
}
}Response:
{
"address": "bcrt1qzpr5cu5tfrcegrfzkusqyt6nj5tfx7qeqpdd4n",
"pubkey": "03128eb6d21daf33c92e6eeac1b06f4a520345a144498d93c24ea9c9ba7b223372",
"signature": "28459b23d091bbdc2f0e288b86a5702e922449cec85d957e0603a5aaea3a32af430235a23d65fbc54036d383ae8e08da89dd234f676e7d5de6badc296ad99008cb",
"base64": "KEWbI9CRu9wvDiiLhqVwLpIkSc7IXZV+BgOlquo6Mq9DAjWiPWX7xUA204Oujgjaid0jT2dufV3mutwpatmQCMs="
}