#blockchain #wasm-interpreter #interpreter

no-std rwasm

ZK-friendly WebAssembly runtime optimized for blockchain and zero-knowledge applications

2 unstable releases

2020.1.1 Dec 19, 2020
0.4.3 Apr 2, 2026
0.3.2 Oct 26, 2025
0.0.1 Aug 29, 2022

#8 in #wasm-interpreter

Download history 45/week @ 2025-12-11 64/week @ 2025-12-18 35/week @ 2025-12-25 38/week @ 2026-01-01 5/week @ 2026-01-08 24/week @ 2026-01-15 159/week @ 2026-01-22 65/week @ 2026-01-29 15/week @ 2026-02-05 51/week @ 2026-02-12 37/week @ 2026-02-19 20/week @ 2026-02-26 28/week @ 2026-03-05 59/week @ 2026-03-12 73/week @ 2026-03-19 30/week @ 2026-03-26

190 downloads per month
Used in 13 crates (2 directly)

Apache-2.0

2MB
17K SLoC

rWasm (Reduced WebAssembly)

codecov

rwasm is a deterministic reduced WebAssembly format + runtime stack for execution environments that care about * performance*, predictability, and proof-friendliness.

It is designed to be ZK-friendly: execution semantics and representation choices aim to stay efficient both for normal execution and proving-oriented pipelines.


What this repository provides

  • Wasm → rWasm compilation pipeline
  • rWasm opcode model and module encoding
  • native rWasm VM runtime with fuel support
  • strategy abstraction for native execution and optional Wasmtime backend
  • host import/syscall integration surfaces

Documentation

Start with docs/README.md.

Core docs:


Quick start (local)

Prerequisites

  • Rust stable
  • Rust nightly nightly-2025-09-20
  • wasm target wasm32-unknown-unknown on both toolchains
  • clang, libclang-dev, pkg-config
  • initialized git submodules

Setup

rustup target add wasm32-unknown-unknown
rustup +nightly-2025-09-20 target add wasm32-unknown-unknown
git submodule update --init --recursive

Canonical commands

make build
make clippy
make test

Feature notes

Cargo.toml defines the runtime surface via features. Important points:

  • default enables std, wasmtime
  • fpu exists as a feature-gated surface in code
  • FPU opcodes are currently not treated as production-facing opcode surface in docs (kept mainly for testsuite/internal compatibility)

When integrating in production, pin exact feature set and toolchain.


Repository layout

  • src/ — compiler, module model, opcode types, VM, strategy layer
  • e2e/ — end-to-end harnesses and testsuite integration
  • snippets/ — snippet fixtures/tests (nightly path)
  • examples/ — sample modules/programs
  • benches/ — Criterion benchmarks
  • .github/workflows/ — CI/CD workflows

License

Apache 2.0

Dependencies

~24MB
~440K SLoC