• Stars
    star
    1,015
  • Rank 45,292 (Top 0.9 %)
  • Language
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ewasm Design Overview and Specification

Ethereum flavored WebAssembly (ewasm)

Specification Revision 4

This repository contains documents describing the design and high-level overview of ewasm. Expect the contents of this repository to be in flux: everything is still under discussion.

This repository is also available through ReadTheDocs.

What is WebAssembly?

WebAssembly (or Wasm as a contraction) is a new, portable, size- and load-time-efficient format. WebAssembly aims to execute at native speed by taking advantage of common hardware capabilities available on a wide range of platforms. WebAssembly is currently being designed as an open standard by a W3C Community Group.

Please review the WebAssembly design and instruction set first. (You can also make a pull request or raise an issue at the Wasm Github repo.)

A few key points:

  • WebAssembly defines an instruction set, intermediate source format (wast) and a binary encoded format (wasm).
  • WebAssembly has a few higher level features, such as the ability to import and execute outside methods defined via an interface.
  • LLVM includes a WebAssembly backend to generate Wasm output.
  • Major browser JavaScript engines will notably have native support for WebAssembly, including but not limited to: Google's V8 engine (Node.js and Chromium-based browsers), Microsoft's Chakra engine (Microsoft Edge), Mozilla's Spidermonkey engine (Firefox and Thunderbird).
  • Other non-browser implementations exist too: wasm-jit-prototype (a standalone VM using an LLVM backend), wabt (a stack-based interpreter), ml-proto (the OCaml reference interpreter), etc.

What is Ethereum flavored WebAssembly (ewasm)?

ewasm is a restricted subset of Wasm to be used for contracts in Ethereum.

ewasm:

Goals of the ewasm project

  • To provide a specification of ewasm contract semantics and the Ethereum interface
  • To provide an EVM transcompiler, preferably as an ewasm contract
  • To provide a metering injector, preferably as an ewasm contract
  • To provide a VM implementation for executing ewasm contracts
  • To implement an ewasm backend in the Solidity compiler
  • To provide a library and instructions for writing contracts in Rust
  • To provide a library and instructions for writing contracts in C

Glossary

  • Ewasm contract: a contract adhering to the ewasm specification
  • Ethereum environment interface (EEI): a set of methods available to ewasm contracts
  • metering: the act of measuring execution cost in a deterministic way
  • metering injector: a transformation tool inserting metering code to an ewasm contract
  • EVM transcompiler: an EVM bytecode (the current Ethereum VM) to ewasm transcompiler. See this chapter.

Resources

Projects

Design Process & Contributing

For now, high-level design discussions should continue to be held in the design repository, via issues and pull requests. Feel free to file issues.

Chat

Gitter

More Repositories

1

hera

Hera: Ewasm virtual machine conforming to the EVMC API
C++
180
star
2

evm2wasm

[ORPHANED] Transcompiles EVM code to eWASM
C++
107
star
3

ewasm-rust-api

Ewasm API for Rust
Rust
102
star
4

scout

Scout is a Ethereum 2.0 Phase 2 execution prototyping engine.
Rust
89
star
5

wasm-metering

[ORPHANED] Injects metering into webassembly binaries
JavaScript
68
star
6

testnet

Testnet planning & documentation
Dockerfile
64
star
7

ewasm-precompiles

Implementation of the Ethereum precompiled contracts in Rust.
Rust
45
star
8

wasm-json-toolkit

[ORPHANED] A small toolkit for converting wasm binaries into json and back.
JavaScript
32
star
9

ewasm-kernel

[ORPHANE] Javascript implementation of an eWASM VM
JavaScript
24
star
10

assemblyscript-ewasm-api

Ewasm API for AssemblyScript
TypeScript
21
star
11

biturbo

Eth1 EE using Turboproofs
TypeScript
20
star
12

rust-ewasm

[ORPHANE] Examples of compiling Rust code to ewasm contracts
WebAssembly
20
star
13

wast2wasm

[OBSOLETE] converts .wast files -> .wasm
JavaScript
20
star
14

benchmarking

Instructions for benchmarking Ewasm precompiles. (And results.)
Python
18
star
15

ewasm-studio

A lightweight development environment for eWASM
JavaScript
16
star
16

wrc20-examples

This repository contains examples of WRC20 tokens written in different languages.
12
star
17

sentinel-rs

Validator and metering injector for Ewasm
Rust
11
star
18

pm

Ewasm project management repository
11
star
19

ethereum-bls12.rs

Ethereum serialisation for BLS12-381 operations in Rust.
Rust
10
star
20

eth1x64

Description and examples for different variants under the Eth1x64 experiment.
8
star
21

scout.ts

TypeScript port of Scout
TypeScript
7
star
22

ethereum-bn128.rs

Ethereum's BN128 helpers for Rust.
Rust
7
star
23

scoutone

ScoutOne is a C++ library implementing the Eth 2 Phase 2 execution environment on top of wabt.
CMake
6
star
24

evm2wasm-frontend

[ORPHANE] an html front-end for evm2wasm
JavaScript
5
star
25

ewasm-cleanup

[OBSOLETE] Cleanup eWASM contracts to satisfy the specification
JavaScript
4
star
26

sentinel-governance

Governance prototype for the Sentinel contract
JavaScript
4
star
27

ewasm-explorer

[ORPHANE] Minimal account explorer for ewasm testnet.
JavaScript
2
star
28

hera.rs

Rust
2
star
29

ewasm-testgen

Random test case generator for Ewasm.
JavaScript
2
star
30

wasm-metering-old

[OBSOLETE] This is a prototype to inject metering into wasm code.
JavaScript
2
star
31

awesome-phase2

A curated list of awesome things related to Eth2 Phase2
2
star
32

ce-playground

This is a loose collection of Eth 2.0 Phase 2 Computational Environments (CE).
1
star
33

evm384_f6m_mul

Shell
1
star
34

docker

Docker sources useful for Ewasm
Dockerfile
1
star
35

ewasm-libc

1
star
36

ewasm-tests

[OBSOLETE] Tests.
1
star