当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Bitcoin validateaddress用法及代码示例


比特币(Bitcoin) RPC Util API中validateaddress的用法及代码示例。

用法:

validateaddress "address"

返回有关给定比特币地址的信息。

参数1 - address

类型:字符串,必填

验证的比特币地址

返回结果

{
  "isvalid" : true|false,       (boolean) If the address is valid or not. If not, this is the only property returned.
  "address" : "address",        (string) The bitcoin address validated
  "scriptPubKey" : "hex",       (string) The hex-encoded scriptPubKey generated by the address
  "isscript" : true|false,      (boolean) If the key is a script
  "iswitness" : true|false,     (boolean) If the address is a witness address
  "witness_version" : version   (numeric, optional) The version number of the witness program
  "witness_program" : "hex"     (string, optional) The hex value of the witness program
}

示例

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

相关用法


注:本文由纯净天空筛选整理自bitcoin.org大神的英文原创作品 Bitcoin validateaddress。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。