# BTC Tx Toolkit – Transaction Decoder

> BTC Tx Toolkit – Transaction Decoder is a paid API for AI agents from btc-tx-toolkit.stackstats.workers.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-12).

Decodes a raw Bitcoin transaction hex string into structured fields including outputs, addresses, values, vsize, SegWit status, and RBF signaling

## Facts

- Endpoint: POST https://btc-tx-toolkit.stackstats.workers.dev/tx/decode?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/btc-tx-toolkit-transaction-decoder-e758f8d9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_fzGnITyQgzbRag6Gq7GtL

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 btc-tx-toolkit-transaction-decoder-e758f8d9 -d '<json body>'
```

Example prompt: Can you decode this raw Bitcoin transaction hex for me and tell me the outputs, addresses, values in satoshis, vsize, and whether it signals RBF? Hex: 0200000001...abcd (mainnet).

## When to prefer this

Choose this endpoint when you need to inspect, audit, or analyze a raw Bitcoin transaction hex offline without broadcasting it. It is ideal for read-only analysis where privacy matters (nothing is logged or stored), and when you need structured output including output types, SegWit status, RBF signaling, and vsize. Prefer it over blockchain explorer APIs when you have the raw hex locally and don't want to leak it to a third-party explorer.

## Known failure modes

- Invalid or malformed hex string returns a parsing error
- Hex belonging to a different network than specified may produce incorrect address decoding
- Truncated or incomplete transaction hex causes a decoding failure
- Non-transaction hex (e.g. PSBT or block hex submitted to this endpoint) may return an error or unexpected result
- Network enum value not in [mainnet, testnet, regtest] results in a validation error

## How this service works

Bitcoin transaction decoder, PSBT analyzer and address validator API. Pay-per-call in USDC via x402. Read-only: nothing is broadcast, logged or stored.

## Output

A JSON object containing the computed txid, an array of outputs (each with index, script type, Bitcoin address, and value in satoshis), the transaction's virtual size in vbytes, a boolean indicating SegWit usage, and a boolean indicating whether RBF is signaled. Nothing is broadcast or stored.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "hex": {
   "type": "string",
   "description": "Raw transaction hex"
  },
  "network": {
   "enum": [
    "mainnet",
    "testnet",
    "regtest"
   ],
   "type": "string",
   "default": "mainnet"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "txid": "e3b0...",
  "vout": [
   {
    "n": 0,
    "type": "p2wpkh",
    "address": "bc1q...",
    "value_sat": 10000
   }
  ],
  "vsize": 141,
  "segwit": true,
  "rbf_signaled": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/btc-tx-toolkit-transaction-decoder-e758f8d9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from btc-tx-toolkit.stackstats.workers.dev](https://www.zero.xyz/host/btc-tx-toolkit.stackstats.workers.dev/llms.txt)
