Under the wave of rollups, VMs still have a story to tell

Written by PSE Trading Analyst @cryptohawk

TL; DR

  1. A virtual machine is a software emulated computer system that provides an execution environment for a program. It can emulate a variety of hardware devices to enable programs to run in a controlled and compatible environment.

  2. The Ethereum Virtual Machine (EVM) is a stack-based virtual machine that executes Ethereum smart contracts; zkEVM optimizes the zk-proof generation efficiency on EVM equivalence/compatibility.

zkVM discards EVM equivalence/compatibility and increases the priority of zk-friendliness.

privacyzkVM superimposes native privacy features on zkVM;

SVM, FuelVM, and MoveVM have the commonality of pursuing the ultimate performance through parallel execution, but they have their own characteristics in design details.

ESCVM and BitVM have carried out some innovative computing layer experiments on ETH and BTC chains respectively, but the demand for real implementation in the current environment is low.

  1. The huge user ecosystem of the EVM determines that it will be difficult for any blockchain network that abandons it to compete with it in the short term, so the non-EVM ecosystem introduces EVM ecosystem users through transpilers/compilers/bytecode interpreters and even VM compatibility layers, and uses the non-EVM virtual machine features to build a new ecological narrative, or a necessary path to success.

**1.1 What is a VM? **

A virtual machine (VM) is the building block of virtualized computing resources that has almost the same functions as a computer, including running applications and operating systems. The concept of virtual machines is not new, and the technology is widely used in many technology ecosystems.

In the context of blockchain, a virtual machine (VM) is a piece of software that runs programs, often referred to as a runtime environment that executes blockchain smart contracts. Virtual machines typically provide a virtual computer environment by emulating different hardware devices. Different virtual machines can emulate different hardware devices, but typically include CPU, memory, hard disks, network interfaces, and so on. When an on-chain transaction is submitted, the virtual machine is responsible for processing the transaction and updating the blockchain state (the current global state of the entire network) that is affected by the execution of that transaction. The specific rules that change the state of the network are defined by the VM. When processing a transaction, the VM converts the smart contract code into a format that can be executed by the node/validator hardware.

The most important kernel in a VM is LLVM (low-level-virtual-machine), which can be considered the most important kernel of the compiler. The figure shows the operation scheme of the original EVM, and the smart contract is converted into Bytecode through the intermediate code of LLVM IR. These bytecodes are stored on the blockchain, and when the smart contract is called, the bytecode is converted into the corresponding Opcode, which is then executed by the EVM and node hardware.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/b3da87c9e06d747a77eba26a9dbd96e9.)

1.2 Mainstream VMs

1.2.1 EVM - Blockchain VM has one stone, EVM has eight buckets, and the rest is divided into two buckets

Representative projects: Optimism, Arbitrum

As the blockchain ecosystem with the highest developer and user activity in the industry, the Ethereum Virtual Machine EVM is a stack-based virtual machine that provides a virtual computer environment by emulating hardware devices such as CPU, memory, memory, and stacks, so as to execute smart contract instructions and store smart contract state and data. The instruction set of the EVM includes various opcode opcodes, such as arithmetic operations, logical operations, storage operations, jump operations, and so on.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/5697bec2651732ec30d01cdb82f404c2.)

The memory and memory emulated by the EVM are devices used to store the state and data of the smart contract. The EVM treats memory and memory as two distinct areas that can access the state and data of a smart contract by reading and writing to memory and memory.

The stack of EVM simulations is used to store the operands and results of instructions. Most of the instructions in the EVM's instruction set are stack-based, they read operands from the stack and push the results back into the stack.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/3868c7284468389a35dd1c4f01a906ae.)

The design process of the EVM is obviously bottom-up, first finalizing the simulated hardware environment (stack, memory), and then designing its own set of assembly instruction sets (Opcode) and bytecode (Bytecode) according to the corresponding environment. The Ethereum community has designed two compiled high-level languages - Solidity and Vyper - for the efficiency of EVM execution. Needless to say, Vyper is Vitalik's EVM high-level language designed to address some of the flaws in Solidity, but it has not received a lot of adoption in the community, so it has gradually faded into obscurity.

1.2.2zkEVM - I want it all: compatible with EVM environment + support global state root conversion to generate zk-proof

Representative projects: Taiko, Scroll, PolygonzkEVM

Because the EVM is not built with zk-proof computation in mind, it is not friendly to proof circuits, especially in terms of special opcodes, stack-based architectures, storage overhead, and proof costs. zkEVM is a virtual machine that executes smart contracts in a way that is compatible with zk-proof computing, so that the execution process of EVM can be verified more efficiently and cost-effectively through zk-proof/validity-proof. Compared to OPRollup, the execution layer only needs to copy the EVM, and building the ZK-friendly EVM is an additional challenge for ZK Rollup.

ZK-rollups are not easily compatible with the Ethereum Virtual Machine (EVM). Proving a general-purpose EVM computation in a circuit is more difficult and resource-intensive than proving a simple computation such as the token transfer described earlier.

However, advances in zero-knowledge technology(Opens in a new tab) have reignited interest in wrapping EVM computation in zero-knowledge proofs. These efforts aim to create a zero-knowledge EVM (zkEVM) implementation that can effectively verify the correctness of program execution.

Like the EVM, the zkEVM transitions between states after performing calculations on certain inputs. The difference is that zkEVM also creates zero-knowledge proofs to verify the correctness of each step in the execution of the program. Validity proofs can verify the correctness of operations involving the state of the virtual machine (memory, stack, storage) and the compute itself (i.e., did the operation invoke the correct opcodes and execute them correctly?). )。

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/e4db398cf7cd926f3d6ce5de03b860de.)

At present, it is difficult for Rollup to achieve ZK-friendly and EVM compatibility (or even equivalent), that is, to either replicate the Ethereum L1 execution layer as completely as possible, including hashes, state trees, transaction trees, precompilation, etc., so that the Ethereum L1 execution client can use it as it is to process Rollup blocks; Either abandon EVM compatibility and recreate the existing Opcode for proof/verification in the circuit, allowing smart contracts to be executed.

1.2.3zkVM - You can't have it both ways: zk-proof efficiency-oriented, non-evm VMs

Representative projects: Starknet, Zksync, RISC ZERO

Rather than EVM compatibility, zkVM has found a common divisor between cryptography and high-level languages with data proofs and state updates as its core goals, providing a common framework for a wide range of applications.

Starkware has a certain technological leadership due to its early start in the entire ZK field and its relatively sufficient technology accumulation. He is the representative ZK-centric technical architecture around which Cairo VM and Cairo's language are built. The disadvantage is that Cairo is more expensive to learn.

ZKsync's framework is compatible with both EVM and ZK, and integrates Solidity with its self-developed circuit language Zinc, unifying the two at the IR level within the compiler. The advantage is that the LLVM of the compiler kernel is compatible with multiple languages.

RISC Zero uses the RISC-V architecture to build simulators that allow programmers to write programs for zkVM in general-purpose languages such as Rust, C/C++, and Go, which means that the application logic does not need to be limited to what can be expressed in Solidity, allowing chain-agnostic code to be written.

1.2.4Privacy zkVM - zk friendly + native privacy support tries to ignite a new spark in the ecosystem

Representative projects: Aleo, Ola, PolygonMiden

Blockchain is a public ledger system where all transactions are carried out on-chain, which means that state changes containing asset information related to addresses or accounts are open and transparent. As a result, in addition to working on scaling solutions, some blockchain teams believe that the next key feature to be implemented is privacy.

In addition to the zk-friendly support for scaling, PrivacyzkVM enables its upper-layer application developers to open privacy-related dapps due to the privacy features natively supported by its own programming language, which will bring new application scenarios and grand narratives, such as completely solving the MEV problem and ensuring user data ownership. Of course, the complexity of the PrivacyzkVM design requires a much larger technical team to implement, and it may take several years to implement.

1.2.5SVM - After the ebb tide, there are still embers: an execution environment that has been designed to the extreme of performance

Representative projects: Eclipse Mainnet, Nitro, MakerDAOChain (maybe)

SVM, or Solana Virtual Machine, focuses on a high-performance execution environment, and smart contracts are mainly written in Rust. In contrast to single-threaded computed EVM and EOSWASM execution environments, SVM enables non-overlapping transactions and concurrent execution of transactions that only read the same state by requiring Solana transactions to describe all states that will be read or written to them at the time of execution.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/7224c8325f628b476cc8a58648118a12.)

In addition, in order to quickly verify/broadcast a large number of transaction blocks, the transaction verification process on the Solana network makes extensive use of pipeline optimizations that are common in CPU design. To meet the situation where a series of steps process the input data stream, and each step has a different hardware responsibility. A typical analogy is a washer and dryer, which washes/dries/folds multiple batches of laundry in sequence. Washing must be carried out before drying, and folding must be carried out before drying, but each of these three operations is performed by a separate unit.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/4a6afec0f411e515b6b7acd0ca7f7986.)

In addition, SVMs are register-based and have a much smaller instruction set than EVMs, making the execution of SVMs easier to prove in ZK. For optimistic rollups, register-based designs make it easier to set checkpoints.

1.2.6FuelVM - Buff Stacked: Parallel Virtual Machine under UTXO Framework

Representative project: Fuel

Fuel VM is based on the EVM, Solana, WASM, BTC & Cosmos technology framework, and has the following features compared to EVM:

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/893b74b06bf09e594fcaa3facdcab828.)

The most unique thing is that Fuel not only has the ability to execute transactions in parallel with non-overlapping transactions by setting access lists like SVMs, but also adopts the UTXO model, which is divided into token UTXO and contract UTXO, which further improves access efficiency and computing throughput.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/597b6194925d676cbc7b16ee50934720.)

In addition, Fuel VM provides a powerful and fluid developer experience through its own domain-specific language, Sway, and support toolchain Fort, with a development environment that retains the benefits of smart contract languages like Solidity while adopting paradigms introduced in the Rust tooling ecosystem.

In the future, the Fuel VM will also implement Sway language upgrades, including compiler optimizations in terms of bytecode size, Sway will support more backends (EVM backends are already in development), abstractions will be more economical, more applications will be migrated from Solidity/Vyper to Sway, improved compiler-level reentrancy analysis, and more.

1.2.7ESCVM - Successor to Ordinal/Smartweave: The Compute Layer on Top of Ethereum

Representative project: Ethions Protocol

ESCVM, or Ethions Virtual Machine, is a smart contract scheme proposed by Ethions Protocol. The Ethions Protocol itself is a protocol similar to BTC Ordinal on the Ethereum chain, focusing on exploring low-cost alternatives to smart contracts and L2.

Ethions allows users to bypass smart contract storage and execution at a fraction of the cost, and apply calldata in Tx to compute through pre-agreed protocol rules. To put it simply, as long as a successful Ethereum transaction has a calldata that meets the specified valid data specification & unique & "to" address is not 0, it can be considered to have legally created an Ethion, with the "from" address being the creator and the "to" address being the owner.

At the beginning of the design, each Ethion is more inclined to the form of NFT, such as image NFT, and directly writes the image content into the calldata through Base64 format:

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/6a16558230f9a8edcdf93f3c49f3ff18.)

The most popular eths recently is Ethion, which was created with reference to the BRC-20 protocol specification:

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/32932301680ca546fcdd7ac441b73628.)

The smart contract introduced by ESC VM, known as a "dumb contract", is advertised as a logical contract, but does not interact on-chain in the form of EVM itself. In addition, ESC VM also adds a special format "Computer Command", which will be recognized by ESC VM to interact with dumb contracts, such as Deploy - deploy - deploy - call dumb contract.

There are some limitations to this scheme, one is that the function of the "dumb contract" is not payable, that is, if you want to send ETH through a dumb contract, you must use a "bridge contract", and the "bridge contract" itself has the risk of abuse of control & asset theft; Second, there is an entry threshold in the ecosystem, which does not allow the arbitrary creation of dumb contracts, and its code needs to be defined through the Ethions Protocol governance proposal.

To sum up, ESC VM is a computing layer built on top of Ethereum L1 as the data storage layer, which is implemented by placing contract logic, contract calls, contract calls and other data content in the calldata of Ethereum tx, and the global state consensus of ESC VM is the consensus of ESC VM clients, which is similar to the SmartWeave implementation logic of Arweave, but the data storage layer of SmartWeave is Arweave.

1.2.8BitVM - An Interesting Research Experiment: Peer-to-Peer Execution Channels on BTC

Representative project: ZeroSync

Robin Linus, the founder of ZeroSync, released a white paper on October 9, "BitVM: Compute Anything On Bitcoin", which is not a VM to be precise, but an attempt to create a Turing-complete computing space with contracts stored on the Bitcoin chain, but the logic of the contract is executed off-chain. If you believe that the other party is in default, you can launch a challenge on the chain, and if the other party cannot respond correctly, you can take all the funds in the contract.

The advantage is that it can give Bitcoin Turing completeness without any modifications to the Bitcoin protocol, no new opcodes, no soft forks, and ready to apply.

Its shortcomings are also obvious, one is that it only supports transactions between two parties (one proves and one verifies), and the other is that creating a contract requires creating a large amount of data and pre-signing a large number of transactions, and the cost of off-chain information storage is huge.

Here's a brief introduction to the technical logic:

POINT INPUT COMMITMENT

The dot input commitment allows the prover to set an input value of 0 or 1 for the logic gate, and in this promise there are two hash values H(A0) and H(A1), and the prover needs to reveal a precursor hash, e.g. A0, then set the input value to 0, if A1 is revealed, set the input value to 1.

Logic Gate Commitment

Once you have the input values, you can combine any logic gate in Bitcoin Script by combining the amp and NAND opcodes of Bitcoin.

Binary Circuit Promise

Turing completeness can be achieved by combining hundreds of millions of logic gates into a binary circuit. In order to commit this binary circuit to the Bitcoin network, all the logic gates need to be put into a leaf node with a Taproot address.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/7468e3b36e547f00ef329309820a4b07.)

CHALLENGE - RESPONSE SESSION

It's not enough to commit the circuit on-chain, both sides of the transaction need an efficient way to verify that the contract's calculations are correct. Ideally, the contract runs off-chain, and both parties are happy when they are cooperative and undisputed. However, if there is a dispute between the two parties to the transaction, it is necessary to enter the Challenge-Response stage to verify the calculation results and force the distribution of the channel balance through Bitcoin Script.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/31d50ed5a8744519960a6656929a6615.)

As such, BitVM is far from being some kind of BitcoinRollup or L2 that does not have a full virtual machine execution environment, global state, a high-level language for publishing complex smart contracts, and cannot allow any number of users to easily interact with these contracts. To illustrate this with a layman's example, BitVM is like building a giant computer bigger than a room in the era when everyone can use mobile devices.

1.2.9 MoveVM - a product of Facebook's Web2 gene inheritance

Representative projects: Aptos, Sui

Move is a programming language for writing secure smart contracts, which was originally developed by Facebook to support the Diem blockchain, and after the Diem blockchain project was discontinued, projects such as Aptos and Sui continued the use of the Move language. The biggest feature of the Move blockchain is that the data storage adopts global storage, which consists of a tree with the account address as the root, and each address can store resource data and module code.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/880930d84eb1ed81df7b4ec1fbd8c82f.)

There are two different types of programs for Move: modules and scripts. A module is a library that defines structure types and functions that operate on those types. The structure type defines the global storage mode for the Move, and the module function defines the rules for updating the storage. The modules themselves are also stored in global storage. Scripts, on the other hand, are the entry point to the executable, similar to the main function in traditional languages, and are temporary snippets of code that are not published in the global store.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/bffe7529268a49a3df8994f343dc55b0.)

In summary, the Move module is similar to the dynamic library module that is loaded when the system executable runtime, while the script is similar to the main program. Users can write their own scripts to access the global store, including invoking modules, while publishing modules or executing scripts can be manipulated through MoveVM.

1.3 Ecological Development Trend

Now that the EVM network effect is so strong, the migration of EVM users to non-EVM chain ecosystems has become the biggest growth point for emerging blockchain projects, which will bring more Dapp composability, and greater connectivity may lead to faster user growth in the coming years.

1.3.1 Wallet front-end compatible

Introducing EVM users to non-EVM chains has historically been a major obstacle, but the recent launch of Metamask Snap will break that barrier. EVM users can continue to use MetaMask without having to switch wallets. Thanks to Drift's open-source contributions, which build a great MetaMask Snap implementation, UX is the equivalent of interacting with any EVM chain. Eclipse mainnet users will be able to interact with native apps in MetaMask or use Solana-native wallets such as Salmon.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/5e997aade0d79e4b85ab48913fcc7941.)

1.3.2VM backend compatible

1.3.2.1 Transpiler/Compiler

Representative project: Wrap

Warp is a Solidity-Cairo transpiler that has been developed by Nethermind, a well-known infrastructure team on Ethereum. Warp can translate Solidity code into Cairo, but the translated Cairo program often needs to modify and add Cairo features (such as calling built-in functions, optimizing memory, etc.) to maximize execution efficiency.

1.3.2.2 Bytecode Interpreter/VM Compatible Layer

Representative projects: Kakarot, Neon EVM

Kakarot is an EVM bytecode interpreter implemented in the form of a smart contract written in Cairo on Starknet, which simulates the stack, memory, execution, and other aspects of the EVM in the form of a Cairo smart contract. Compared with code translation, Kakarot implements the item-by-item implementation of Opcode and Pre-compile behind the EVM, and builds components such as Account Registry and Blockhash Registry to provide additional processing for account address mapping and block information acquisition, so that kakarot has higher native compatibility.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/663d518717668dd2d6b29088d974b1a6.)

Neon EVM is a type of EVM that operates as a smart contract and can be deployed on any SVM chain. The Eclipse mainnet itself uses SVM as the execution environment, but brings full EVM compatibility (including EVM bytecode support and Ethereum JSON-RPC) through the Neon EVM, and higher throughput than the single-threaded EVM. In addition, each Neon EVM instance has its own local fee market, that is, there is an upper limit (1/4 of the block computing unit) related to the interaction of a single contract account at a block height, so users only need to pay priority fees when a specific hot contract interaction or block is full. In this sense, an application deploys its own contract to gain an advantage similar to that of an application chain, thereby reducing the disruption to the user experience, security, or liquidity of the entire network when a particular contract interacts with tx congestion.

! [Under the wave of rollups, VMs still have stories to tell] (https://cdn-img.panewslab.com//panews/2022/10/30/images/103e4dc44ec28ccee4ab8035e4e0867d.)

Resources:

  1. "Kakarot: Exploring Starknet's Path to EVM Compatibility", by Cynic & Starknet Astro,

  2. "BitVM is hotly debated, can the Bitcoin network achieve Turing completeness?" ”,by Haotian,

  3. "Starkware Technology Architecture and Ecosystem Review", by Maxlion,

  4. "Project Research丨Modular High-Speed Execution Layer Fuel Research Report", from Web3CN,

  5. “Analysis of the First Critical Vulnerability of Aptos Move VM”,by Numen Cyber Labs,

11.“What Is SVM - The Solana Virtual Machine”,by Squads,

12.“Introducing Eclipse Mainnet: The Ethereum SVM L2”,by Eclipse,

15.“The different types of ZK-EVMs”,by Vitalik Buterin,

  1. "Cipholio Research Report: Talking about ZkVM's Solution and Future", by YOLO SHEN, Cipholio Ventures,
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)