> ## Documentation Index
> Fetch the complete documentation index at: https://tokenterminal.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To query the Token Terminal data catalog, read https://tokenterminal.com/docs/catalog/agents-manual.md first. It is the whole catalog as one page: table naming grammar, key columns, partition and cluster rules, units, additivity, and the tables that are documented but not served yet.
> Never query a catalog table on a time bound alone. Also filter its cluster key, which you read from INFORMATION_SCHEMA.COLUMNS; an empty result means the object is a view, whose pruning contract is on its page. Compute is billed to the caller's own Google Cloud project.

# UTXO ecosystem

> Standardized blocks and transactions for Bitcoin and the chains built like it.

These chains keep no account balances. Coins sit in outputs, each one a chunk of value locked to whoever can unlock it, and a transaction spends whole outputs as its inputs and creates new ones. An output nobody has spent yet is an unspent transaction output, or UTXO, and someone's balance is just the sum of the ones they can unlock.

Recording that takes only two tables: `blocks`, with the totals for each block, and `transactions`, with each transaction's inputs and outputs held on the same row.

The [Tables](#tables) section below says what each table holds and lists the columns.

## Chains

<table>
  <thead>
    <tr>
      <th width="160">Chain</th>
      <th width="140">`chain_id`</th>
      <th width="90">blocks</th>
      <th width="120">transactions</th>
      <th width="90">events</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Bitcoin</td>
      <td>`bitcoin`</td>
      <td>✓</td>
      <td>✓</td>
      <td>✗</td>
    </tr>

    <tr>
      <td>Dogecoin</td>
      <td>`dogecoin`</td>
      <td>✓</td>
      <td>✓</td>
      <td>✗</td>
    </tr>

    <tr>
      <td>Litecoin</td>
      <td>`litecoin`</td>
      <td>✓</td>
      <td>✓</td>
      <td>✗</td>
    </tr>

    <tr>
      <td>Zcash</td>
      <td>`zcash`</td>
      <td>✓</td>
      <td>✓</td>
      <td>✗</td>
    </tr>

    <tr>
      <td>Stacks</td>
      <td>`stacks`</td>
      <td>✓</td>
      <td>✓</td>
      <td>✓</td>
    </tr>
  </tbody>
</table>

## Tables

The schemas below are read from `bitcoin`, and apply to the chains listed on the [Bitcoin ecosystem overview](https://tokenterminal.com/docs/catalog/chain-verticals/bitcoin/index.md). Stacks has a different shape and is documented on its [own page](https://tokenterminal.com/docs/catalog/chain-verticals/bitcoin/stacks.md).

These chains keep no account balances. Coins sit in outputs, each one a chunk of value locked to whoever can unlock it. A transaction spends whole outputs as its inputs and creates new outputs, and an output still unspent is an unspent transaction output, or UTXO. Someone's balance is the sum of the unspent outputs they can unlock.

`transactions` is split by day on `block_timestamp`, and `blocks` on `timestamp`. Filter on that column in every query: with a filter the query reads only the days you asked for, without one it reads the whole table.

**blocks**

A block is a batch of transactions a miner added to the chain. `blocks` contains one row per block, with the fee, size and unspent-output figures for that block already worked out, so you rarely have to total them yourself.

<table>
  <thead>
    <tr>
      <th width="280">Column</th>
      <th width="130">Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`timestamp`</td>
      <td>`TIMESTAMP`</td>
      <td>The time the block was mined. Partition column.</td>
    </tr>

    <tr>
      <td>`height`</td>
      <td>`INT64`</td>
      <td>The block height.</td>
    </tr>

    <tr>
      <td>`block_hash`</td>
      <td>`STRING`</td>
      <td>The hash of the block.</td>
    </tr>

    <tr>
      <td>`block_subsidy`</td>
      <td>`INT64`</td>
      <td>The block subsidy paid to the miner.</td>
    </tr>

    <tr>
      <td>`transaction_count`</td>
      <td>`INT64`</td>
      <td>The number of transactions in the block.</td>
    </tr>

    <tr>
      <td>`total_fee`</td>
      <td>`INT64`</td>
      <td>The total fees paid in the block.</td>
    </tr>

    <tr>
      <td>`total_out`</td>
      <td>`INT64`</td>
      <td>The total value of all outputs in the block.</td>
    </tr>

    <tr>
      <td>`total_size`</td>
      <td>`INT64`</td>
      <td>The block size in bytes.</td>
    </tr>

    <tr>
      <td>`total_weight`</td>
      <td>`INT64`</td>
      <td>The block weight.</td>
    </tr>

    <tr>
      <td>`avg_fee`</td>
      <td>`INT64`</td>
      <td>The average transaction fee.</td>
    </tr>

    <tr>
      <td>`avg_fee_rate`</td>
      <td>`INT64`</td>
      <td>The average fee rate.</td>
    </tr>

    <tr>
      <td>`avg_transaction_size`</td>
      <td>`INT64`</td>
      <td>The average transaction size in bytes.</td>
    </tr>

    <tr>
      <td>`max_fee`</td>
      <td>`INT64`</td>
      <td>The highest transaction fee in the block.</td>
    </tr>

    <tr>
      <td>`max_fee_rate`</td>
      <td>`INT64`</td>
      <td>The highest fee rate in the block.</td>
    </tr>

    <tr>
      <td>`max_transaction_size`</td>
      <td>`INT64`</td>
      <td>The largest transaction size in the block.</td>
    </tr>

    <tr>
      <td>`median_fee`</td>
      <td>`INT64`</td>
      <td>The median transaction fee.</td>
    </tr>

    <tr>
      <td>`median_time`</td>
      <td>`INT64`</td>
      <td>The median time of the previous blocks.</td>
    </tr>

    <tr>
      <td>`median_transaction_size`</td>
      <td>`INT64`</td>
      <td>The median transaction size.</td>
    </tr>

    <tr>
      <td>`min_fee`</td>
      <td>`INT64`</td>
      <td>The lowest transaction fee in the block.</td>
    </tr>

    <tr>
      <td>`min_fee_rate`</td>
      <td>`INT64`</td>
      <td>The lowest fee rate in the block.</td>
    </tr>

    <tr>
      <td>`min_transaction_size`</td>
      <td>`INT64`</td>
      <td>The smallest transaction size in the block.</td>
    </tr>

    <tr>
      <td>`segwit_total_size`</td>
      <td>`INT64`</td>
      <td>The total size of segwit transactions.</td>
    </tr>

    <tr>
      <td>`segwit_total_weight`</td>
      <td>`INT64`</td>
      <td>The total weight of segwit transactions.</td>
    </tr>

    <tr>
      <td>`segwit_transaction_count`</td>
      <td>`INT64`</td>
      <td>The number of segwit transactions.</td>
    </tr>

    <tr>
      <td>`utxo_increase`</td>
      <td>`INT64`</td>
      <td>The net change in the number of unspent outputs on the chain.</td>
    </tr>

    <tr>
      <td>`utxo_size_increase`</td>
      <td>`INT64`</td>
      <td>The net change in the storage size of those unspent outputs.</td>
    </tr>

    <tr>
      <td>`feerate_percentiles`</td>
      <td>`ARRAY<INT64>`</td>
      <td>Fee rate percentiles for the block.</td>
    </tr>

    <tr>
      <td>`ins`</td>
      <td>`INT64`</td>
      <td>The number of inputs in the block.</td>
    </tr>

    <tr>
      <td>`outs`</td>
      <td>`INT64`</td>
      <td>The number of outputs in the block.</td>
    </tr>
  </tbody>
</table>

**Daily fees and output**

**Sum daily fees and output value from block statistics over one week.**

```sql theme={null}
select
    date(timestamp) as day,
    sum(transaction_count) as transactions,
    sum(total_fee) as total_fee,
    sum(total_out) as total_out
from `bitcoin.blocks`
where timestamp >= timestamp('2026-08-16')
  and timestamp < timestamp('2026-08-23')
group by day
order by day
```

**transactions**

A transaction spends outputs and creates new ones. `transactions` contains one row per transaction, with its inputs and its outputs held as lists on that same row rather than in separate tables.

<table>
  <thead>
    <tr>
      <th width="280">Column</th>
      <th width="130">Type</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`block_timestamp`</td>
      <td>`TIMESTAMP`</td>
      <td>The time of the block containing the transaction. Partition column.</td>
    </tr>

    <tr>
      <td>`block_height`</td>
      <td>`INT64`</td>
      <td>The height of the containing block.</td>
    </tr>

    <tr>
      <td>`block_hash`</td>
      <td>`STRING`</td>
      <td>The hash of the containing block.</td>
    </tr>

    <tr>
      <td>`txid`</td>
      <td>`STRING`</td>
      <td>The transaction identifier.</td>
    </tr>

    <tr>
      <td>`fee`</td>
      <td>`NUMERIC`</td>
      <td>The transaction fee.</td>
    </tr>

    <tr>
      <td>`is_coinbase`</td>
      <td>`BOOL`</td>
      <td>Whether this is the block's coinbase transaction, the one that pays the miner and has no inputs to spend.</td>
    </tr>

    <tr>
      <td>`size`</td>
      <td>`INT64`</td>
      <td>The transaction size in bytes.</td>
    </tr>

    <tr>
      <td>`vsize`</td>
      <td>`INT64`</td>
      <td>The virtual size in vbytes.</td>
    </tr>

    <tr>
      <td>`weight`</td>
      <td>`INT64`</td>
      <td>The transaction weight.</td>
    </tr>

    <tr>
      <td>`inputs`</td>
      <td>`ARRAY<STRUCT>`</td>
      <td>The transaction inputs. Each element holds the previous output reference (`txid`, `vout`), the unlock script, witness data and the resolved `prevout` with its value and script public key.</td>
    </tr>

    <tr>
      <td>`outputs`</td>
      <td>`ARRAY<STRUCT>`</td>
      <td>The transaction outputs. Each element holds the output `value`, position `n` and `scriptPubKey` with type and addresses.</td>
    </tr>
  </tbody>
</table>

To get one row per output rather than one row per transaction, unnest `inputs` or `outputs`. Each input already holds the output it spends, in `prevout`, including that output's value, so the table needs no self-join to find out what was spent.

**Daily transactions**

**Count daily transactions and coinbase transactions over one week.**

```sql theme={null}
select
    timestamp_trunc(block_timestamp, day) as day,
    count(*) as transactions,
    countif(is_coinbase) as coinbase_transactions
from `bitcoin.transactions`
where block_timestamp >= timestamp('2026-08-16')
  and block_timestamp < timestamp('2026-08-23')
group by day
order by day
```

## Exceptions

Stacks sits on top of Bitcoin and runs contracts of its own, written in a language called Clarity, so its tables have extra columns for that and it adds a third table, `events`, for the movements of assets and tokens and the notes its contracts write. The [Stacks](https://tokenterminal.com/docs/catalog/chain-verticals/bitcoin/stacks.md) page describes them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.