# chainquery Bitcoin decodescript RPC

> chainquery Bitcoin decodescript RPC is a paid API for AI agents from x402.chainquery.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Decodes a Bitcoin hex-encoded script into its assembly representation, type classification, and associated addresses

## Facts

- Endpoint: GET https://x402.chainquery.com/v1/rpc/decodescript
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chainquery-bitcoin-decodescript-rpc-20bd2d1d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_p40uOGcMtqBjNToFb71nc

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability chainquery-bitcoin-decodescript-rpc-20bd2d1d
```

Example prompt: Can you decode this Bitcoin script hex for me and tell me its type, assembly, and any addresses it encodes: 76a914abc123def456abc123def456abc123def456abc12388ac?

## When to prefer this

Use this endpoint when you need to decode and understand a raw Bitcoin script hex string without managing your own Bitcoin Core node or obtaining an API key. Ideal for agents that need on-demand, pay-per-call script analysis as part of transaction inspection workflows.

## Known failure modes

- Invalid hex string returns an RPC error from Bitcoin Core
- Malformed params JSON causes a 400 bad request
- Payment not included or insufficient triggers an HTTP 402 response requiring x402 payment
- Empty or missing script param returns a Bitcoin Core parameter error

## How this service works

chainquery Bitcoin RPC: pay-per-call Bitcoin Core over x402, no API key. Decode a hex script into its assembly, type, and addresses. Bitcoin Core decodescript.

## Output

Returns a Bitcoin Core decodescript result object containing the ASM disassembly of the script, the script type (e.g. pubkeyhash, scripthash, multisig, nulldata), any Bitcoin addresses embedded in the script, the number of required signatures, and the equivalent P2SH address if applicable.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "params": "[\"76a914abc123def456abc123def456abc123def456abc12388ac\"]"
  }
 },
 "output": {
  "type": "object"
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "params": {
       "type": "string",
       "description": "optional: JSON-encoded array of positional RPC params"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "result": {
       "description": "decodescript result"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chainquery-bitcoin-decodescript-rpc-20bd2d1d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.chainquery.com](https://www.zero.xyz/host/x402.chainquery.com/llms.txt)
