# Optimism Bedrock: Study Notes **Published by:** [bap2pecs](https://paragraph.com/@0xb2p/) **Published on:** 2023-01-30 **URL:** https://paragraph.com/@0xb2p/optimism-bedrock-study-notes ## Content 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 Stepsread Introducing the OP Stackwatch the talks given by OP Labs’ Karl Floersch and Kelvin Fichter at Devcon 6read 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-levelThe 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 committeeThe 3 primary layersConsensusDA: an array of byte strings. not necessary a ledgerDerivation: takes the DA layer and the current state of the rollup and produces Engine API payloadsExecution: state transitionSettlement: a view that another chain has over your chainKey InteractionsDepositWithdrawNote: step 4 is related to the concept of finalized L2 head.OverviewComponentsThe 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 ConceptsBlock DerivationEpochs and the Sequencing WindowDeposited Transactions: This is a new transaction type on L2 defined by the protocol.It’s important to understand that when tokens are deposited from L1 to L2, it’s technically “depositing the transactions to the L2“. The tokens are locked on L1 and then minted on L2.deposited transactions do not need a signature and rely on other mechanisms for authorization and validationL1 attributes deposited transaction and user-deposited transactionsL1 Attributes Depositor Account: an EOA with unknown private key.L1 Attributes Predeployed Contract: it’s important to know that the contract will be called in the first transaction of every L2 block (source). Every L2 block has an L1 attributes tx.Address AliasingBatch SubmissionData Availability Provider (e.g. Ethereum calldata)Sequencer Batch: each batch represents the inputs needed to build one L2 blockBatcher Transaction: a transaction submitted by a batcher to a data availability providerChannel and Channel FrameThe diagram below illustrates these concepts as a wholeL2 Chain DerivationL2 Derivation InputsSystem Config: batcherHash stores the current authorized batcher sender(s)Payload Attributes: object to be passed to the execution engineL2 Chain Inception: the L1 block number where the L2 genesis startsFinalized L2 Head, Safe L2 Head, Unsafe L2 Head, Unsafe Block Consolidationit’s important to distinguish the difference of finalizing the L2 head with the concept of finalization period. The former form of finalization only affects inputs while the later affects Optimistic-rollup outputs.Fork Choice Rule: to determine the blockchain headTime Slot: every 2 second per L2 block ## Publication Information - [bap2pecs](https://paragraph.com/@0xb2p/): Publication homepage - [All Posts](https://paragraph.com/@0xb2p/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@0xb2p): Subscribe to updates