{"uid":"cap_7gxHibtkM3enXxUhdLpix","slug":"bitcoin-script-decode-72901249","name":"Bitcoin Script Decode","description":"Decode a Bitcoin script from hex (scriptPubKey, redeem or witness script): type, asm, descriptor, address, and the P2SH and P2WSH addresses that wrap it (Bitcoin Core decodescript).","url":"https://diamond.btc-intel.workers.dev/api/x402/script_decode?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["script"],"properties":{"script":{"type":"string","maxLength":20000,"description":"A Bitcoin script as hex"}},"additionalProperties":false}},"additionalProperties":false}}},"responseSchema":{"type":"json","example":{"asm":"0 751e76e8199196d454941c45d1b3a323f1433bd6","type":"witness_v0_keyhash","as_of":"2026-11-07T18:00:00Z","address":"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4","product":"script_decode","type_short":"p2wpkh"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_xtsnn3_bC7zNaPAhiMqVe","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Decodes a raw Bitcoin script (hex) into its assembly representation, type, and associated address","exampleAgentPrompt":"Can you decode this Bitcoin script hex for me — 0014751e76e8199196d454941c45d1b3a323f1433bd6 — and tell me what type it is and what address it corresponds to?","exampleUseCases":[{"title":"Identify address from UTXO script","prompt":"I pulled a raw scriptPubKey from a Bitcoin UTXO — it's 76a914751e76e8199196d454941c45d1b3a323f1433bd688ac — can you decode it and tell me which Bitcoin address it locks funds to?"},{"title":"Classify script type for wallet audit","prompt":"I'm auditing a set of Bitcoin transaction outputs and need to know the script types. Decode this hex script for me: 0014751e76e8199196d454941c45d1b3a323f1433bd6 — is it P2WPKH, P2SH, P2PKH, or something else?"},{"title":"Reverse-engineer address from raw blockchain data","prompt":"I have a raw Bitcoin script in hex that I extracted from a block explorer: a9148f55563b9a19f321c211e9b9f38cdf686ea0784487 — decode it into ASM and give me the corresponding Bitcoin address."}],"resultDescription":"Returns a JSON object containing the decoded script in ASM notation, the detected script type (e.g. witness_v0_keyhash), a short type label (e.g. p2wpkh), the derived Bitcoin address, and a UTC timestamp indicating when the response was generated.","failureModes":["Invalid or malformed hex string returns an error response","Script hex exceeding 20000 characters is rejected by input validation","Unrecognized or non-standard script types may not produce a decoded address","Missing required 'script' query parameter returns a bad request error","Network or worker-side errors may return 5xx responses"],"whenToPreferThis":"Use this endpoint when you have a raw Bitcoin script in hex format and need to convert it into human-readable ASM, determine the script type (P2PKH, P2WPKH, P2SH, etc.), or derive the associated Bitcoin address. It is ideal for wallet developers, blockchain analysts, and transaction auditors who encounter raw scriptPubKey or scriptSig data and need quick, pay-per-call decoding without setting up an account or running a full Bitcoin node.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:35:25.620Z","isFirstParty":false,"canonicalSlug":"bitcoin-script-decode-72901249"}