Skip to content

Block states

How can you determine when a Taiko block is Safe or Finalized?

The Safe block state on Taiko is analogous to a Safe block state on Ethereum. Every Taiko L2 block has a corresponding Ethereum L1 block as it’s origin that can be queried through a taiko-geth API. When that Ethereum L1 block can be considered Safe, the corresponding Taiko L2 block can be considered to have reached the same block state.

The Finalized block state is referred to as the Verified block state on Taiko. A Taiko block is Finalized/Verified when every state transition from genesis to the current block has valid proofs.

Example Query and Response:

query.json
{
"method": "taiko_l1OriginByID",
"id":1,
"jsonrpc":"2.0",
"params":[ "0x19a3c" ]
}
response.json
"result":
{
"blockID": "0x19a3c",
"l2BlockHash": "0x0905c85f9a288ebe94eb85743a65c8cf6266097b8b826cdca4f4018e6267c26a",
"l1BlockHeight": "0x16ef0f",
"l1BlockHash": "0x419f0c5b2cc90078c7040c3b90d174895ce83d76ebfdd75ad2dd5521036d0938"
}

The above Taiko block with blockID 0x19a3c would thus be considered Safe if the L1 block with the blockHash 0x419f.. reaches a Safe state.

The Taiko block with blockID 019a3c would be Finalized/Verified if every state transition from genesis to the current block has a valid proof.