decodescript
POST
Decodes a hex-encoded script and returns it as a JSON object.It lets you inspect the output type, the corresponding address, and the addresses of the P2SH and SegWit wrappings.
param[0]
hexstringstringrequired
The hex string of the script to decode.Responses
asmstring
Disassembly of the script.descstring
Inferred descriptor for the script.typestring
The output type. Returns one of nonstandard, anchor, pubkey, pubkeyhash, scripthash, multisig, nulldata,witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot or witness_unknown.addressstring
The Bitcoin address for the script. Returned only when a well-defined address exists.p2shstring
The address of the P2SH script wrapping this redeem script. Not returned for types that should not be wrapped.The result of a witness output script wrapping this redeem script.Not returned for types that should not be wrapped.
asmstring
Disassembly of the output script.hexstring
The raw output script bytes, hex-encoded.typestring
The type of the output script.addressstring
The corresponding Bitcoin address. Returned only when a well-defined address exists.descstring
Inferred descriptor for the script.p2sh-segwitstring
The address of the P2SH script wrapping this witness redeem script.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": "decodescript","params": ["00143123f9ba48c9a80f4e7f7ea6a7d5028a9c0018a2"]}'