> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://docs.ampdb.io/api/mcp` to find what you need.

# Bittensor Tables

Status: Experimental.

Every Bittensor [raw dataset](/datasets/raw-datasets) (`"kind": "bittensor"`) has these tables: [`blocks`](/datasets/tables/bittensor#blocks), [`digest_logs`](/datasets/tables/bittensor#digest_logs), [`runtime_metadata`](/datasets/tables/bittensor#runtime_metadata), [`runtime_symbols`](/datasets/tables/bittensor#runtime_symbols), [`extrinsics`](/datasets/tables/bittensor#extrinsics), [`events`](/datasets/tables/bittensor#events), and [`storage_entries`](/datasets/tables/bittensor#storage_entries). Query one through its dataset's name, like `SELECT * FROM "acme/bittensor_finney".blocks`. Column types are [Arrow types](/datasets/manifests#data-types), and a nullable column can be `NULL`.

## `blocks`

One row per block of Bittensor's chain, Subtensor, which is built with Substrate.

| Column            | Type                            | Nullable | Description                                                                                                                                                                                                     |
| ----------------- | ------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_block_num`      | `UInt64`                        | No       | The number of the block the row comes from. Amp adds it to every raw table, and uses it to order the data, split it into files, and track which blocks it has.                                                  |
| `_ts`             | `Timestamp(Nanosecond, +00:00)` | No       | The time of the block the row comes from, in UTC, to the millisecond. Block 0 doesn't record one, so its rows have `1970-01-01 00:00:00`.                                                                       |
| `block_num`       | `UInt64`                        | No       | The block's number, counting from `0` for the first block. The same as `_block_num`.                                                                                                                            |
| `hash`            | `FixedSizeBinary(32)`           | No       | The block's hash, which identifies it.                                                                                                                                                                          |
| `parent_hash`     | `FixedSizeBinary(32)`           | No       | The hash of the previous block.                                                                                                                                                                                 |
| `state_root`      | `FixedSizeBinary(32)`           | No       | A hash that sums up the chain's state after the block: every value the chain stores, like account balances.                                                                                                     |
| `extrinsics_root` | `FixedSizeBinary(32)`           | No       | A hash that sums up the block's extrinsics. Extrinsics are the calls a block includes: transactions that accounts sign, and unsigned calls the block's author adds, like the one that records the block's time. |
| `extrinsic_count` | `UInt32`                        | No       | The number of extrinsics in the block, each a row of `extrinsics`.                                                                                                                                              |

## `digest_logs`

One row per log in a block header's digest. The chain's consensus engines, which agree on blocks, and its runtime, the program that defines its logic, write these logs, like the block author's signature.

| Column           | Type                            | Nullable | Description                                                                                                                                                                                      |
| ---------------- | ------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `_block_num`     | `UInt64`                        | No       | The number of the block the row comes from. Amp adds it to every raw table, and uses it to order the data, split it into files, and track which blocks it has.                                   |
| `_ts`            | `Timestamp(Nanosecond, +00:00)` | No       | The time of the block the row comes from, in UTC, to the millisecond. Block 0 doesn't record one, so its rows have `1970-01-01 00:00:00`.                                                        |
| `block_num`      | `UInt64`                        | No       | The number of the block the row comes from. The same as `_block_num`.                                                                                                                            |
| `block_hash`     | `FixedSizeBinary(32)`           | No       | The hash of the block the row comes from. Joins to `blocks.hash`.                                                                                                                                |
| `log_index`      | `UInt32`                        | No       | The log's position in the digest, starting at `0`.                                                                                                                                               |
| `log_type_index` | `UInt8`                         | No       | The kind of log: `0` (other), `4` (consensus), `5` (seal, like the author's signature), `6` (pre-runtime, like the time slot the block was authored in), or `8` (the block changed the runtime). |
| `engine_id`      | `FixedSizeBinary(4)`            | Yes      | The ID of the consensus engine that wrote the log, as 4 ASCII bytes, like `aura` (`0x61757261`). Null for logs of kinds `0` and `8`, which have none.                                            |
| `data`           | `Binary`                        | Yes      | The log's content, as raw bytes in a format that depends on the engine. Null for logs of kind `8`, which have none.                                                                              |

## `runtime_metadata`

One row per block, with the metadata of the runtime in effect after the block. The metadata describes the runtime's pallets (the modules it's built from, like `Balances`), their calls, events, and storage, and the types you need to decode their bytes.

| Column                | Type                            | Nullable | Description                                                                                                                                                    |
| --------------------- | ------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_block_num`          | `UInt64`                        | No       | The number of the block the row comes from. Amp adds it to every raw table, and uses it to order the data, split it into files, and track which blocks it has. |
| `_ts`                 | `Timestamp(Nanosecond, +00:00)` | No       | The time of the block the row comes from, in UTC, to the millisecond. Block 0 doesn't record one, so its rows have `1970-01-01 00:00:00`.                      |
| `block_num`           | `UInt64`                        | No       | The number of the block the row comes from. The same as `_block_num`.                                                                                          |
| `block_hash`          | `FixedSizeBinary(32)`           | No       | The hash of the block the row comes from. Joins to `blocks.hash`.                                                                                              |
| `metadata_version`    | `UInt8`                         | No       | The format version of the runtime metadata, like `14`.                                                                                                         |
| `spec_version`        | `UInt32`                        | No       | The runtime's spec version, which usually goes up with each runtime upgrade.                                                                                   |
| `transaction_version` | `UInt32`                        | No       | The runtime's transaction version, which goes up when an upgrade changes how extrinsics are encoded, like a call's index or arguments.                         |
| `payload`             | `Binary`                        | No       | The runtime metadata, SCALE-encoded (SCALE is the binary encoding Substrate chains use), as the node's `state_getMetadata` RPC method returns it.              |

## `runtime_symbols`

One row per pallet, call, and event of the runtime in effect after each block. Calls are the functions extrinsics run, and events record what happened, like a transfer. Use it to name the indexes in `extrinsics` and `events`.

| Column                | Type                            | Nullable | Description                                                                                                                                                    |
| --------------------- | ------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_block_num`          | `UInt64`                        | No       | The number of the block the row comes from. Amp adds it to every raw table, and uses it to order the data, split it into files, and track which blocks it has. |
| `_ts`                 | `Timestamp(Nanosecond, +00:00)` | No       | The time of the block the row comes from, in UTC, to the millisecond. Block 0 doesn't record one, so its rows have `1970-01-01 00:00:00`.                      |
| `block_num`           | `UInt64`                        | No       | The number of the block the row comes from. The same as `_block_num`.                                                                                          |
| `block_hash`          | `FixedSizeBinary(32)`           | No       | The hash of the block the row comes from. Joins to `blocks.hash`.                                                                                              |
| `metadata_version`    | `UInt8`                         | No       | The format version of the runtime metadata, like `14`.                                                                                                         |
| `spec_version`        | `UInt32`                        | No       | The runtime's spec version, which usually goes up with each runtime upgrade.                                                                                   |
| `transaction_version` | `UInt32`                        | No       | The runtime's transaction version, which goes up when an upgrade changes how extrinsics are encoded, like a call's index or arguments.                         |
| `symbol_kind`         | `Utf8`                          | No       | What the row describes: `pallet`, `call`, or `event`.                                                                                                          |
| `pallet_index`        | `UInt8`                         | No       | The pallet's index in the runtime, which `extrinsics.pallet_index` and `events.pallet_index` hold.                                                             |
| `pallet_name`         | `Utf8`                          | No       | The pallet's name, like `Balances`.                                                                                                                            |
| `variant_index`       | `UInt8`                         | Yes      | The index of the call or event within its pallet, which `extrinsics.call_index` and `events.event_index_in_pallet` hold. Null for `pallet` rows.               |
| `variant_name`        | `Utf8`                          | Yes      | The call's or event's name, like `transfer_keep_alive` or `Transfer`. Null for `pallet` rows.                                                                  |
| `type_id`             | `UInt32`                        | Yes      | The ID of the type in the runtime metadata that lists the pallet's calls or events, with their fields. Null for `pallet` rows.                                 |

## `extrinsics`

One row per extrinsic in a block. On a block that upgrades the runtime, its extrinsics ran on the previous runtime, so their version columns can differ from the block's `runtime_metadata` row.

| Column                | Type                            | Nullable | Description                                                                                                                                                                                                                                        |
| --------------------- | ------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_block_num`          | `UInt64`                        | No       | The number of the block the row comes from. Amp adds it to every raw table, and uses it to order the data, split it into files, and track which blocks it has.                                                                                     |
| `_ts`                 | `Timestamp(Nanosecond, +00:00)` | No       | The time of the block the row comes from, in UTC, to the millisecond. Block 0 doesn't record one, so its rows have `1970-01-01 00:00:00`.                                                                                                          |
| `block_num`           | `UInt64`                        | No       | The number of the block the row comes from. The same as `_block_num`.                                                                                                                                                                              |
| `block_hash`          | `FixedSizeBinary(32)`           | No       | The hash of the block the row comes from. Joins to `blocks.hash`.                                                                                                                                                                                  |
| `extrinsic_index`     | `UInt32`                        | No       | The extrinsic's position in the block, starting at `0`.                                                                                                                                                                                            |
| `encoded_length`      | `UInt32`                        | No       | The extrinsic's size in bytes: its version byte plus `payload`.                                                                                                                                                                                    |
| `version`             | `UInt8`                         | No       | The extrinsic's format version, like `4`.                                                                                                                                                                                                          |
| `is_signed`           | `Boolean`                       | No       | Whether an account signed the extrinsic. Unsigned extrinsics include the ones the block's author adds, like `Timestamp.set`, which records the block's time.                                                                                       |
| `payload`             | `Binary`                        | No       | The extrinsic's bytes after its version byte, SCALE-encoded: for a signed extrinsic, `signature_payload` followed by the call; for an unsigned one, the call alone.                                                                                |
| `metadata_version`    | `UInt8`                         | Yes      | The format version of the metadata of the runtime that ran the extrinsic. Never null.                                                                                                                                                              |
| `spec_version`        | `UInt32`                        | Yes      | The spec version of the runtime that ran the extrinsic. Never null.                                                                                                                                                                                |
| `transaction_version` | `UInt32`                        | Yes      | The transaction version of the runtime that ran the extrinsic. Never null.                                                                                                                                                                         |
| `pallet_index`        | `UInt8`                         | Yes      | The index of the pallet whose call the extrinsic runs. Null when the call can't be identified from the runtime metadata.                                                                                                                           |
| `call_index`          | `UInt8`                         | Yes      | The index of the call within its pallet. Null when the call can't be identified from the runtime metadata.                                                                                                                                         |
| `pallet_name`         | `Utf8`                          | Yes      | The name of the pallet whose call the extrinsic runs, like `SubtensorModule`. Null when the call can't be identified from the runtime metadata.                                                                                                    |
| `call_name`           | `Utf8`                          | Yes      | The name of the call, like `add_stake`. Null when the call can't be identified from the runtime metadata.                                                                                                                                          |
| `signature_payload`   | `Binary`                        | Yes      | For a signed extrinsic, the bytes before the call, SCALE-encoded: the signer's address, the signature, and the signed extensions, extra data like the nonce and tip. Null for unsigned extrinsics, and when this part can't be decoded.            |
| `args_payload`        | `Binary`                        | Yes      | The call's arguments, SCALE-encoded: the call without its pallet and call indexes. Decode them with [`scale_decode`](/querying/functions/substrate) and the call's argument types. Null when a signed extrinsic's signature part can't be decoded. |
| `signer_account`      | `FixedSizeBinary(32)`           | Yes      | The 32-byte account ID of the signer. `ss58_encode(signer_account, 42)` shows it as a Bittensor address. Null for unsigned extrinsics, and for signers given in another form.                                                                      |
| `nonce`               | `UInt64`                        | Yes      | The signer's nonce: how many extrinsics the account had signed before this one. Null for unsigned extrinsics, and when it can't be decoded.                                                                                                        |
| `tip`                 | `Utf8`                          | Yes      | What the signer added to the fee to prioritize the extrinsic, in RAO (1 TAO is 1,000,000,000 RAO), as a decimal string. Null for unsigned extrinsics, and when it can't be decoded.                                                                |
| `success`             | `Boolean`                       | Yes      | `true` when the block's events include `System.ExtrinsicSuccess` for the extrinsic, and `false` for `System.ExtrinsicFailed`. Null when they include neither, as when the block has no rows in `events`.                                           |

## `events`

One row per event a block emitted. Pallets emit events to record what happened, like a transfer or an extrinsic's success. Some blocks of runtime spec version `122` have no rows, because their events can't be decoded.

| Column                  | Type                            | Nullable | Description                                                                                                                                                       |
| ----------------------- | ------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_block_num`            | `UInt64`                        | No       | The number of the block the row comes from. Amp adds it to every raw table, and uses it to order the data, split it into files, and track which blocks it has.    |
| `_ts`                   | `Timestamp(Nanosecond, +00:00)` | No       | The time of the block the row comes from, in UTC, to the millisecond. Block 0 doesn't record one, so its rows have `1970-01-01 00:00:00`.                         |
| `block_num`             | `UInt64`                        | No       | The number of the block the row comes from. The same as `_block_num`.                                                                                             |
| `block_hash`            | `FixedSizeBinary(32)`           | No       | The hash of the block the row comes from. Joins to `blocks.hash`.                                                                                                 |
| `event_index`           | `UInt32`                        | No       | The event's position among the block's events, starting at `0`.                                                                                                   |
| `phase_index`           | `UInt8`                         | No       | When during the block the event happened, as a number: `0` (`ApplyExtrinsic`), `1` (`Finalization`), or `2` (`Initialization`).                                   |
| `phase_payload`         | `Binary`                        | No       | The rest of the phase, SCALE-encoded: for `ApplyExtrinsic`, the extrinsic's index (`phase_extrinsic_index`); empty for the other phases.                          |
| `pallet_index`          | `UInt8`                         | No       | The index of the pallet that emitted the event.                                                                                                                   |
| `event_index_in_pallet` | `UInt8`                         | No       | The event's index within its pallet.                                                                                                                              |
| `event_payload`         | `Binary`                        | No       | The event's fields, SCALE-encoded, without its pallet and event indexes. Decode them with `scale_decode` and the event's field types.                             |
| `topics`                | `Binary`                        | No       | The event's topics, SCALE-encoded: a list of 32-byte hashes that index the event, starting with its length. An empty list is the single byte `0x00`.              |
| `metadata_version`      | `UInt8`                         | Yes      | The format version of the metadata of the runtime that emitted the event. Never null.                                                                             |
| `spec_version`          | `UInt32`                        | Yes      | The spec version of the runtime that emitted the event. Never null.                                                                                               |
| `transaction_version`   | `UInt32`                        | Yes      | The transaction version of the runtime that emitted the event. Never null.                                                                                        |
| `phase_kind`            | `Utf8`                          | Yes      | When during the block the event happened: `Initialization` (before the extrinsics), `ApplyExtrinsic` (while one ran), or `Finalization` (after them). Never null. |
| `phase_extrinsic_index` | `UInt32`                        | Yes      | For an `ApplyExtrinsic` event, the index of the extrinsic that emitted it: join on `block_num` and `extrinsics.extrinsic_index`. Null for the other phases.       |
| `pallet_name`           | `Utf8`                          | Yes      | The name of the pallet that emitted the event, like `Balances`. Never null.                                                                                       |
| `event_name`            | `Utf8`                          | Yes      | The event's name, like `Transfer`. Never null.                                                                                                                    |

## `storage_entries`

One row per stored value a state snapshot captured. Rows exist only when the dataset's manifest sets `state_snapshots`: each selector, a `Pallet.StorageEntry` name like `Balances.TotalIssuance`, captures that entry's values at every block, or every `block_interval` blocks.

| Column          | Type                            | Nullable | Description                                                                                                                                                                                                                        |
| --------------- | ------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `_block_num`    | `UInt64`                        | No       | The number of the block the row comes from. Amp adds it to every raw table, and uses it to order the data, split it into files, and track which blocks it has.                                                                     |
| `_ts`           | `Timestamp(Nanosecond, +00:00)` | No       | The time of the block the row comes from, in UTC, to the millisecond. Block 0 doesn't record one, so its rows have `1970-01-01 00:00:00`.                                                                                          |
| `block_num`     | `UInt64`                        | No       | The number of the block the row comes from. The same as `_block_num`.                                                                                                                                                              |
| `block_hash`    | `FixedSizeBinary(32)`           | No       | The hash of the block the row comes from. Joins to `blocks.hash`.                                                                                                                                                                  |
| `selector`      | `Utf8`                          | No       | The selector that captured the row, as the manifest names it, like `SubtensorModule.Difficulty`.                                                                                                                                   |
| `storage_key`   | `Binary`                        | No       | The full key the value is stored under, as raw bytes: a 32-byte prefix derived from the pallet and entry names, followed, for a map entry, by the encoded map key. A map entry, which stores a value per key, gives a row per key. |
| `storage_value` | `Binary`                        | No       | The stored value, SCALE-encoded. Decode it with the entry's type from the runtime metadata, like `scale_decode(storage_value, 'u64')`.                                                                                             |
