githubEdit

verifymessage - Bitcoin

Example code for the verifymessage JSON-RPC method. Complete guide on how to use verifymessage JSON-RPC in GetBlock Web3 documentation.

This method verifies a signed message.

Parameters

Parameter
Type
Required
Description

address

string

Yes

The Bitcoin address to use for signature verification.

signature

string

Yes

The signature provided by the signer in base64.

message

string

Yes

The message that was signed.

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "verifymessage",
    "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX", "H+F77IaLJXmgS7OBrHr7zq7Wz7WCNmSLRVKr6Q...==", "Hello, World!"],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": true
}

Response Parameters

Field
Type
Description

result

boolean

True if the signature is valid, false otherwise.

Use Case

The verifymessage method is essential for:

  • Proving ownership of Bitcoin addresses

  • Verifying signed agreements or messages

  • Authentication systems using Bitcoin keys

  • Proof of reserve verification

  • Identity verification workflows

  • Building signature verification services

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN.

-3

Invalid address

The provided address is not valid.

-5

Malformed signature

The signature is not in valid base64 format.

Integration With Web3

The verifymessage method helps developers:

  • Build proof-of-ownership systems

  • Implement message authentication

  • Create signature verification services

  • Support identity verification

  • Enable cryptographic proofs

Last updated

Was this helpful?