> ## 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"><code>chain\_id</code></th>
      <th width="90">blocks</th>
      <th width="120">transactions</th>
      <th width="90">events</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Bitcoin</td>
      <td><code>bitcoin</code></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-cross">✗</span></td>
    </tr>

    <tr>
      <td>Dogecoin</td>
      <td><code>dogecoin</code></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-cross">✗</span></td>
    </tr>

    <tr>
      <td>Litecoin</td>
      <td><code>litecoin</code></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-cross">✗</span></td>
    </tr>

    <tr>
      <td>Zcash</td>
      <td><code>zcash</code></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-cross">✗</span></td>
    </tr>

    <tr>
      <td>Stacks</td>
      <td><code>stacks</code></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-check">✓</span></td>
      <td><span class="tt-check">✓</span></td>
    </tr>
  </tbody>
</table>

## Tables

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

These chains do not keep account balances. Instead, 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 that has not been spent yet 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.

<Tabs>
  <Tab title="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><code>timestamp</code></td>
          <td><code>TIMESTAMP</code></td>
          <td>The time the block was mined. Partition column.</td>
        </tr>

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

        <tr>
          <td><code>block\_hash</code></td>
          <td><code>STRING</code></td>
          <td>The hash of the block.</td>
        </tr>

        <tr>
          <td><code>block\_subsidy</code></td>
          <td><code>INT64</code></td>
          <td>The block subsidy paid to the miner.</td>
        </tr>

        <tr>
          <td><code>transaction\_count</code></td>
          <td><code>INT64</code></td>
          <td>The number of transactions in the block.</td>
        </tr>

        <tr>
          <td><code>total\_fee</code></td>
          <td><code>INT64</code></td>
          <td>The total fees paid in the block.</td>
        </tr>

        <tr>
          <td><code>total\_out</code></td>
          <td><code>INT64</code></td>
          <td>The total value of all outputs in the block.</td>
        </tr>

        <tr>
          <td><code>total\_size</code></td>
          <td><code>INT64</code></td>
          <td>The block size in bytes.</td>
        </tr>

        <tr>
          <td><code>total\_weight</code></td>
          <td><code>INT64</code></td>
          <td>The block weight.</td>
        </tr>

        <tr>
          <td><code>avg\_fee</code></td>
          <td><code>INT64</code></td>
          <td>The average transaction fee.</td>
        </tr>

        <tr>
          <td><code>avg\_fee\_rate</code></td>
          <td><code>INT64</code></td>
          <td>The average fee rate.</td>
        </tr>

        <tr>
          <td><code>avg\_transaction\_size</code></td>
          <td><code>INT64</code></td>
          <td>The average transaction size in bytes.</td>
        </tr>

        <tr>
          <td><code>max\_fee</code></td>
          <td><code>INT64</code></td>
          <td>The highest transaction fee in the block.</td>
        </tr>

        <tr>
          <td><code>max\_fee\_rate</code></td>
          <td><code>INT64</code></td>
          <td>The highest fee rate in the block.</td>
        </tr>

        <tr>
          <td><code>max\_transaction\_size</code></td>
          <td><code>INT64</code></td>
          <td>The largest transaction size in the block.</td>
        </tr>

        <tr>
          <td><code>median\_fee</code></td>
          <td><code>INT64</code></td>
          <td>The median transaction fee.</td>
        </tr>

        <tr>
          <td><code>median\_time</code></td>
          <td><code>INT64</code></td>
          <td>The median time of the previous blocks.</td>
        </tr>

        <tr>
          <td><code>median\_transaction\_size</code></td>
          <td><code>INT64</code></td>
          <td>The median transaction size.</td>
        </tr>

        <tr>
          <td><code>min\_fee</code></td>
          <td><code>INT64</code></td>
          <td>The lowest transaction fee in the block.</td>
        </tr>

        <tr>
          <td><code>min\_fee\_rate</code></td>
          <td><code>INT64</code></td>
          <td>The lowest fee rate in the block.</td>
        </tr>

        <tr>
          <td><code>min\_transaction\_size</code></td>
          <td><code>INT64</code></td>
          <td>The smallest transaction size in the block.</td>
        </tr>

        <tr>
          <td><code>segwit\_total\_size</code></td>
          <td><code>INT64</code></td>
          <td>The total size of segwit transactions.</td>
        </tr>

        <tr>
          <td><code>segwit\_total\_weight</code></td>
          <td><code>INT64</code></td>
          <td>The total weight of segwit transactions.</td>
        </tr>

        <tr>
          <td><code>segwit\_transaction\_count</code></td>
          <td><code>INT64</code></td>
          <td>The number of segwit transactions.</td>
        </tr>

        <tr>
          <td><code>utxo\_increase</code></td>
          <td><code>INT64</code></td>
          <td>The net change in the number of unspent outputs on the chain.</td>
        </tr>

        <tr>
          <td><code>utxo\_size\_increase</code></td>
          <td><code>INT64</code></td>
          <td>The net change in the storage size of those unspent outputs.</td>
        </tr>

        <tr>
          <td><code>feerate\_percentiles</code></td>
          <td><code>ARRAY\<INT64></code></td>
          <td>Fee rate percentiles for the block.</td>
        </tr>

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

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

    <Tabs>
      <Tab title="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
        ```
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="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><code>block\_timestamp</code></td>
          <td><code>TIMESTAMP</code></td>
          <td>The time of the block containing the transaction. Partition column.</td>
        </tr>

        <tr>
          <td><code>block\_height</code></td>
          <td><code>INT64</code></td>
          <td>The height of the containing block.</td>
        </tr>

        <tr>
          <td><code>block\_hash</code></td>
          <td><code>STRING</code></td>
          <td>The hash of the containing block.</td>
        </tr>

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

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

        <tr>
          <td><code>is\_coinbase</code></td>
          <td><code>BOOL</code></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><code>size</code></td>
          <td><code>INT64</code></td>
          <td>The transaction size in bytes.</td>
        </tr>

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

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

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

        <tr>
          <td><code>outputs</code></td>
          <td><code>ARRAY\<STRUCT></code></td>
          <td>The transaction outputs. Each element carries the output <code>value</code>, position <code>n</code> and <code>scriptPubKey</code> 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 carries the output it spends, in `prevout`, including that output's value, so you do not have to join the table back to itself to find out what was spent.

    <Tabs>
      <Tab title="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
        ```
      </Tab>
    </Tabs>
  </Tab>
</Tabs>

## Exceptions

One chain here is not a plain UTXO chain. Stacks sits on top of Bitcoin and runs contracts of its own, written in a language called Clarity, so its tables carry extra columns for that and it has a third table, `events`, for the movements of assets and tokens and the notes its contracts write. The [Stacks](/docs/catalog/chain-verticals/bitcoin/stacks) page describes them.
