Zoran Skoda
WebAssembly

See also virtual machine, cslinks, (Parity) substrate, hyperledger, EOS, Rust.

WebAssembly (wasm) is a modern low level language (mimicking assembly code, but independent of a machine) intended for execution on a virtual machine. It is represented in one of the three common forms. Virtual machine accepts the bytecode version. The corresponding assembly like representation is also used where the commands are given the names as usual. The third is lisp-like bracketed notation, the so called S-expression representation (which is complemented by a little bit of additional information not explicit in assembly like representation). It is optimized for small compiling time and near native execution time, at least when implemented on a virtual machine on one of major computer architectures (like 86 series). It is created as a new VM standard for web browsers, backed by major internet companies; it is also used or planned on a number of blockchain projects, most notably Parity substrate. On web browsers it is highly interoperable with JavaScript.

To employ wasm in web browsers one needs to provide some connection to the real world, which is usually via interface to javascript APIs. The most used is the interface wasm-bindgen

One can try build small wasm projects entirely online at webassembly.studio.

Rust language has small runtime, which is desirable in common applications of WebAssembly. Thus Rust commonly compiles either to native code or to wasm.

General support for wasm outside of browsers is not yet standardized. One has to complement sandboxed wasm with some system calls to have reasonable functionality. WASI is a generic term for the wasm system interface (through APIs).

  • Lin Clark, Standardizing WASI: A system interface to run WebAssembly outside the web 2019/03; WebAssembly’s post-MVP future: A cartoon skill tree 2018/10)
  • Lin Clark, Till Schneidereit, Bringing WebAssembly outside the web with WASI, yt
  • wasmer is a standalone for wasm applications, see github, wasmer.io, this podcast of S. Akbary and article WebAssembly & CloudABI, Medium
  • github/CraneStation/wasmtime, github/WASI-overview.md; wasmtime/WASI tutorial
  • non-web embeddings, docs/non-web
  • Dan Gohman, WebAssembly beyond the browser: WASI, yt
  • WASI standard mimicks in some parts Cloud ABI, cloudlibc github
  • oasis labs docs whitepaper: Raymond Cheng, Fan Zhang, Jernej Kos, Warren He, Nicholas Hynes, Noah Johnson, Ari Juels, Andrew Miller, Dawn Song, Ekiden: A platform for confidentiality-preserving, trustworthy, and performant smart contract execution arxiv/1804.05141; Blockchain-flavored WASI, medium
  • perlin is a DAG-based blockchain (wavelet whitepaper pdf) using Rust smart contracts deployed on wasm virtual machine

Efficiency of wasm and its standardization and programming tools support make wasm VM ideal for distributed ledger applications. Ethereum flavoured version of wasm VM specification is at github/ewasm, see also github/ewasm/design. eWasm has a testnet. According to article ewasm explained,

The ewasm specification consists of a subset of WebAssembly components suitable for Ethereum’s needs, namely determinism and relevant features. It also includes a number of system smart contracts that provide access to Ethereum platform features.

EOS is a high performance DL using wasm VM. A DAG-based perlin blockchain (whitepaper pdf) also uses wasm.

  • Shankar Nathan, How to deploy and run a smart contract on the EOS blockchain, web

  • gurghet, Write EOS contracts in Rust instead of C++

  • Maksym Zavershynskyi, Wasm for Blockchain 2019, blog digest of a top level conference on wasm/wasi efforts relevant to blockchain

TrueBit protocol (whitepaper pdf) is implemented on ewasm github/TrueBitFoundation

Last revised on August 30, 2019 at 10:17:42. See the history of this page for a list of all contributions to it.