Skip to main content

decodescript RPC Method

Decodes a hex-encoded script.

Updated on
Feb 04, 2026

Parameters

hexstring
string
REQUIRED

The hex-encoded script to decode

Returns

result
object

The decoded script object

asm
string

The script public key in the form of string

reqSigs
integer

The required signatures

type
string

The output type (e.g. pubkeyhash)

addresses
array

Array of Bitcoin Cash addresses

p2sh
string

Address of the P2SH script wrapping this redeem script

p2sh_32
string

Address of the P2SH-32 script wrapping this redeem script

error
object | null

JSON-RPC error object when the request failed, or null on success

id
integer

The JSON-RPC request identifier

Request
Response
1
{
2
"result": {
3
"asm": "OP_DUP OP_HASH160 af92ad98c7f77559f96430dfef2a6805b87b24f8 OP_EQUALVERIFY OP_CHECKSIG",
4
"reqSigs": 1,
5
"type": "pubkeyhash",
6
"addresses": [
7
"bitcoincash:qzhe9tvcclmh2k0evscdlme2dqzms7eylqhcjc69c7"
8
],
9
"p2sh": "bitcoincash:pzj0upxsxueh05m4h7plyfawtvc48kap8gwc3celzw",
10
"p2sh_32": "bitcoincash:pdkp09cua608qr454ne30uxu47lfmafwwlfyjqf8vtmu83dfvfvtq9tnmatkk"
11
},
12
"error": null,
13
"id": 1
14
}
1
{
2
"result": {
3
"asm": "OP_DUP OP_HASH160 af92ad98c7f77559f96430dfef2a6805b87b24f8 OP_EQUALVERIFY OP_CHECKSIG",
4
"reqSigs": 1,
5
"type": "pubkeyhash",
6
"addresses": [
7
"bitcoincash:qzhe9tvcclmh2k0evscdlme2dqzms7eylqhcjc69c7"
8
],
9
"p2sh": "bitcoincash:pzj0upxsxueh05m4h7plyfawtvc48kap8gwc3celzw",
10
"p2sh_32": "bitcoincash:pdkp09cua608qr454ne30uxu47lfmafwwlfyjqf8vtmu83dfvfvtq9tnmatkk"
11
},
12
"error": null,
13
"id": 1
14
}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free