Lita Docs
  • Introduction
    • Getting Started
  • Quick Start
    • Tutorial: Rust via Docker
    • Installation & System Requirements
    • Valida Compiler Toolchain
      • Rust Usage
      • C Usage
      • WASM Usage
      • Rust API
      • Client-side API
    • Valida zk-VM
  • ADVANCED USAGE
    • zk-VM: Advanced Usage
    • Using the Rust Toolchain
    • Using LLVM libc
  • Architecture
    • Overview
    • Proving System: Plonky3
      • Future Directions
    • Valida zk-VM
      • Technical Design: VM
      • Technical Design: Prover
      • GitHub Link
    • LLVM-Valida Compiler
      • Technical Design
      • GitHub Link
    • Benchmarks
      • Fibonacci (vs. RISC Zero)
      • Fibonacci (vs. SP1)
      • Fibonacci (vs. Jolt)
      • Fibonacci (Rust vs. C)
      • SHA-256 (vs. RISC Zero)
      • SHA-256 (vs. SP1)
      • SHA-256 (vs. Jolt)
  • Core Concepts
    • zk-VM
    • Proofs: Classical, Probabilistic, Succinct, and ZK
    • Evaluating zk-VMs
    • ZK-VM Design Tradeoffs
    • Valida Design Considerations
  • Contributing
    • Overview
    • Early Access Program
Powered by GitBook
On this page
  1. Quick Start
  2. Valida Compiler Toolchain

WASM Usage

PreviousC UsageNextRust API

Last updated 3 months ago

WebAssembly 2.0 is supported except for exceptions and threads. The supported WASM feature set is the same as the features supported by wasm2c 1.0.34 when used with default options (no cmd line switches passed). See WASM features supported by wasm2c in the following .

From WASI only standard input and standard output are supported.

Use /valida-toolchain/bin/compile-wasm.sh to compile a .wasm program into a Valida executable:

/valida-toolchain/bin/compile-wasm.sh file.wasm -o output_path

file.wasm must export an entrypoint called _start that doesn't take any arguments and returns no value.

The compile-wasm.sh compilation pipeline involves an intermediate step that compiles WASM to C with wasm2c. Then C is compiled to Valida executable with Valida toolchain.

It's assumed that Valida toolchain is installed and is located at the default installation location: /valida-toolchain

It's assumed that wasm2c and wat2wasm in version 1.0.34 are in PATH. On Ubuntu 24.04 these can be installed with a command: apt install wabt.

See WASM examples bundled in the release package or in the toolchain Docker image at /valida-toolchain/examples/wasm.

table