wasm-engine

Develop browser-executed cryptographic primitives for KZG-VSS, stealth addressing, and encrypted DMs.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/MoriwakiYusuke/anarchy --skill wasm-engine
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: wasm-engine
Source: https://github.com/MoriwakiYusuke/anarchy/tree/main/.claude/skills/wasm-engine
Command: npx skills add https://github.com/MoriwakiYusuke/anarchy --skill wasm-engine

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you implement and evolve Anarchy’s browser-executed cryptography reliably, so encrypted messaging and stealth addressing work consistently across Rust, WebAssembly, and the frontend.

Core Features & Use Cases

  • Wasm-bindgen boundary design for crypto APIs: define Rust/JS-safe inputs/outputs, avoid traps, and standardize error handling via Result<T, JsError>.
  • KZG-VSS hybrid scheme: implement KZG commitments/proofs with a VSS split/recover flow for verifiable storage-ready ciphertext sharding.
  • Stealth addresses (EIP-5564 compatible): generate scan/spend keys, derive one-time stealth addresses, scan quickly for ownership, and keep backup semantics safe.
  • Direct Message (DM) E2E encryption: encrypt, apply fixed-size bucket padding, envelope/inner-hash signing, fragment ciphertext for storage, and support deterministic decryption scanning.
  • Frontend/Worker consumption pattern: consume the generated pkg artifacts from Next.js and offload heavy proof/splitting/scanning tasks to a Worker pool to prevent UI freezes.

Quick Start

Ask the system to guide the implementation of a new wasm-bindgen API in packages/wasm-engine by updating the Rust module, re-exporting it from lib.rs, generating the pkg TypeScript types with wasm-pack, and verifying correctness with fixed test vectors for KZG/stealth/DM.

Frequently Asked Questions about wasm-engine

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose Rust cryptography functions to Next.js using wasm-bindgen?▼

To expose Rust cryptography to Next.js using wasm-bindgen, define Rust/JS-safe inputs and outputs, standardize error handling via Result<T, JsError>, and generate TypeScript types with wasm-pack to prevent boundary traps.

What is the best way to prevent UI freezes when running heavy Wasm cryptographic proofs in the browser?▼

The best way to prevent UI freezes during heavy Wasm cryptographic proofs is offloading split, proof generation, and scanning tasks to a Worker pool, consuming the generated pkg artifacts directly from Next.js.

How do I implement EIP-5564 stealth address scanning in WebAssembly?▼

Implement EIP-5564 stealth address scanning in WebAssembly by generating scan/spend keys, deriving one-time stealth addresses, and performing fast ownership checks while maintaining safe backup semantics.

How does KZG-VSS work for sharding encrypted ciphertext in the browser?▼

KZG-VSS sharding works in the browser by implementing KZG commitments and proofs with a VSS split/recover flow, creating verifiable storage-ready ciphertext shards directly within WebAssembly.

Why does my Wasm direct message encryption fail known-answer tests for one-bit-breaking primitives?▼

Wasm direct message encryption fails known-answer tests for one-bit-breaking primitives due to inconsistent SRS initialization, incorrect JsError deterministic handling, or broken fixed-size DM padding bucket compatibility.

Do I need a Worker pool for deterministic DM decryption scanning in Next.js?▼

You need a Worker pool for deterministic DM decryption scanning in Next.js to offload heavy scanning loops and envelope/inner-hash signing verification, preventing the main thread from freezing.