Skip to main content

validateaddress

POST

Validates the given Bitcoin address and returns the information derived from it.Only the isvalid field is returned when the address is invalid.
param[0]
addressstringrequired
The Bitcoin address to validate.
Responses
isvalidboolean
Whether the address is valid.
addressstring
The Bitcoin address that was validated. Returned only when the address is valid.
scriptPubKeystring
The hex-encoded output script generated by the address. Returned only when the address is valid.
isscriptboolean
Whether the key is a script. Returned only when the address is valid.
iswitnessboolean
Whether the address is a witness address. Returned only when the address is valid.
witness_versioninteger
The version number of the witness program. Returned only for witness addresses.
witness_programstring
The hex value of the witness program. Returned only for witness addresses.
errorstring
The reason the address is invalid. Returned only when an error occurred.
error_locationsarray
Indices of likely error locations in the address string.Returned only when the locations can be identified, such as for Bech32 errors.
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://bitcoin-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "validateaddress",
"params": [
"bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
]
}'