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

# tron.blocks

> Tron block data — block number, timestamp, witness address, and transaction count.

export const TableSample = ({tableName, tableSchema}) => <>
    <div className="hidden dark:block">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}&darkMode=true`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
    <div className="dark:hidden">
      <iframe src={`https://dune.com/embeds/3419983/5785629?table_schema_t6f0df=${tableSchema}&table_name_t6f0df=${tableName}`} style={{
  width: '100%',
  height: '500px',
  border: 'none',
  marginTop: '10px'
}} />
    </div>
  </>;

## Table Description

The `tron.blocks` table contains information about blocks in the Tron blockchain. A block is a collection of transactions that are hashed and added to the blockchain. Each block contains a reference to the previous block, known as the parent hash, and a timestamp. The table contains information about each block, such as the block number, the block hash, the block size, the number of transactions, and the gas used.

## Table Schema

| Column              | Type          | Description                                                                  |
| ------------------- | ------------- | ---------------------------------------------------------------------------- |
| time                | timestamp(3)  | Timestamp when this block was added to the chain                             |
| number              | bigint        | Sequential position of this block in the blockchain                          |
| gas\_limit          | decimal(38,0) | Maximum amount of energy that can be used by all transactions in this block  |
| gas\_used           | decimal(38,0) | Total amount of energy actually consumed by all transactions in this block   |
| difficulty          | bigint        | Measure of how difficult it was to produce this block                        |
| total\_difficulty   | decimal(38,0) | Total chain difficulty up to this block                                      |
| size                | bigint        | Size of this block in bytes                                                  |
| base\_fee\_per\_gas | bigint        | Minimum fee per energy unit required for transaction inclusion in this block |
| hash                | varbinary     | Unique identifier (hash) of this block                                       |
| parent\_hash        | varbinary     | Hash of the previous block in the blockchain                                 |
| miner               | varbinary     | Address of the block producer (super representative) who produced this block |
| nonce               | varbinary     | Block nonce value used in the consensus mechanism                            |
| date                | date          | The UTC date when this block was added to the chain                          |

## Table Sample

<TableSample tableSchema="tron" tableName="blocks" />

## Examples

### Show the most recent blocks

```sql theme={null}
SELECT
  number,
  hash,
  size,
  gas_used
FROM
  tron.blocks
ORDER BY
  number DESC
LIMIT 10
```

### Show the number of blocks produced each day

```sql theme={null}
SELECT
  date_trunc('day', time) AS day,
  count(distinct number)
FROM
  tron.blocks
GROUP BY
  day
ORDER BY
  day DESC
```

### Show the number of transactions in each block

```sql theme={null}
SELECT
  number,
  count(*)
FROM
  tron.blocks
group by 1 

LIMIT 10
```
