validateaddress
validateaddress "address" Return information about the given bitcoin address. Arguments: 1. address (string, required) The bitcoin address to validate Result: { (json object) "isvalid" : true|false, (boolean) If the address is valid or not "address" : "str", (string, optional) The bitcoin address validated "scriptPubKey" : "hex", (string, optional) The hex-encoded output script generated by the address "isscript" : true|false, (boolean, optional) If the key is a script "iswitness" : true|false, (boolean, optional) If the address is a witness address "witness_version" : n, (numeric, optional) The version number of the witness program "witness_program" : "hex", (string, optional) The hex value of the witness program "error" : "str", (string, optional) Error message, if any "error_locations" : [ (json array, optional) Indices of likely error locations in address, if known (e.g. Bech32 errors) n, (numeric) index of a potential error ... ] } Examples: > bitcoin-cli validateaddress "bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl" > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "validateaddress", "params": ["bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl"]}' -H 'content-type: application/json' http://127.0.0.1:8332/
Signature
validateaddress(address: string) → any Code samples
curl --user "$RPC_USER:$RPC_PASS" \
--data-binary '{"jsonrpc":"1.0","id":"docs","method":"validateaddress","params":["\"<address>\""]}' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/ Parameters
| Name | Type | Req. | Description |
|---|---|---|---|
| address | string | yes | The bitcoin address to validate |
Result
Type: any
{ (json object) "isvalid" : true|false, (boolean) If the address is valid or not "address" : "str", (string, optional) The bitcoin address validated "scriptPubKey" : "hex", (string, optional) The hex-encoded output script generated by the address "isscript" : true|false, (boolean, optional) If the key is a script "iswitness" : true|false, (boolean, optional) If the address is a witness address "witness_version" : n, (numeric, optional) The version number of the witness program "witness_program" : "hex", (string, optional) The hex value of the witness program "error" : "str", (string, optional) Error message, if any "error_locations" : [ (json array, optional) Indices of likely error locations in address, if known (e.g. Bech32 errors) n, (numeric) index of a potential error ... ] }
Source: services/core-node/bcore/src/rpc/output_script.cpp:28
C++ symbol: validateaddress