Scroll Architecture
Good day, my readers. I know a blue-chip project when I see one, and Scroll is one. Positioned and aligned with the right narrative, ETH ethos, great team, well-funded, and everything good. We're very early in this project as they have not launched mainnet yet. I think this is my first time writing about Scroll. Yes, in the past, I've kept name-dropping it and giving lil explainers, but today I'll write about an aspect of it.
Without any further ado, we can proceed. Oh, and fear not, it'll be easily understandable.
The Scroll Architecture consists of three infrastructure components - the Scroll Node, Roller, and Rollup and Bridge Contracts.
The Scroll Node is responsible for constructing and rolling up L2 blocks to Eth L1 through the sequencer. It also facilitates communication between L1 and L2 via the Relayer.
The Scroll Node comprises three parts: the Sequencer, Coordinator, and Relayer.
The Sequencer is a fork of the popular Geth node, chosen for its reliability, maximum security, and time-tested reputation. The Sequencer accepts L2 transactions from the L2 mempool and executes them to create a new L2 block, updating it to the current state.
Coordinator- The execution trace of this block is received by the Coordinator, which then passes it on to the Roller for proof generation.
Relayer- Perhaps Relay-Watchdog would have been a more suitable name for this role! 😂 Jokes aside, the Relayer's job is to monitor (like a watchdog) the rollup contract to ensure the data availability, validity, and general status are all in check. It also keeps an eye on the deposit and withdrawal events from the bridge contract on Scroll and ETH and relays messages between them.
Roller- The Roller is responsible for generating validity proofs for L2 transactions. It uses zkp (zero-knowledge proof) hardware accelerators, such as GPUs, FPGAs, and ASICs, to speed up the proof generation process and reduce its cost. This is because there are bottlenecks involved in proof generation, and accelerators help solve this.
If you wanna know more on that, this will help
The roller functions in 3 steps:
1. We talked about the execution trace earlier; yes that’s right, the execution trace from the coordinator, is converted by the roller to circuit witness.
2. Then generated proof for each of the zkEVM circuit
3. Uses proof aggregation to to combine multiple zkEVM circuits to a single proof. Note: a zk circuit is made arithmetically
More on proof aggregation
Rollup and Bridge Contract- This is the DA layer of Scroll and used for messaging between L1 and L2; it does this by connecting to the base layer of Ethereum.
Rollup Contract. It receives L2 state root and block data from the sequencer. It stores the state root on Ethereum state and block data as call data on ETH. This provides DA support for Scroll and ensures the L2 block reconstruction by the Relayer. An L2 block is considered finalized on Scroll only when the L2 block’s validity has been verified by Rollup Contract.
Bridge Contract. It’s a trustless messaging/bridging protocol on scroll that aids the transfer of ERC-20 assets between the L1 and L2
This is the Workflow of Scroll’s zkR
This workflow consists of all the components mentioned above
This is how L2 blocks are generated and finalized on ETH:
First, the Sequencer creates a sequence of blocks, and for each block, it generates an execution trace and sends it to the Coordinator while also submitting the transaction data to the Rollup contract.
Next, the Coordinator randomly selects a Roller to generate a validity proof for each block trace. The Roller then sends the block proof back to the Coordinator, and for every k blocks, an aggregation task is dispatched to another Roller to combine k block proofs (k here signifies the number of blocks) into a single aggregate proof.
Finally, the aggregated proof is sent to the rollup contract by the Coordinator, to finalize L2 blocks.
Resource - https://scroll.io/blog/architecture