Bitcoin
Bitcoin
Bitcoin
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
decodescript takes a hex-encoded Bitcoin script and expands it into human-readable form: the disassembled asm, the inferred script type (such as pubkeyhash, scripthash, or witness_v0_keyhash), the resulting address, and the p2sh address you would get by wrapping the script in pay-to-script-hash. On newer Bitcoin Core it also reports a segwit object describing the script's witness form. It decodes the script bytes directly without spending any BTC or querying the chain. Send the request to the Bitcoin JSON-RPC endpoint at https://bitcoin.therpc.io/YOUR_API_KEY.
scriptPubKey or redeemScript into its address and script type so you can label outputs in an explorer or accounting view.p2sh address that wraps a given redeem script, which is what you fund when spending into a pay-to-script-hash output.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | hexstring | string | Sí | Hex-encoded script to decode. |
| Tipo | Descripción |
|---|---|
| object | asm, type, address (or addresses on older Core), p2sh, and a segwit object for the script's witness form. |
| Código | Mensaje | Causa |
|---|---|---|
-22 | TX decode failed | The hex string is not a valid serialized transaction. |
address field, while older ones returned an addresses[] array. Parse defensively and handle both so your client works regardless of which node version answers.