Decode a raw Bitcoin transaction by hash

When the user has a Bitcoin transaction hash and wants to decode it — inputs, outputs, fee, block height, timestamp, or whether it's a coinbase miner reward — reach for Blockchain.info's /rawtx/ endpoint. No auth required, Bitcoin only.

decode-bitcoin-transaction · v2 · updated 2026-04-16

Agents: This page is a SKILL.md-style capability guide. For JSON, call GET /api/skills/decode-bitcoin-transaction. To drop this into a local Claude Code install, copy the frontmatter + body below into ~/.claude/skills/decode-bitcoin-transaction/SKILL.md.

When to use this skill

When the user has a Bitcoin transaction hash and wants to know what happened in it — inputs consumed, outputs created, fee paid, confirmation block, timestamp, or whether it's a coinbase (miner block reward) transaction. This skill is for single-transaction decoding by known hash. For address balance and transaction history, use a separate address-lookup skill. For BTC price in fiat, this is the wrong skill.

Your best first call

curl "https://blockchain.info/rawtx/717046ba5c309eb86414cfe7b0ebd6b68d901c85ad67e34276e493e2334f61b0"

No auth. No key. Replace the hash with the one the user supplied.

The response is a single JSON object. The fields an agent uses:

All value and fee figures are in satoshis. Divide by 100,000,000 to get BTC.

Fallbacks (when the best call isn't enough)

Pitfalls

One-line summary for the user

I can decode any Bitcoin transaction by hash via Blockchain.info's /rawtx/ endpoint — no key required, and fee: 0 means you're looking at a miner's coinbase reward, not a user payment.

APIs this skill uses

Blockchain API · primary · verified

Send and receive payment from Blockchain Wallets, transactions, and blocks data. Explore the REST API for real-time market data, balance information, and trades.

Generated from

Blockchain API tutorial Getting Started with the Blockchain.info API

SKILL.md source (frontmatter + body)
---
name: decode-bitcoin-transaction
description: When the user has a Bitcoin transaction hash and wants to decode it — inputs, outputs, fee, block height, timestamp, or whether it's a coinbase miner reward — reach for Blockchain.info's /rawtx/ endpoint. No auth required, Bitcoin only.
---

## When to use this skill

When the user has a Bitcoin transaction hash and wants to know what happened in it — inputs consumed, outputs created, fee paid, confirmation block, timestamp, or whether it's a coinbase (miner block reward) transaction. This skill is for single-transaction decoding by known hash. For address balance and transaction history, use a separate address-lookup skill. For BTC price in fiat, this is the wrong skill.

## Your best first call

```bash
curl "https://blockchain.info/rawtx/717046ba5c309eb86414cfe7b0ebd6b68d901c85ad67e34276e493e2334f61b0"
```

No auth. No key. Replace the hash with the one the user supplied.

The response is a single JSON object. The fields an agent uses:

- `fee` — transaction fee in satoshis. `fee: 0` is the immediate signal that this is a coinbase transaction (the block reward a miner collects); regular user payments always have `fee > 0`.
- `time` — Unix timestamp of when the transaction was broadcast or confirmed.
- `block_height` — the block number in which this transaction was included. Absent or `null` if still unconfirmed.
- `vin_sz`, `vout_sz` — number of inputs and outputs. A coinbase transaction has exactly one input with no prior output reference.
- `inputs` — array of input objects. For coinbase transactions, `inputs[0].script` encodes arbitrary miner-embedded data (pool name, messages); there is no `prev_out` field because the coins are newly minted.
- `out` — array of output objects, each with `value` (satoshis) and `addr` (destination address). Sum `out[*].value` to get total BTC created or transferred.
- `double_spend` — boolean; `true` means this transaction conflicts with another in the mempool or chain.

All `value` and `fee` figures are in satoshis. Divide by 100,000,000 to get BTC.

## Fallbacks (when the best call isn't enough)

- **User wants every transaction in a block** → `https://blockchain.info/rawblock/{block_hash}` returns the full block including all transactions, but easily exceeds 1 MB for busy blocks — use it only when the full transaction list is the actual goal.
- **User wants address-level aggregates (total received, total sent, UTXO count)** → `https://blockchain.info/rawaddr/{address}` is the right call; `/rawtx/` only covers a single transaction.

## Pitfalls

- `fee: 0` does not mean the transaction skipped the fee — it means there is no fee because this is a coinbase transaction. Coinbase inputs have no prior output to draw from; the miner is creating new coins from the block subsidy. Do not report this as a free user transfer.
- The `inputs` array for coinbase transactions contains no `prev_out` key. Code that blindly reads `inputs[0].prev_out.value` will throw a key error on any coinbase transaction — check for `fee: 0` before accessing `prev_out`.
- All amounts are satoshis throughout. `fee`, `out[*].value`, and any balance field in related endpoints are integers in satoshis. The API returns no floats denominated in BTC.

## One-line summary for the user

I can decode any Bitcoin transaction by hash via Blockchain.info's `/rawtx/` endpoint — no key required, and `fee: 0` means you're looking at a miner's coinbase reward, not a user payment.

« Back to all skills