1 stable release

1.0.0 Mar 19, 2024

#359 in WebAssembly

Download history 739/week @ 2024-03-18 1128/week @ 2024-03-25 650/week @ 2024-04-01 924/week @ 2024-04-08 1044/week @ 2024-04-15 1314/week @ 2024-04-22 1322/week @ 2024-04-29 657/week @ 2024-05-06 1396/week @ 2024-05-13 905/week @ 2024-05-20 824/week @ 2024-05-27 659/week @ 2024-06-03 973/week @ 2024-06-10

3,374 downloads per month
Used in 6 crates (via radix-engine)


14K SLoC


radix-wasmi is a fork of the wasmi-labs/wasmi, with the following changes:

  • Added Clone derive for Store.

Continuous Integration Test Coverage Documentation Crates.io
ci codecov docs crates

wasmi- WebAssembly (Wasm) Interpreter

wasmi is an efficient WebAssembly interpreter with low-overhead and support for embedded environment such as WebAssembly itself.

At Parity we are using wasmi in Substrate as the execution engine for our WebAssembly based smart contracts. Furthermore we run wasmi within the Substrate runtime which is a WebAssembly environment itself and driven via Wasmtime at the time of this writing. As such wasmi's implementation requires a high degree of correctness and Wasm specification conformance.

Since wasmi is relatively lightweight compared to other Wasm virtual machines such as Wasmtime it is also a decent option for initial prototyping.

Distinct Features

The following list states some of the distinct features of wasmi.

  • Primarily concerned about
    • correct and deterministic WebAssembly execution.
    • WebAssembly specification compliance.
  • Can itself be compiled to and executed via WebAssembly.
  • Low-overhead and cross-platform WebAssembly runtime.
  • Loosely mirrors the Wasmtime API to act as a drop-in solution.
  • Supports resumable function calls.

WebAssembly Proposals

The new wasmi engine supports a variety of WebAssembly proposals and will support even more of them in the future.

WebAssembly Proposal Status Comment
reference-types Planned but not yet implemented. Low priority.
bulk-memory Planned but not yet implemented. Low priority.
simd No support is planned for wasmi.
tail-calls Not yet part of the Wasm standard but support in wasmi is planned. Low priority.


Clone wasmi from our official repository and then build using the standard cargo procedure:

git clone https://github.com/paritytech/wasmi.git
cd wasmi
cargo build


In order to test wasmi you need to initialize and update the Git submodules using:

git submodule update --init --recursive

Alternatively you can provide --recursive flag to git clone command while cloning the repository:

git clone https://github.com/paritytech/wasmi.git ---recursive

After Git submodules have been initialized and updated you can test using:

cargo test --workspace


Before pushing a PR to our repository we would like you to execute the scripts/run-local-ci.sh script that can be found in the repository's root folder.

Supported Platforms

Supported platforms are primarily Linux, MacOS, Windows and WebAssembly.

Use the following command in order to produce a WebAssembly build:

cargo build --no-default-features --target wasm32-unknown-unknown

Production Builds

In order to reap the most performance out of wasmi we highly recommended to compile the wasmi crate using the following Cargo profile:

lto = "fat"
codegen-units = 1

When compiling for the WebAssembly target we highly recommend to post-optimize wasmi using Binaryen's wasm-opt tool since our experiments displayed a 80-100% performance improvements when executed under Wasmtime and also slightly smaller Wasm binaries.


In order to benchmark wasmi use the following command:

cargo bench

Note: Benchmarks can be filtered by compile_and_validate, instantiate and execute flags given to cargo bench. For example cargo bench execute will only execute the benchmark tests that test the performance of WebAssembly execution.


wasmi is primarily distributed under the terms of both the MIT license and the APACHE license (Version 2.0), at your choice.



Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in wasmi by you, as defined in the APACHE 2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~29K SLoC