Getaddressinfo

getaddressinfo "address"


Return information about the given bitcoin address.
Some of the information will only be present if the address is in the active wallet.

Arguments:
1. address    (string, required) The bitcoin address for which to get information.

Result:
{
  "address" : "address",              (string) The bitcoin address validated.
  "scriptPubKey" : "hex",             (string) The hex-encoded scriptPubKey generated by the address.
  "ismine" : true|false,              (boolean) If the address is yours.
  "iswatchonly" : true|false,         (boolean) If the address is watchonly.
  "solvable" : true|false,            (boolean) If we know how to spend coins sent to this address, ignoring the possible lack of private keys.
  "desc" : "desc",                    (string, optional) A descriptor for spending coins sent to this address (only when solvable).
  "isscript" : true|false,            (boolean) If the key is a script.
  "ischange" : true|false,            (boolean) If the address was used for change output.
  "script" : "type"                   (string, optional) The output script type. Only if isscript is true and the redeemscript is known. Possible
                                                         types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata
  "hex" : "hex",                      (string, optional) The redeemscript for the p2sh address.
  "pubkeys"                           (array, optional) Array of pubkeys associated with the known redeemscript (only if script is multisig).
    [
      "pubkey" (string)
      ,...
    ]
  "sigsrequired" : xxxxx              (numeric, optional) The number of signatures required to spend multisig output (only if script is multisig).
  "pubkey" : "publickeyhex",          (string, optional) The hex value of the raw public key for single-key addresses (possibly embedded in P2SH).
  "embedded" : {...},                 (object, optional) Information about the address embedded in P2SH, if relevant and known. Includes all
                                                         getaddressinfo output fields for the embedded address, excluding metadata (timestamp, hdkeypath,
                                                         hdseedid) and relation to the wallet (ismine, iswatchonly).
  "iscompressed" : true|false,        (boolean, optional) If the pubkey is compressed.
  "label" :  "label"                  (string) The label associated with the address. Defaults to "". Equivalent to the label name in the labels array below.
  "timestamp" : timestamp,            (number, optional) The creation time of the key, if available, expressed in UNIX epoch time.
  "hdkeypath" : "keypath"             (string, optional) The HD keypath, if the key is HD and available.
  "hdseedid" : "<hash160>"            (string, optional) The Hash160 of the HD seed.
  "hdmasterfingerprint" : "<hash160>" (string, optional) The fingerprint of the master key.
  "labels"                            (json object) An array of labels associated with the address. Currently limited to one label but returned
                                               as an array to keep the API stable if multiple labels are enabled in the future.
    [
      "label name" (string) The label name. Defaults to "". Equivalent to the label field above.

      DEPRECATED, will be removed in a future version. To re-enable, launch bitcoind with `-deprecatedrpc=labelspurpose`:
      { (json object of label data)
        "name" : "label name" (string) The label name. Defaults to "". Equivalent to the label field above.
        "purpose" : "purpose" (string) The purpose of the associated address (send or receive).
      },...
    ]
}

Examples:
> bitcoin-cli getaddressinfo "qrmzys48glkpevp2l4t24jtcltc9hyzx9cep2qffm4"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressinfo", "params": ["qrmzys48glkpevp2l4t24jtcltc9hyzx9cep2qffm4"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/