Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

This article is approximately 1502 words,and reading the entire article takes about 2 minutes
The core value of Scroll is to implement a more powerful version of Ethereum.

Original title: An Introduction to Scroll: the General-purpose Zero-Knowledge Rollup

Original author:FRANCESCO

Original compilation: Peisen, BlockBeats

Editors Note: The Ethereum Layer 2 network Scroll based on ZK Rollup has received great attention from the industry since last year. Scroll announced in April 2022 and March this year respectively the completion of a US$30 million Series A financing led by Polychain Capital and US$50 million in participation from Polychain Capital, Sequoia China, IOSG Ventures, Qiming Venture Partners and OKX Ventures. Financing.

On October 10, the Ethereum Layer 2 solution Scroll mainnet generated the genesis block at 2 pm that day. On October 17, Scroll officially announced that the main network has been officially launched. Subsequently, some projects began to integrate or support the Scroll main network to provide users with more application scenarios and services.

According to the Blockscout Scroll mainnet Token page, if you refer to the tokens currently holding the largest number of addresses, the projects that are attracting attention include Merkly, Zonic on Scroll, PunkSwap Token, Skydrome, Scroll Name Service, Scroll Doge (zkDoge), Scrollswap Finance Token (SF ), Script (SCRIPT), Scroll Inu. (Sinu).

Related Reading:Scroll mainnet launch: Which Dapps are users interacting with?

As a universal ZK-Rollup based on zkEVM, Scroll is designed to provide the highest level of EVM compatibility for existing applications and tools. Encryption researcher @francesco web3 studied Scroll’s technical principles, workflow, and current development status, and raised several issues worthy of attention and consideration. BlockBeats compiles the original text as follows:

Universal zk-Rollup

On October 10, Scroll mysteriously released a message announcing the official launch of its mainnet. Apart from the airdrop mining post, I don’t know much about this event. So I decided to delve deeper into this event!

Learn about Scroll

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

Scroll is a scaling solution for Ethereum: a general-purpose Layer 2 (L2) zero-knowledge (zk) rollup. This may sound like a lot of jargon, so let’s explain them one by one.

As an L2 rollup on Ethereum, Scroll essentially inherits the security of ETH.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

In addition to security, Scroll offers seamless integration with the rich Ethereum ecosystem, including tools, dApps, smart contracts, and a large user base.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

This approach enables these resources to be easily transferred and used interchangeably, ensuring EVM compatibility. It can be said that for users and developers, Scroll is almost Ethereum.

Before Scroll, there was no universal zero-knowledge (zk) rollup due to the complexity of generating zero-knowledge proofs for Ethereum Virtual Machine (EVM) computations. In short, being a general rollup means having equivalent functionality to the EVM. However, until now, successfully running an EVM environment on zk rollup has been an elusive goal. This is primarily due to the complexity of converting EVM transactions into zk-proof interpretable logic circuits.

It is this complexity that explains why the zk-rollup project only focuses on specific applications, such as dYdX on trading and ImmutableX on NFTs. Due to technical difficulties, it is impossible to develop a universal network that can deploy various DApps. This is why zk-rollup performs poorly in terms of total value locked (TVL) and number of users compared to op-rollup.

Related Reading:[Rollup Series] Part 1: Scroll, the dream of native zkEVM

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

Despite these challenges, the search for universal zero-knowledge (zk) rollup continues. Compatibility with EVM is a big deal as it greatly simplifies the effort required for developers to move to a new chain. For example, moving to a non-EVM chain means:

  • Existing contracts need to be migrated and rewritten to the new rollup

  • Not supported by existing EVM tools (e.g. libraries, wallets, markets, etc.)

  • Unable to support applications from the Ethereum ecosystem

Many people have begun to develop general zk EVM, and their compatibility with EVM can be seen from different levels:

Starknet and zkSync (language level): These are currently dedicated solutions running using a custom virtual machine (Cairo VM). They ran a custom VM and created a compiler Warp Transpiler to convert Solidity code into Cairo VM bytecode.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

What they did was create a new VM and add Ethereum tooling support as an additional layer on top of it. This still achieves the goal of making Solidity contracts exportable to StarkNet, thereby making them EVM compatible. Although it does not implement the EVM directly, it retains compatibility and lets Solidity developers write code for their rollups.

When using these solutions:

  • You are not executing inside the EVM

  • You have no compatibility with other Ethereum interfaces

  • Solidity developers can write code that can be used on your rollup

This is a good compromise.

Polygon zk-EVM (bytecode level): runs a custom VM but has all EVM opcodes mapped to opcodes valid for its VM (opcode-level equivalence). Polygons approach is to build a zkEVM with opcode-level equivalence. Compared to Scroll, Polygon has an alternative runtime (zkExecutor) that runs a custom zkASM opcode instead of directly running the EVM opcode. This is done to optimize the EVM interpretation, since proving EVM directly would have too many constraints.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

The image below shows what the process looks like behind the scenes:

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

Although this configuration is more efficient than Scroll, it adds a significant amount of custom code (used to create zkASM), may require code or tooling modifications for compatibility, and may become increasingly different from Ethereum over time (For example, gas prices may be different, code bases may be increasingly different). Scroll (bytecode level): Converts EVM executions directly into verifiable circuits, providing benefits in tool support and compatibility.

Although this configuration is more efficient than Scroll, it adds a lot of custom code to create zkASM, may require code or tooling modifications for compatibility, and may become increasingly different from Ethereum over time. For example, gas fees may vary, and the codebase may change over time.

Scroll (bytecode level): Converts EVM executions directly into verifiable circuits, bringing benefits in terms of tool support and compatibility.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

Currently, Scroll does not support all EVM opcodes, but they plan to eventually do so over time. Much of the previous content comes from Immutables excellent explanation of the subject.

How does Scroll work and what is its technology stack?

Scroll is a zk rollup that has a smart contract on Eth L1, which is a zkEVM proof validator that can verify whether the Scroll protocol is secure.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

How does trading work on Scroll?

Scroll is able to batch process blocks and write block data to Ethereum. Once a proof of validity is generated on a subsequent block, it will be written to Ethereum.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

Therefore, on Scroll, blocks can have three states:

Pre-commit: A block has been proposed by the sequencer and included in the Scroll.

Submitted: The transaction data of the block has been published to Ethereum (in Scrolls rollup contract).

Finalized: Correct execution has been confirmed by a proof of validity published on the Ethereum chain.

Transaction workflow

Transactions from the sequencer are packaged into a block;

The data and call data are submitted to the rollup contract of L1, and the block is submitted (D 1);

Proof generation: The information is passed to the coordinator (the trace of the completed work), and then passed to the prover to generate a zk proof;

Proof generation can be performed in multiple blocks, executed in parallel, and passed to different provers;

Aggregated proof generation: Proofs are generated and aggregated in batches, which will then be submitted and verified on-chain (validation);

The block is finalized.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

Transaction > Processed by node running Geth fork > Execution trace > Enter zkEVM circuit > Generate proof > Enter into aggregation, show proof is valid > Generate aggregation proof > Send to L1 contract

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

Why choose Scroll?

Developer-friendly: Scroll provides bytecode equivalent to the EVM, ensuring compatibility with existing contracts and tools.

High efficiency: Scroll creates a more secure block space for Ethereum and effectively reduces gas costs.

Fast response: Scrolls block time is only 3 seconds, which is significantly faster than Ethereums 12 seconds.

Maintaining consistency: Scroll is aligned with the Ethereum vision, and its team also contributes code to Ethereum’s privacy and scaling processes.

Continued popularity

Since its release, Scroll’s total locked value (TVL) has accumulated to more than $1.5 million, showing a steady growth trend.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

More than 1383 users have bridged ETH on Scroll.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

More than 976 ETH have been bridged to the Scroll mainnet, with a total value of approximately $1.5 million.

Dismantling Scroll’s technology stack: the operating mechanism of universal ZK-Rollup

Questions worth thinking about

zk-rollup is seen as superior to the design of optimistic rollup competitors, especially in terms of privacy. Since there is no fraud proof, there is no need to wait for withdrawal delays.

As a general zk-rollup, Scroll features bytecode compatibility and provides many advantages of zk proof at the L2 level without affecting the tools and network effects of EVM.

Full EVM compatibility is seen as the ultimate goal of L2, and this is where Scrolls core value lies: a more powerful version of Ethereum. Scrolls bytecode compatibility perfectly combines all the advantages of zk-proof with the maximum compatibility of Ethereum.

It is worth mentioning that Scroll focuses more on the synchronization aspect of zk proofs rather than its privacy aspects, which allows the protocol to compress a large amount of calculations into a tiny proof.

Also worth noting is Scroll’s commitment to decentralization. Although there will be a centralized sequencer initially, plans for decentralization are already in the works.

In addition, all zk proofs will eventually be completed by a decentralized certifier network.

Original link

Original article, author:区块律动BlockBeats。Reprint/Content Collaboration/For Reporting, Please Contact report@odaily.email;Illegal reprinting must be punished by law.

ODAILY reminds readers to establish correct monetary and investment concepts, rationally view blockchain, and effectively improve risk awareness; We can actively report and report any illegal or criminal clues discovered to relevant departments.

Recommended Reading
Editor’s Picks