Skip to main content

decodescript RPC Method

Decodes a hex-encoded script.

Updated on
Oct 4, 2023

decodescript RPC Method

Parameters

hexstring
string
REQUIRED
The hex-encoded script

Returns

asm
The script public key in the form of string
type
The output type. This can be any one of the following: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_scripthash, witness_v0_keyhash, witness_v1_taproot or witness_unknown
reqSigs
The required signatures
addresses
A JSON array of addresses used in the transaction
str
The bitcoin address
p2sh
An address of the P2SH script wrapping this redeem script (not returned if the script is already a P2SH)
segwit
The result of a witness script public key wrapping this redeem script (not returned if the script is a P2SH or witness)
asm
The script public key in the form of string
hex
The hex of the script's public key in string format
type
The type of the script public key
reqSigs
The required signatures
addresses
JSON array of addresses
str
The segwit address
p2sh-segwit
An address of the P2SH script wrapping this witness redeem script
Request
1
curl https://docs-demo.btc.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{"method": "decodescript", "params": ["76a914af92ad98c7f77559f96430dfef2a6805b87b24f888ac"]}'
5
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free