This guide explains Bitcoin Core decodescript RPC in plain English. It shows what the command does, what its result means and what it cannot prove.
TL;DR
- What it is: Bitcoin Core 0.16.0 decodescript accepted a hex-encoded script and returned an assembly view, normalised hex, classified type, required-signature estimate, possible addresses and a P2SH wrapping address when applicable. It did not execute the script, verify signatures or prove that an address represented the intended policy.
- Why it matters: decodescript helps classify and review script bytes, but it does not establish policy, ownership or spendability. Reliable use keeps the raw script authoritative and proves execution separately under the intended consensus context.
- Current position: Bitcoin Core 0.16.0 decodescript accepted a hex-encoded script and returned an assembly view, normalised hex, classified type, required-signature estimate, possible addresses and a P2SH wrapping address when applicable.
Bitcoin Core decodescript RPC in simple English
Bitcoin Core decodescript RPC: The returned type is a template classification such as pubkey hash, script hash or non-standard. Classification is descriptive, not proof of standard relay or spendability at a particular height.
Simple example
A node operator is checking Bitcoin Core decodescript RPC. Decode the complete policy and test representative satisfaction and failure paths before making custody claims. Validate even-length bounded hex and retain its exact digest before decoding.
Key terms in plain English
- Bitcoin Core:
- Widely used software that validates Bitcoin and can provide wallet, network and operator tools.
- RPC:
- A command that software sends to a node to request information or a local action.
- Consensus:
- The shared rules full nodes use to decide whether blocks and transactions are valid.
- Node:
- A computer running Bitcoin software that checks data and communicates with other peers.
Raw hex is authoritative
Validate even-length bounded hex and retain its exact digest before decoding. Assembly is a human-readable interpretation and can omit byte-level distinctions relevant to non-minimal pushes or unusual encodings. Reviews should compare the original script bytes and parsed opcode stream, not recreate policy solely from displayed assembly text.
Type classification
The returned type is a template classification such as pubkey hash, script hash or non-standard. Classification is descriptive, not proof of standard relay or spendability at a particular height. Unknown or non-standard results require deeper analysis and must not be coerced into a familiar address merely to satisfy application schemas.
Required signatures
reqSigs is an inferred summary for recognised templates, not a universal execution theorem. Bitcoin Script can contain conditionals, timelocks, hashlocks and branches whose actual requirements depend on stack data and consensus context. Decode the complete policy and test representative satisfaction and failure paths before making custody claims.
Address presentation
The addresses array may provide familiar encodings for recognised scripts. An address is derived presentation, while the scriptPubKey or redeem script is the payment condition. Validate network and checksum and compare the exact expected script. Avoid claiming ownership because one address appears in a decoder response.
P2SH wrapper
For a redeem script that is not already P2SH, the historical result can show a p2sh address that would commit to the script. This does not register the script in any wallet, supply private keys or guarantee recovery. Preserve the redeem script and import it through a reviewed watch or spend workflow before funding the wrapper.
No execution or signatures
decodescript does not run the program, apply block-height rules or verify a witness or scriptSig. Use an isolated script harness or regtest spend with exact consensus version for execution claims. Separate descriptive decoding from policy evaluation and from financial approval.
How specialists test it
Operators test the command on a non-production node first. They check a normal reply, an invalid request, a timeout and a restart. This shows what the response means and prevents one local result from being mistaken for a network-wide outcome.
Frequently asked questions
What is the main point of Bitcoin Core decodescript RPC?
Bitcoin Core decodescript RPC: The returned type is a template classification such as pubkey hash, script hash or non-standard.
For Bitcoin Core decodescript RPC, what should a beginner know about raw hex is authoritative?
Validate even-length bounded hex and retain its exact digest before decoding.
For Bitcoin Core decodescript RPC, what should a beginner know about type classification?
The returned type is a template classification such as pubkey hash, script hash or non-standard.
For Bitcoin Core decodescript RPC, what should a beginner know about required signatures?
reqSigs is an inferred summary for recognised templates, not a universal execution theorem.
Conclusion
decodescript helps classify and review script bytes, but it does not establish policy, ownership or spendability. Reliable use keeps the raw script authoritative and proves execution separately under the intended consensus context.
Primary sources
Check the current specification status and the documentation for the exact implementation you operate before moving production funds or changing a mining node.
Join the ASIC Mining Discussion
Members can read and join the discussion
Log in to read comments from other miners. Create a free account if you would like to ask a question or share your experience.
Membership helps us protect the discussion from spam and keep answers useful.