Block structure
A Starknet block is a list of transactions and a block header that contains the following fields:
Name | Type | Description |
---|---|---|
|
|
The hash of the block’s parent. |
|
|
The number, that is, the height, of this block. |
|
|
The state commitment after the block. |
|
|
The Starknet address of the sequencer that created the block. |
|
|
The time at which the sequencer began building the block, in seconds since the Unix epoch. |
|
|
The number of transactions in the block. |
|
|
A commitment to the transactions included in the block. The root of a height-64 binary Merkle Patricia trie. The leaf at index \(i\) corresponds to \({h(\text{transaction_hash}, \text{signature})}\). |
|
|
The number of events in the block. |
|
|
A commitment to the events produced in the block. The root of a height-64 binary Merkle Patricia trie. The leaf at index \(i\) corresponds to the hash of the \(i'th\) event. |
|
|
The price of L1 gas that was used while constructing the block. L1 gas prices apply to storage updates and L1→L2 messages. As of March 2023, computation is also priced in terms of L1 gas, but this will change in the future. The first |
|
|
The price of L1 blob gas that was used while constructing the block. If the The first |
|
|
|
|
|
The version of the Starknet protocol used when creating the block. |
Block hash
A block hash is defined as the Pedersen hash of the header’s fields, as follows:
h(𝐵) = h( block_number, global_state_root, sequencer_address, block_timestamp, transaction_count, transaction_commitment, event_count, event_commitment, 0, 0, parent_block_hash )
Where h
is the Pedersen hash.
Zeros inside the hash computation of an object are used as placeholders, to be replaced in the future by meaningful fields. |
Several properties of the block header, such as |