Modular stack part 1: execution layers and virtual machines
Thread934 words
Explains monolithic versus modular design (execution, settlement, DA, consensus) and walks through the EVM and the three routes to a zkEVM: prove the EVM trace directly, map EVM opcodes to a custom VM, or transpile Solidity to a custom VM.
Key claims
zkEVM route 1: prove the EVM execution trace directly (Scroll)
Route 2: custom VM mapping EVM opcodes (Polygon)
Route 3: transpile Solidity to a custom VM (zkSync, StarkWare)
0/ The modular thesis will change how we build blockchains! 🧱
It will also shape the the scalable & secure execution layers that will lead us into the bullrun! 🚀
Find part 1 of an extensive 🧵-Series on modular building blocks below!
Today's topic: Execution (VMs)
🧵 (0/60)
1/ The 🧵-Series will cover:
🔹 Execution (VMs)
🔹 DA Layers
🔹 Sequencers
🔹 MEV-aware Block Builders
🔹 RaaS / SDKs / Infrastructure
🔹 Interoperability
Today, we kick off the series with "Execution" 👇
2/ Before we dive into the world of execution layers or more specifically virtual machines, let's have a quick look at what modular blockchain architecture actually is. 🧱
3/ In monolithic networks (e.g. Ethereum) execution, settlement & consensus/DA are unified in one layer.
4/ But what do all these terms mean? Let's have a quick look! 👇
5/ 🧱 Data Availability:
The concept that data that is published to a network that is accessible and from where data retrievable by all network participants (at least for a certain time).
6/ 🧱 Execution:
Defines how nodes on the blockchain process transactions to transition the blockchain between states.
7/ 🧱 Settlement:
Finality (probabilistic or deterministic) is a guarantee that a tx commited to the chain is irreversible. This only happens when the chain is convinced of tx validity. Hence, settlement means to validate txs, verify proofs & arbitrate disputes.
8/ 🧱 Consensus:
The mechanism by which nodes come to an agreement about what data on the blockchain can be verified as true & accurate.
9/ But while this monolithic design approach has some advantages of its own (e.g. with regards to reduced complexity & composability), it doesn't necessarily scale well.
10/ That's why modularists strip these things apart and have them done by separate, specialized layers. 🧱
The modular design space hence consists of:
🔹 Execution layers (the rollup, e.g. @Arbitrum)
🔹 Settlement layers (e.g. $ETH)
🔹 Consensus/DA layer (e.g. @CelestiaOrg)
11/ Interesting, right? So, let's dive into the world of execution layers a bit more.
Execution layers built on top of Ethereum (that acts as a settlement layer) are also called rollups.
12/ Strictly speaking, "true" rollups also use Ethereum for data availability. But we will use the term rollups more generally here and use it to refer to modular execution layer configurations more broadly.
13/ For an introduction to rollup-based scaling, have a look at my thread below. 👇
x.com/expctchaos/status/1527419709616013313
14/ Rollups are complex systems that can have different state validation mechanisms (optimistic rollups vs. validity rollups), can have varying sequencer (and prover) designs, DA solutions and so on.
15/ But since the execution itself is where the smart contract magic is taking place, what really defines how execution looks like, this thread will focus on the different virtual machines that these rollups could run.
16/ In this thread we will cover:
🔹 EVM
🔹 zkEVM
🔹 CairoVM
🔹 CosmWasm VM
🔹 Sealevel VM
🔹 Move VM
So let's dive in! 👇
17/ ⚙️ Ethereum Virtual Machine (EVM)
The EVM is a piece of software that executes smart contracts & computes the state of the $ETH network after a new block is added to the chain.
18/ The EVM sits on top of the Ethereum hardware & node layer.
Its main purpose is computing the network's state & compiling various types of smart contract code (written in human-readable languages) into a machine-readable format called bytecode to run the smart contracts.
19/ The EVM hence powers smart contract execution and is one of the core features of Ethereum.
Instead of a classic distributed ledger of transactions, the EVM basically transforms Ethereum into a distributed state machine.
20/ Ethereum's state is a large data structure which holds not only all accounts & balances, but also an overall network or machine state which can change from block to block according to a pre-defined set of rules.
21/ The specific rules of changing state from block to block are defined by the EVM. At any given block in the chain, Ethereum has one & only one canonical state with the rules for valid state transition being defined by the EVM spec.
22/ The EVM is not only what defines how execution works on Ethereum L1, it is also a very popular choice of execution environment for many rollups.
This makes sense, as the largest dev pool by far in Web3 is the EVM/Solidity community.
23/ While optimistic rollups running the EVM have been around for a while, zk-rollups with EVM support are rather nascent.
24/ ⚙️ zkEVM
With the emergence of zk (a.k.a validity) rollups, the term zkEVM became popular quickly.
But what is it? 🤔
25/ A zkEVM is a virtual machine that executes smart contracts in a way that is compatible with zero-knowledge-proof computation and the programming languages supported by the originial EVM.
26/ However, this can be quite difficult to build.
A zkEVM rollup's main goal is to run EVM bytecode.
27/ Unfortunately though, zk proofs require all the computational statements they are proving to be converted into a very specific format to then be compiled down into a STARK/SNARK.
28/ Luckily, there are a few ways to do it though:
1️⃣ Prove the EVM execution trace directly by converting it into the verifiable format (e.g. @Scroll_ZKP)
29/
2️⃣ Create a custom VM, map EVM opcodes to opcodes for that VM & prove correctness of the trace in that custom environment (e.g. @0xPolygon)
30/
3️⃣ Create a custom VM, transpile Solidity into the custom VM’s bytecode (directly, or via a custom high level language) & prove in a custom environment (@zkSync & @StarkWareLtd)

4 more images on X
What came next · since 30 Aug 2023
Show how the covered asset moved
This explainer walks through how things work without making a call on the token, so price moves since publication are shown as market context.
Mentioned for context
Since then
Zero has written 9 more pieces on Ethereum since this one.
Daily closes in USD from DefiLlama and Yahoo Finance. Only a bullish or bearish call in a thesis or market take is tracked; explainers, lists, maps and mentions are neutral context. Not financial advice.