Scroll is a second-layer blockchain (Layer 2 — L2) designed to scale Ethereum. It uses ZK-Rollups — rollups with zero-knowledge proofs (ZKP) to bundle transactions outside of the main network (L1), while only the cryptographic proof that the transactions have been processed correctly, and the compressed transaction data are sent to L1.
Developed in collaboration with the Privacy and Scaling Explorations group at Ethereum Foundation for over a year.
In this article, we’ll look at the main technical principles of blockchain that influenced the design of the blockchain, and give an overview of the general architecture of Scroll.
We’ll detail about Scroll, which consists of a centralized sequencing node (execution node, rollup node) and a decentralized network (roller net), show the architecture and the rollup working process.
It is assumed that you are already familiar with the terms zkp.
Technical Principles and Premises for Blockchain CreationThe technical principles that were fundamental and what influenced the design of the blockchain can be studied in detail in this article.
ArchitectureTo understand how the blockchain works, you first need to understand what levels of architecture exist and what they consist of.
Let’s look at the high-level general architecture according to the picture below.
Settlement LayerThis layer is located in Ethereum and consists of two contracts — Bridge Contract and Rollup Contract.
Bridge Contract:
Rollup Contract:
This layer consists of nodes — Execution Node and Rollup Node.
Execution Node:
First off, it’s important to mention that as of now, this is a centralized node and one of the key components of the protocol.
It’s responsible for:
Rollup Node:
This layer consists of the Provers module and Coordinator.
Provers:
This is a pool of validators in a decentralized network.
They are responsible for creating zkEVM validity proofs, which verify the correctness of L2 transactions.
Coordinator:
The Coordinator, in turn, is a module that sends verification tasks to a random Prover and passes the proofs to the Rollup Node for finalizing transactions in Ethereum.
Rollup ProcessLet’s dive into the details of the scheme.
First, let’s break down what the nodes consist of.
Execution Node contains the following modules:
Rollup Node contains the following modules:
Thus, the Rollup process consists of three stages:
Now let’s walk through each point in the scheme.
Transactions are checked and executed in the Execution Node1. Users send transactions through the L1 bridge or directly to the L2 network.
2. Sync Service extracts the latest added L1 transactions from the Bridge contract.
3. L2 Sequencer (Execution Node) processes transactions from the queue that came from L1, as well as from the L2 mempool, and creates L2 blocks.
Transactions are packaged into batches and changes are fixed in L14. Rollup Node tracks the latest L2 blocks and extracts transaction data.
5. Rollup Node proposes a new chunk or batch and records it in the database. For more on how block, chunk, and batch creation occurs, I recommend checking here.
6. After creating a new batch, the Relayer collects transaction data in this package and sends a commit transaction to the Rollup Contract to ensure data availability. Thus, preliminary data fixation in L1 takes place.
Proof generation and submission to the Rollup contract for transaction finalization.7. The Coordinator queries the new chunk or batch from the database:
- If a new chunk has been created, the Coordinator will request the execution trace of all blocks in this chunk from the L2 sequencer (execution node), and then send the chunk verification task to a randomly selected verifier (prover).8. Once the Coordinator receives chunk or batch proofs from the verifier (prover), it will record the proof in the database.
9. As soon as the rollup relayer sees a new batch in the database, it sends a Finalize transaction to the Rollup Contract to verify the proof.
Thus, as you might have noticed, there is a specific life cycle of transactions.
Transaction Life CycleAs shown in the picture, in Scroll, transactions are grouped at several levels.
Thus, transactions are initially packed into blocks, then blocks into chunks (for sending to proof generation in prover), and then, chunks are packed into batches (for data fixation in L1 or proof verification).
Differences between zkEVM and EVM in ScrollDevelopment tools and differences of the Scroll blockchain from Ethereum have been discussed here
Scroll InfrastructureScroll’s infrastructure is rapidly gaining momentum and already includes dozens of protocols: Bridges, DeFi, infrastructure protocols, and more. (See the current list here).
Pros and Cons of ScrollProsThe Scroll protocol looks very promising. Developing for Scroll is currently easier than for blockchains that are less compatible with EVM.
Hope you enjoy this material, if you want to know more about blockchains, smart contracts and web3 architecture, stay tuned, we will publish more interesting materials:)
If you want to know about startup and business cases in web3 — join us in our Magazine.
LinksHow Scroll blockchain works: technical details and architecture overview was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.