rWasm (Reduced WebAssembly)
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:
- Architecture
- Compilation & Execution Pipeline
- Module Format
- VM, Fuel, and Tracing
- Opcode Specification
- Security Considerations
- Contributor Guide
Quick start (local)
Prerequisites
- Rust stable
- Rust nightly
nightly-2025-09-20 - wasm target
wasm32-unknown-unknownon both toolchains clang,libclang-dev,pkg-config- initialized git submodules
Setup
Canonical commands
Feature notes
Cargo.toml defines the runtime surface via features. Important points:
- default enables
std,wasmtime fpuexists 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 layere2e/— end-to-end harnesses and testsuite integrationsnippets/— snippet fixtures/tests (nightly path)examples/— sample modules/programsbenches/— Criterion benchmarks.github/workflows/— CI/CD workflows