Skip to main content

Table Description

The ethereum.blocks table contains information about blocks in the Ethereum 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.

Column Descriptions

ColumnTypeDescription
timetimestampThe time when the block was mined
numberbigintThe block number (height)
gas_limitdecimalMaximum gas allowed in the block
gas_useddecimalTotal gas used by all transactions in the block
difficultybigintMining difficulty of the block
total_difficultydecimalCumulative difficulty of the chain up to this block
sizebigintSize of the block in bytes
base_fee_per_gasbigintBase fee per gas unit (EIP-1559)
hashvarbinaryHash of the block
parent_hashvarbinaryHash of the parent block
minervarbinaryAddress of the miner/validator
noncevarbinaryNonce used in mining the block
datedateDate of the block (UTC)
blob_gas_usedbigintTotal blob gas used in the block (EIP-4844)
excess_blob_gasbigintExcess blob gas for fee calculation (EIP-4844)
parent_beacon_block_rootvarbinaryRoot of the parent beacon block

Table Sample

Examples

Show the most recent blocks

SELECT
  number,
  hash,
  size,
  gas_used
FROM
  ethereum.blocks
ORDER BY
  number DESC
LIMIT 10

Show the number of blocks mined each day

SELECT
  date_trunc('day', time) AS day,
  count(distinct number)
FROM
  ethereum.blocks
GROUP BY
  day
ORDER BY
  day DESC

Show the number of transactions in each block

SELECT
  number,
  count(*)
FROM
  ethereum.blocks
group by 1 

LIMIT 10