validateaddress - Litecoin

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

Return information about the given litecoin address.

Parameters

Parameter
Type
Description

address

string

The litecoin address to validate.

Request

cURL
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "validateaddress",
    "params": ["LTC1address..."],
    "id": "getblock.io"
}'

Response

response.json
{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "isvalid": true,
        "address": "LTC1address...",
        "scriptPubKey": "76a914...",
        "isscript": false,
        "iswitness": true,
        "witness_version": 0,
        "witness_program": "..."
    }
}

Response Parameters

Field
Type
Description

isvalid

boolean

If the address is valid.

address

string

The address validated.

isscript

boolean

If the address is a script address.

iswitness

boolean

If the address is a witness address.

Use Cases

The validateaddress method is essential for:

  • Address validation

  • Payment verification

  • Wallet functionality

  • User input validation

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN.

Integration Notes

The validateaddress method helps developers build robust applications that interact with the Litecoin blockchain.

Last updated

Was this helpful?