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


Bitcoin decodescript用法及代码示例


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

用法:

decodescript "hexstring"

解码一个hex-encoded脚本。

参数1 - hexstring

类型:字符串,必填

hex-encoded脚本

返回结果

{
  "asm":"asm",   (string) Script public key
  "hex":"hex",   (string) hex-encoded public key
  "type":"type", (string) The output type
  "reqSigs": n,    (numeric) The required signatures
  "addresses": [   (json array of string)
     "address"     (string) bitcoin address
     ,...
  ],
  "p2sh","address" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).
}

示例

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

相关用法


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