Skip to content

TaikoL1

TaikoL1 is the core Layer 1 smart contract in the Taiko Alethia protocol. It is responsible for block lifecycle management, state synchronization, and bond management. TaikoL1 ensures seamless interaction between L1 and L2, enabling a secure and scalable rollup architecture.

Features

  • Block Lifecycle Management: Handles block proposal, proving, and verification.
  • Cross-Layer Synchronization: Ensures state consistency between L1 and L2.
  • Bond Management: Maintains economic security by requiring bonds for block proposers.
  • Scalability: Supports Layer 3 (L3) deployments, expanding Taiko’s rollup capabilities.

Contract Methods

proposeBlockV2

Submits a single block proposal to the rollup.

Input ParameterTypeDescription
_paramsbytesEncoded block parameters.
_txListbytesList of transactions to include in the block.

Returns:

  • TaikoData.BlockMetadataV2: Metadata of the proposed block.

proposeBlocksV2

Submits multiple block proposals in a batch.

Input ParameterTypeDescription
_paramsArrbytes[]Array of encoded block parameters.
_txListArrbytes[]List of transactions for each block.

Returns:

  • TaikoData.BlockMetadataV2[]: Array of metadata for all proposed blocks.

proveBlock

Submits a validity proof for a specific block.

Input ParameterTypeDescription
_blockIduint256ID of the block to prove.
_inputbytesEncoded proof data.

proveBlocks

Submits batch proofs for multiple blocks.

Input ParameterTypeDescription
_blockIdsuint256[]Array of block IDs to be proven.
_inputsbytes[]Proofs for each block.
_batchProofbytesBatch proof covering all blocks.

verifyBlocks

Verifies a batch of blocks after proofs are submitted.

Input ParameterTypeDescription
_maxBlocksToVerifyuint256Maximum number of blocks to verify.

depositBond

Locks a bond deposit required for proposing blocks.

Input ParameterTypeDescription
_amountuint256Amount of bond to deposit.

withdrawBond

Withdraws a bond deposit after block proposals are finalized.

Input ParameterTypeDescription
_amountuint256Amount of bond to withdraw.

getLastVerifiedBlock

Retrieves the most recent verified block.

Return ValueTypeDescription
blockId_uint256ID of the last verified block.
blockHash_bytes32Block hash of the verified block.
stateRoot_bytes32State root of the verified block.
verifiedAt_uint256Timestamp when the block was verified.

Events

BlockProposed

Triggered when a new block is proposed.

Event ParameterTypeDescription
blockIduint256ID of the proposed block.
proposeraddressAddress of the proposer.
txRootbytes32Root of the transactions included in the block.

BlockProven

Triggered when a validity proof is submitted for a block.

Event ParameterTypeDescription
blockIduint256ID of the proven block.
proveraddressAddress of the prover.
proofHashbytes32Hash of the submitted proof.

BlockVerified

Triggered when a block is verified and finalized.

Event ParameterTypeDescription
blockIduint256ID of the verified block.
verifieraddressAddress of the verifier.
stateRootbytes32State root of the verified block.

Constants

Constant NameValueDescription
BLOCK_BOND_AMOUNTConfigurableRequired bond for proposing a block.
MAX_PROPOSAL_BATCH_SIZE10Maximum number of blocks proposed in a batch.
MAX_VERIFICATION_BATCH5Maximum number of blocks verified at once.

Design Considerations

  1. Ethereum-Equivalent Execution

    • The contract follows Ethereum’s rollup-centric roadmap, allowing Ethereum-equivalent execution.
    • No modifications to EVM opcodes, ensuring compatibility.

  2. Based Rollup Architecture

    • Blocks are proposed permissionlessly, following Ethereum’s L1 sequencing rules.
    • No centralized sequencer; TaikoL1 ensures censorship resistance.

  3. Multi-Proof System

    • Supports multiple proving mechanisms: SGX, ZK, hybrid proofs.
    • Ensures security even if one proof system is compromised.