Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
wacc
Web Assembly Cryptographic Constructs (WACC) VM implementation. A WASM-based virtual machine for executing cryptographic verification scripts used in provenance systems.
The wacc VM executes lock and unlock scripts that verify signatures, check preimages, compare key-path values, and branch on conditions. It uses Wasmtime as the WASM runtime with fuel-based execution limiting, memory limits, and check-count limits to prevent DoS attacks.
Table of Contents
Features
- WASM-based script execution via Wasmtime.
- Stack-based API:
push,pop,peek,check_eq,check_signature,check_preimage,branch,log. - Configurable security limits: fuel, memory, check count, and algorithm allowlists.
- Module cache with Blake3-based WASM module hashing.
- XMSS leaf-index monotonicity enforcement to prevent index reuse.
- Thread-safe
ModuleandEnginesharing viaArc. - Adapters layer for multicodec cryptographic operations.
Install
Add this to your Cargo.toml:
[]
= "0.1"
MSRV: Rust 1.85.
Usage
use ;
use BTreeMap;
// Build a VM instance with security limits
let builder = new
.with_bytes
.with_fuel
.with_memory_limit;
let mut instance = builder.try_build.unwrap;
// Set up the execution context
let context = Context ;
// Execute the script
let result = instance.execute.unwrap;
Security
The wacc VM applies these security limits:
- Fuel: Wasmtime's fuel-based execution limiting prevents infinite loops.
- Memory: Configurable memory limit prevents excessive memory use.
- Check count: Limits the number of
check_*operations per execution. - Algorithm allowlist: Restricts which hash and signature algorithms are accepted.
- XMSS enforcement: Prevents XMSS leaf-index reuse across a verification pass.
Testing
The test suite includes lock/unlock script tests, fork lock tests, preimage tests, public key signature tests, branch tests, security tests, concurrency tests, edge case tests, and property-based tests.
Maintainers
- Dave Grantham dwg@linuxprogrammer.org
Contribute
Pull requests go to the cryptidtech/wacc
repository. Sign commits with GPG. Use Conventional Commits messages.
License
Licensed under Apache-2.0.
See LICENSE for the full text.