Metaverse VM: An Ethereum Compatible VM

Introduction

The Metaverse VM (MVM) is based on Ethereum-compatible smart contract Substrate pallet and SputnikVM: A Blockchain Virtual Machine.

SputnikVM is an implementation of an Ethereum Virtual Machine. It aims to be an efficient, pluggable virtual machine for different Ethereum-based blockchains.

A VM can be started given a Context and a BlockHeader. The user can then fire or step to run it. Those functions would only fail if it needs some information (accounts in the current block, or block hashes of previous blocks). If this happens, one can use the function commit_account and commit_blockhash to commit that information to the VM, and fire or step again until it succeeds. The current VM status can always be obtained using the status function.

MVM is a developer-oriented blockchain that strives to provide compatibility with the existing Ethereum developer toolchain and network. It does this by providing a full EVM implementation, a Web3-compatible API, and bridges that connect the MVM to existing Ethereum networks. This allows developers to deploy existing Solidity smart contracts and DApp frontends to MVM with minimal changes.

Features

  • Standalone - can be launched as an independent process or integrated into other apps

  • Universal - supports different Ethereum chains, such as ETC, ETH or private ones

  • Stateless - only an execution environment connected to independent State storage

  • Fast - main focus is on performance

  • IoT compatible - designed to support hardware used in embedded devices

  • FFI, Protobuf and JSON interface

  • Written in Rust, can be used as a binary, cargo crate or shared library

Structs

Structs Name

Description

A struct that manages the current account state for one EVM.

A struct that manages the current blockhash state for one EVM.

A VM context. See the Yellow Paper for more information.

A VM that executes using a context and block information.

ECREC precompiled contract.

Mainnet account patch

Mainnet account patch

Embedded Patch

Block Header

ID precompiled Contract

Log

A VM state with PC.

Represents a program counter in EVM.

Represents a mutable program counter in EVM.

RIP160 precompiled contract

A VM runtime. Only available in eval.

SHA256 precompiled contract.

A sequential memory. It uses Rust's Vec for internal representation.

Represents an EVM stack.

A VM state without PC.

Internal representation of an account storage. It will return a RequireError if trying to access non-existing storage.

A VM that executes using a transaction and block information.

Represents an untrusted Ethereum transaction.

Patch sepcific for the jsontests crate.

Represents an Ethereum transaction.

Mapping of valid jump destination from code.

Enums

Enums Name

Description

Represents an account. This is usually returned by the EVM.

A single account commitment.

Instructions for the program counter. This is the same as Opcode except PUSH, which might take longer length.

Represents the current runtime status.

Opcode enum. One-to-one corresponding to an u8 value.

Transaction Actions

VM Status

Statics

Statics Name

Description

Static value of ECREC precompiled contract.

Default precompiled collections.

Static value of ID precompiled contract.

Static value of RIP160 precompiled contract.

Static value of SHA256 precompiled contract.

Traits

Traits Name

Description

Account patch for account related variables.

Represent a memory in EVM. Read should always succeed. Write can fall.

Represents different block range context.

Represent a precompiled contract.

Represents an EVM. This is usually the main interface for clients to interact with.

Type Definitions

Type

Description

A sequencial VM. It uses sequencial memory representation and hash map storage for accounts.

A sequencial transaction VM. This is same as SeqContextVM except it runs at transaction level.

Last updated