Skip to main content

verifymessage

Command#

pacprotocol-cli verifymessage "address" "signature" "message"

Verify a signed message

Arguments#

address *#

(string, required)

The PAC address to use for the signature.

signature *#

(string, required)

The signature provided by the signer in base 64 encoding (see signmessage).

message *#

(string, required)

The message that was signed.

Examples#

Unlock the wallet for 30 seconds

pacprotocol-cli walletpassphrase "mypassphrase" 30

Create the signature

pacprotocol-cli signmessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG" "my message"

Verify the signature

pacprotocol-cli verifymessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG" "signature" "my message"

As json rpc

curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifymessage", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG", "signature", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:1111/

Result#

true|false #(boolean) If the signature is verified or not.

Running following help command

pacprotocol-cli help verifymessage

Will produce following output:

verifymessage "address" "signature" "message"
Verify a signed message
Arguments:
1. "address" (string, required) The PAC address to use for the signature.
2. "signature" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).
3. "message" (string, required) The message that was signed.
Result:
true|false (boolean) If the signature is verified or not.
Examples:
Unlock the wallet for 30 seconds
> pacprotocol-cli walletpassphrase "mypassphrase" 30
Create the signature
> pacprotocol-cli signmessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG" "my message"
Verify the signature
> pacprotocol-cli verifymessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG" "signature" "my message"
As json rpc
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifymessage", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwG", "signature", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:1111/