ewasm Design Overview and Specification
Branch: master
Clone or download
Latest commit 08842de Jan 31, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci CI: support codespell Sep 17, 2018
assets delete old files Jan 29, 2019
.gitignore Git ignore .idea dir Oct 7, 2018
LICENSE Add Apache 2.0 license Oct 9, 2016
README.md Update link for official wasm spec Nov 26, 2018
backwards_compatibility.md typo fixes Nov 8, 2018
comparison.md Fix some typos Sep 14, 2018
contract_interface.md Use a single revision Sep 19, 2018
determining_wasm_gas_costs.md
eth_interface.md Use the word "halt" instead of trap to avoid confusion Jan 14, 2019
evm_transcompiler.md Implement the change from eWASM to ewasm Sep 14, 2018
faq.md Implement the change from eWASM to ewasm Sep 14, 2018
fee_schedule.md
interface_questions.md
metering.md Update metering.md Dec 23, 2016
rationale.md Replace FTP link with HTTP Jan 26, 2019
sentinel.md
system_contracts.md Remove the obsolete Sentinel interface from system_contracts Oct 18, 2018
vm_semantics.md Update vm_semantics.md Nov 21, 2018

README.md

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

Matrix
IRC freenode@ewasm
Gitter