Optimism Bedrock: Study Notes

Disclaimer: My goal is to learn the OP Bedrock protocol quickly so I can understand the code more easily to be able to plug in with my own DA layer to the OP stack. So I only read the things I think that can be helpful. The goal is not to understand every piece of the details.

Study Steps

  1. read Introducing the OP Stack

  2. watch the talks given by OP Labs’ Karl Floersch and Kelvin Fichter at Devcon 6

  3. read the following specs: Introduction, Overview, Deposits, Rollup Node, Batch Submitter, System Config, L2 Chain Derivation(*)

*: for the derivation spec, I started to skip lots of the details from section Batch Queue

It should take ~2-3 days to study everything on this list.

High-level

  • The OP stack is modular and minimal. It’s easy to swap with your own e.g. consensus, DA layers. The Superchain vision is able to scale horizontally.

  • Example: Metis forked OP and customized the DA layer with a DA committee

  • The 3 primary layers

    • Consensus

      • DA: an array of byte strings. not necessary a ledger

      • Derivation: takes the DA layer and the current state of the rollup and produces Engine API payloads

    • Execution: state transition

    • Settlement: a view that another chain has over your chain

Key Interactions

Deposit
Deposit
Withdraw
Withdraw

Note: step 4 is related to the concept of finalized L2 head.

Overview

Components
Components

The L2OutputOracle is a L1 contract to store rollup states (i.e. L2 output roots) and manage withdrawals. It will be helpful to think of it as the rollup output store and DepositFeed and BatchInbox as the rollup input store. So the L1 is simply the DA layer for storing rollup inputs and outputs, and the L2 is the computing layer.

DepositFeed is for a special transaction type (i.e. Deposited Transaction) on L2 defined by the Optimism protocol. BatchInbox is for the other normal L2 transactions (i.e. only transaction inputs) that are batch-submitted to L1.

It’s also useful to know that the BatchInbox is a regular EOA address (note: for saving gas cost by not executing any EVM code). The sequencer submits L2 transaction batches included in the calldata of the L1 transaction to the address.

Key Concepts

Subscribe to bap2pecs
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.