# Bitcoin Transaction Decoder

> Bitcoin Transaction Decoder is a paid API for AI agents from diamond.btc-intel.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-11-19).

Decodes a raw Bitcoin transaction hex string into structured fields including txid, wtxid, size, vsize, weight, inputs, outputs with addresses and values, and SegWit/RBF flags — without broadcasting it.

## Facts

- Endpoint: GET https://diamond.btc-intel.workers.dev/api/x402/decode_tx?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bitcoin-transaction-decoder-9d9c0d42
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4h9kLHYy4KqqUbMjq9Zmi

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 bitcoin-transaction-decoder-9d9c0d42
```

Example prompt: Can you decode this raw Bitcoin transaction hex for me and tell me the txid, vsize, all output addresses and amounts, and whether it signals RBF or uses SegWit? Here's the hex: 0200000001abcd...

## When to prefer this

Use this endpoint when you need to decode and inspect the contents of a raw Bitcoin transaction before broadcasting, signing, or auditing it. It is ideal for offline analysis, compliance checks, verification of transaction structure, or extracting txid/addresses without touching the Bitcoin network. Prefer this over block explorer lookups when the transaction is not yet broadcast or when you need structured JSON output with SegWit and RBF flags explicitly surfaced.

## Known failure modes

- Invalid or malformed hex string returns an error response
- Truncated transaction hex causes parsing failure
- Non-Bitcoin hex data (e.g. Ethereum transaction) returns a decode error
- Hex string exceeding 200,000 character limit is rejected
- Empty or missing 'hex' query parameter returns a 400-level error

## How this service works

Decode a raw Bitcoin transaction (hex): txid, wtxid, size, vsize, weight, inputs, outputs with addresses and values, SegWit and RBF flags. Nothing is broadcast.

## Output

Returns a JSON object containing the txid, wtxid, byte size, vsize, weight, list of inputs, list of outputs (each with index, BTC value, script type, and address), a boolean for SegWit, and a boolean for RBF signaling. Nothing is broadcast to the network.

## Request schema (JSON Schema)

```json
{
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "hex"
     ],
     "properties": {
      "hex": {
       "type": "string",
       "maxLength": 200000,
       "description": "Raw transaction as hex"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "txid": "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
  "vsize": 141,
  "segwit": true,
  "outputs": [
   {
    "n": 0,
    "btc": 0.001,
    "type": "witness_v0_keyhash",
    "address": "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"
   }
  ],
  "product": "decoded_transaction",
  "rbf_signaled": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitcoin-transaction-decoder-9d9c0d42/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from diamond.btc-intel.workers.dev](https://www.zero.xyz/host/diamond.btc-intel.workers.dev/llms.txt)
