How Does Optimism Blockchain Work?

We have already discussed how the Optimism Blockchain uses the optimistic rollup method, processing transactions in batches instead of one by one. Let’s dive deeper into the working of this layer 2 mini-blockchain.

Block Storage

The Optimism Blockchain stores its block on Ethereum using a smart contract called the Canonical Transaction Chain (CTC). The CTC comprises an append-only list of blocks that can only be added to, not changed or removed. Unless the Ethereum network itself goes through a reorganization, the CTC’s code ensures that newer transactions on Ethereum cannot alter the current list of blocks.

Block Production

The Optimism Blockchain produces and processes transactions or ‘deposits’ using a special node called the sequencer. The primary functions of the sequencer include:

  • Instantly confirming transactions & updating states

  • Producing & executing blocks on layer 2

  • Submitting user transactions on the Ethereum mainnet.

After receiving the transactions from the users, the sequencer batches them into blocks. It then utilizes its own virtual machine, equivalent to the Ethereum Virtual Machine (EVM), followed by submitting the blocks to the CTC as calldata – a way of storing data on Ethereum without executing it. The CTC also publishes state roots, which represent the state of the Optimism Blockchain after each block as hashes.

Block Execution

To execute blocks and verify transactions, the Optimism Blockchain utilizes another type of node called the Verifier. It utilizes the state roots or hashes published by the sequencer. It verifies the transactions by comparing them with the state roots it calculates by replaying the transactions on its own virtual machine. If they match, it indicates that the transactions are valid and consistent. In case they don’t, it means the transactions are invalid or there is a discrepancy in the state. In such an event, the verifier can challenge the sequencer by submitting fault proof to the Ethereum chain and claim a reward.

Optimistic Assumption
Optimistic Assumption

The assumption that the transactions are valid can be challenged within seven days (commonly called the Challenge Window) of the state commitment. A challenger can typically utilize Ethereum’s data availability and the sequencer’s Merkle root to identify errors or manipulations during the challenge window.

Security Mechanism

When it comes to addressing security challenges and risks, Optimism is currently working on two primary issues: Smart contract security risks and protocol upgrades.

Concerning smart contract security issues, while Optimism has undergone several audits, it doesn’t guarantee a bug-free protocol. However, the protocol is offering a $2 million bounty if the whitehats can find bugs in a codebase.

As far as protocol upgrades are concerned, optimism currently uses a centralized mechanism, wherein fast upgrade keys are used to make quick changes to the protocol. This allows the team to fix any issues or improve protocol faster.

Subscribe to Diaryofdero
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.