verifymessage - Dogecoin

This method verifies a signed message.

  • Returns true if the signature is valid for the address and message.
  • Returns false if the signature is invalid.
  • Does not require the private key (public verification only).
  • Compatible with signatures from signmessage.

Parameters

ParameterTypeRequiredDescription
addressstringYesThe Dogecoin address that signed the message.
signaturestringYesThe base64-encoded signature.
messagestringYesThe original message that was signed.

Request

cURL

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "verifymessage",
    "params": ["DLGbK6mCjBT67r8wjJqCg8hkFiBYV5JquH", "H1b2c3d4e5f6g7h8i9j0...", "Hello, Dogecoin!"],
    "id": "getblock.io"
}'

verifymessage.js

javascriptconst axios = require('axios');

const data = JSON.stringify({
    "jsonrpc": "2.0",
    "method": "verifymessage",
    "params": ["DLGbK6mCjBT67r8wjJqCg8hkFiBYV5JquH", "H1b2c3d4e5f6g7h8i9j0...", "Hello, Dogecoin!"],
    "id": "getblock.io"
});

const config = {
    method: 'post',
    url: 'https://shared.eu-central-1.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));

verifymessage.py

pythonimport requests
import json

url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"

payload = json.dumps({
    "jsonrpc": "2.0",
    "method": "verifymessage",
    "params": ["DLGbK6mCjBT67r8wjJqCg8hkFiBYV5JquH", "H1b2c3d4e5f6g7h8i9j0...", "Hello, Dogecoin!"],
    "id": "getblock.io"
})

headers = {
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)

verifymessage.rs

rustuse reqwest::header;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    
    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header(header::CONTENT_TYPE, "application/json")
        .body(r#"{
            "jsonrpc": "2.0",
            "method": "verifymessage",
            "params": ["DLGbK6mCjBT67r8wjJqCg8hkFiBYV5JquH", "signature", "Hello, Dogecoin!"],
            "id": "getblock.io"
        }"#)
        .send()
        .await?;
    
    println!("{}", response.text().await?);
    Ok(())
}

Response

response.json

json{
    "result": true,
    "error": null,
    "id": "getblock.io"
}

Response Parameters

FieldTypeDescription
resultbooleanTrue if signature is valid, false otherwise.
errornullError object (null if no error).
idstringRequest identifier.

Use Case

The verifymessage method is essential for:

  • Verifying address ownership proofs
  • Authentication validation
  • Signature verification
  • Trust verification systems
  • Proof of identity checks

Error Handling

Error CodeMessageCause
-3Invalid addressInvalid Dogecoin address.
-5Malformed signatureInvalid base64 signature.
403ForbiddenMissing or invalid ACCESS-TOKEN.