Optimism chain

what is optimism

Optimism is a L2 chain of ethereum based on Optimistic Rollup protocol.

Mechanism

Block Storage

All Optimism blocks stores in a smart contract on Ethereum chain, making up CanonicalTransactionChain, aka CTC.
Optimism blocks are held within an append-only list inside of the CTC.

The CanonicalTransactionChain includes code that guarantees that the existing list of blocks cannot be modified by new Ethereum transactions. However, this guarantee can be broken if the Ethereum blockchain itself is reorganized and the ordering of past Ethereum transactions is changed. The Optimism mainnet is configured to be robust against block reorganizations of up to 50 Ethereum blocks. If Ethereum experiences a reorg larger than this, Optimism will reorg as well.

Block production

The single party “sequencer” produces all Optimism blocks.
What sequencer does:

  1. Providing instant transaction confirmations and state updates
  2. Constructing and executing L2 blocks
  3. Submitting user transactions to L1

It works like another Ethereum miner, but with some differences.

  1. The sequencer has no mempool, txs are immediately accepted or rejected in the order they are received
  2. It is single party
  3. It submits blocks in large batches to L1 network, to finalize Optimism blocks

Fee reducing

When the sequencer submits blocks to L1 network, it compress the blocks to reduce the amount of data publishing to L1.
Also it reducing fee on each tx by spreading fixed fees among multiple txs.

Anti-censorship by the sequencer

Users can skip the sequencer entirely and submit their own transactions directly to the CTC, to resist the censorship of the sequencer.
The cons are higher gas costs because the fixed cost will be paid totally by this single transaction.

L1-L2 bridging

From L1 to L2

To transfer from Ethereum mainnet to Optimism network, users simply need to trigger CTC contract to create a new block on Optimism chain.

From L2 to L1

To withdraw Eth from Optimism network, users need to make provable statements about the state of Optimism to contracts sitting on Ethereum.
The Optimism stated are published regularly to a smart contract on Ethereum called StateCommitmentChain.
Users can generate Merkle tree proofs about state of Optimism using commitments in StateCommitmentChain, then publish it through L2ToL1MessagePasser, a smart contract pre-deployed to the Optimism network.
These proofs will be verified by L1CrossDomainMessenger, another smart contract on Ethereum.