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)
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" 👇
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. 🧱
In monolithic networks (e.g. Ethereum) execution, settlement & consensus/DA are unified in one layer.
But what do all these terms mean? Let's have a quick look! 👇
🧱 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).
🧱 Execution:
Defines how nodes on the blockchain process transactions to transition the blockchain between states.
🧱 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.
🧱 Consensus:
The mechanism by which nodes come to an agreement about what data on the blockchain can be verified as true & accurate.
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.
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)
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.
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.
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.
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.
In this thread we will cover:
🔹 EVM
🔹 zkEVM
🔹 CairoVM
🔹 CosmWasm VM
🔹 Sealevel VM
🔹 Move VM
So let's dive in! 👇
⚙️ 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.
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.
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.
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.
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.
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.
While optimistic rollups running the EVM have been around for a while, zk-rollups with EVM support are rather nascent.
⚙️ zkEVM
With the emergence of zk (a.k.a validity) rollups, the term zkEVM became popular quickly.
But what is it? 🤔
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.
However, this can be quite difficult to build.
A zkEVM rollup's main goal is to run EVM bytecode.
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.
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)
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)
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)
For more on the different types of zkEVMs have a look at the below thread I wrote a while back. 👇
Note: Starknet is also included in the below thread, which is not strictly correct as it runs CairoVM, rather than a zkEVM.
twitter.com/expctchaos/status/1569717615282782209
⚙️ CairoVM
One such custom environment is the CairoVM, developed by @StarkWareLtd, which is building @Starknet.
Starknet is based on the Cairo programming language, which is optimized for zk-proofs.
To enable smart contracts & composability, StarkNet takes a language-level compatibility approach & transpiles EVM-friendly languages (e.g. Solidity) down to a STARK-friendly VM (in Cairo).
One of many cool features that CairoVM execution layers have, is the native support for account abstraction (something that does is not natively supported by the EVM).
⚙️ CosmWasm VM
CosmWasm is a smart contracting platform built for the Cosmos ecosystem. Simply put, it's the Cosmos (Cosm) way of using WebAssembly (Wasm) hence the name.
CosmWasm is written as a module that can plug into the Cosmos SDK.
This means that anyone currently building a blockchain using the Cosmos SDK can quickly and easily add CosmWasm smart contracting support to their chain, without adjusting existing logic.
The CosmWasm VM can also be used in modular rollups, which is heavily simplified by Rollup-as-a-Service (RaaS) providers like @vistaralabs.
What makes the CosmWasm VM powerful, are WebAssembly (WASM) smart contracts.
They offer a multitude of benefits over Solidity contracts, making them a robust choice for a wide array of applications.
The benefits include:
- Superior performance
- Broad language support
- Better Security
+++
As the tech continues to evolve and gain adoption, WASM is set to become an indispensable tool for blockchain developers!
⚙️ Solana's Sealevel VM (SVM)
Solana is a high-performance blockchain known for its fast transaction times and low fees.
One of the key innovations of the Solana platform is its unique architecture, designed to handle a high throughput of transactions with minimal latency.
A core innovation enabling this is the parallel smart contracts runtime engine Sealevel.
It is an engine that allows smart contracts to execute in parallel, thereby maximizing efficiency and throughput.
In traditional blockchain systems like Ethereum, smart contracts are processed in a sequential manner, one after another.
In contrast, Sealevel is designed to execute multiple smart contracts at the same time, taking full advantage of modern hardware architectures.
By enabling parallel execution, Sealevel makes it possible for Solana to process tens of thousands of transactions per second (TPS), making it one of the fastest blockchains out there.
However, the Sealevel VM does not have to be exclusively on Solana.
Like the EVM (in the case of Optimism or Arbitrum), the zkEVM (in the case of Scroll or zkSync) or CosmWasm, the Sealevel VM can be used as an execution environment in modular network configurations
⚙️ MoveVM
A modular rollup opting for a Move VM execution environment gets some interesting functionality, including parallelism, massive storage in accounts & decoupled fine-grained storage.
As the name suggests, the MoveVM is powered by Move, an open-source programming language developed by @Meta's Diem Association team (when that was still a thing).
It's designed to create customizable transaction logic & smart contracts and is based on Rust.
Move boasts a high level of security & expressivity, using resources drawn from the mathematical idea of linear logic.
It allows devs to avoid mistakes that could lead to exploits, while minimizing gas fees compared to other smart contract chains like Ethereum.
Move introduces formal verification tools, greatly reducing the cost of manual code security audits. It also aims to enable parallel processing, improving system operation efficiency.
Move's executable format is “bytecode that is higher-level than assembly yet lower-level than a source language. The bytecode is checked on-chain for resource, type & memory safety by a bytecode verifier & then executed directly by a bytecode interpreter”.
(from whitepaper)
Move is developer-friendly, lowering the security threshold for development so that developers can focus on business logic.
The switching cost for developers experienced in #Rust and #Solidity is relatively low.
The most famous examples of chains running a Move VM are @Aptos_Network and @SuiNetwork.
However, I'm sure we will see Move-based execution layers running on top of Ethereum (Move rollups) rather soon!
This is it for today, I hope you liked this overview!
Stay tuned for the upcoming parts of this XX-series to learn more about the modular building blocks that will power the execution layers of tomorrow.
Don't forget to smash that follow button! 🫡
Like & RT also greatly appreciated frens! 🫶