Try it Live
Run Blob examples in the interactive playground
Current Status
Supported Operations
Unsupported Operations
KZG operations require c-kzg-4844 native library (not available in WASM):Use Cases
Browser-Based L2 Clients
Use WASM for data encoding/decoding, compute KZG operations server-side:Backend KZG Service
Build Configuration
WASM Builds
Tevm provides optimized WASM builds:Output Files
Import in Browser
Performance
Data Operations
WASM performs well for data encoding/decoding:KZG Operations
For KZG operations, use native builds or backend services:Workarounds
Hybrid Approach
Use WASM for data operations, native for KZG:Pre-computed Commitments
For known data, pre-compute commitments:Testing
WASM-Specific Tests
Run WASM Tests
Future Support
Potential Improvements
-
WASM KZG Library
- Port c-kzg-4844 to WASM
- Maintain compatibility with trusted setup
-
Progressive Enhancement
- Detect native KZG availability
- Fall back to WASM-only operations
-
Worker Threads
- Offload KZG operations to workers
- Parallel commitment computation
Tracking Issue
Follow progress on WASM KZG support:Limitations
Memory Constraints
WASM has stricter memory limits:No Trusted Setup Access
WASM builds cannot load trusted setup:Best Practices
- Use Native for KZG - Always compute commitments/proofs in native environment
- WASM for Data - Use WASM builds for encoding/decoding/validation
- Backend Services - Provide KZG API for browser clients
- Pre-compute When Possible - Generate commitments ahead of time
- Test Both Environments - Run tests in both native and WASM
Resources
- Zig WASM - Zig WASM compilation
- c-kzg-4844 - Native KZG library
- WASI - WebAssembly System Interface
See Also
- Fundamentals - Blob basics
- KZG - KZG commitment scheme
- Usage Patterns - Real-world examples

