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
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"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "verifymessage",
"params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX", "H+F77IaLJXmgS7OBrHr7zq7Wz7WCNmSLRVKr6Q...==", "Hello, World!"],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": true
}Response Parameters
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
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?