DEV Community

Prajal Sharma
Prajal Sharma

Posted on

Taiko Protocol

Taiko protocol overview:

https://taiko.mirror.xyz/y_47kIOL5kavvBmG0zVujD2TRztMZt-xgM5d4oqp4_Y?ref=bankless.ghost.io

Image description

Proposing Taiko blocks

On Taiko, the next L2 state is known immediately and deterministically at the time a block is proposed to the TaikoL1 contract. After a block is proposed, a series of checks are done to compute this post-L2 state:

  1. Block is proposed by any proposer
  2. Block level properties' validity is checked by the TaikoL1 contract
  3. Proposed block is downloaded by a Taiko node, and the transaction list is parsed over and checked for validity

• IF every transaction in the list is valid, an ordered subset of the list is created and used along with the anchor transaction to create a Taiko L2 block.

• IF any transaction in the list is invalid, an empty block (with only the anchor tx) is created on L2.

Building the blocks

Once a proposer has collected enough transactions, presumably including and ordering them with the intent to generate a (maximum) profit, they create a new L2 block with an anchor transaction. Profit means that for the proposer, the sum of transaction fees (L2 tx fees) from the block is larger than L1 tx fee + prover fee + EIP-1559 base fee.
Then there are validity checks performed at the node (or sometimes protocol) level as well:

  • Asserts that the length of the transaction list does not exceed a predefined maximum (MAX_TX_LIST_BYTES)
  • The transaction list is decoded into a list of transactions (txList)
  • The amount of gas required to include transactions is available
  • The transaction signature and the transaction nonce are valid.
  • The sender account has no contract code deployed (EIP-3607)
  • The transaction's gas limit is no smaller than the intrinsic gas
  • The sender has enough balance to cover the transaction (gasLimit * gasPrice + tx.value)

The block execution is deterministic. When the block is proposed, the block data is published on Ethereum, and the block is appended to the proposed block list stored in the TaikoL1 contract. After that, all block properties are immutable.

All Taiko nodes connect to Ethereum nodes and subscribe to Ethereum's block events.

Proving Taiko blocks

The purpose of proving blocks is to give certainty and proof to bridges about the execution that happened in the rollup.

Currently, any prover can create proofs for proposed blocks. Only first prover with a valid proof of the correct state transition will receive the reward.

There are three states that a block can be in on Taiko:

  • Proposed
  • Proved
  • Verified

A block is proved if it has a valid proof which proves a state transition from one state (parent block) to another (current block). However, blocks are proven in parallel by the decentralized provers. So while a block can prove a parent block transitions to the current block, we don't know if the parent block itself has been proven. As you can see, for a block to be "verified", it needs to prove the valid state transition to the current block, but the parent also needs to be verified.

Top comments (0)