@ethproofs/openvm2-wasm-stark-verifier
v0.1.3
Published
WASM wrapper for OpenVM v2 STARK verifier - verify OpenVM v2 proofs in browsers and Node.js
Downloads
389
Maintainers
Readme
OpenVM v2 Wasm Stark Verifier
WebAssembly bindings for the OpenVM v2 STARK verifier.
Overview
This module builds the verify_vm_stark_proof_decoded function from the OpenVM v2 openvm-verify-stark-host library into WebAssembly, enabling STARK proof verification to run directly in both web browsers and Node.js environments.
This is the v2 counterpart of openvm-wasm-stark-verifier, updated to work with the OpenVM v2 proof format from openvm-eth.
Usage
Installation
npm install @ethproofs/openvm2-wasm-stark-verifierReact Integration
import init, {
main,
verify_stark,
} from '@ethproofs/openvm2-wasm-stark-verifier';
await init(); // Initialize WASM (if needed)
main(); // Initialize panic hook
// Verify a proof (supports both raw and zstd-compressed proofs)
const isValid = verify_stark(proofBytes, vkBytes);Node.js Usage
const { main, verify_stark } = require('@ethproofs/openvm2-wasm-stark-verifier');
// The Node.js version initializes automatically
main(); // Initialize panic hook
const result = verify_stark(proofBytes, vkBytes);Proof Format
- Proof bytes: Serialized
StarkProofWithPublicValue<F>in bincode v1 format, optionally zstd-compressed - VK bytes: Serialized
VmStarkVerifyingKeyin bitcode format
This matches the proof format produced by the openvm-eth reth-benchmark tooling.
Testing
Installation
npm installPrerequisites
Building
# Build for all targets
npm run build:allNode.js Example
npm run test:nodeThis runs the Node.js example that loads proof and verification key files from the filesystem and verifies them.
Browser Example
npm run testThis starts a local HTTP server at http://localhost:8080 with a browser example that demonstrates:
- Loading the WASM module in a browser environment
- File upload interface for proof and verification key files
- Interactive STARK proof verification
- Performance metrics and detailed logging
- Error handling and user feedback
Note: The browser example requires files to be served over HTTP due to WASM CORS restrictions. The included server script handles this automatically.
