SignMessageWithPrivKey

The signmessagewithprivkey RPC signs a message with a given private key.

Parameter #1—the private key to sign with

Name Type Presence Description
Privat Key string (base58) Required
(exactly 1)
The private key to sign the message with encoded in base58check using wallet import format (WIF)

Parameter #2—the message to sign

Name Type Presence Description
Message string Required
(exactly 1)
The message to sign

Result—the message signature

Name Type Presence Description
result string (base64) Required
(exactly 1)
The signature of the message, encoded in base64.

Example

Sign a the message “Hello, World!” using the following private key:

pai-cli signmessagewithprivkey 5HpHagT65TZzG1PH3CSu63k8DbpvD\
8s5ip4nEB3kEsreKamq6aB "Hello, World!"

Result:

G+ZauMFgQExAJRKZSldbAVEaZo4i0p2AVivbFASo50PkUnynAMDUiNMVdXDlpYMWvatxCmYmLn8C9zygPRn3Y1c=

See also

  • SignMessage: signs a message with the private key of an address.
  • VerifyMessage: verifies a signed message.