Specification

WASM Verifier

**Draft.** Reference implementation: `crates/confium-wasm`.


status: accepted

Status

Draft. Reference implementation: crates/confium-wasm. Published as @confium/confium-wasm on npm.

Motivation

Browser-side verification requires a verifier that runs client-side without a server round-trip. WASM is the natural compilation target; verifier-only design (no signing) keeps the bundle small and the threat model clean.

Scope

  • wasm32-unknown-unknown target (browser, Node, edge workers)
  • Composite signature verification (Ed25519 + ECDSA-P256)
  • Transparency inclusion proof verification
  • Certificate chain verification
  • Attribute predicate evaluation

Out of scope

  • Signing (server-side only; enable via sign feature for WASI hosts)
  • Threshold ceremony participation (uses too much memory for browser)

Specification

Public API

export class CompositeSignature {
  constructor(components: Uint8Array[]);
  verify(message: Uint8Array): CompositeVerificationResult;
}

export class Certificate {
  static fromDer(der: Uint8Array): Certificate;
  verifyChain(anchors: Uint8Array[]): boolean;
  get fingerprintSha256(): string;
  // ...
}

export function verifyInclusionWithHead(
  proofJson: string,
  headJson: string
): boolean;

Feature flags

  • verify-composite (default): composite signature surface
  • verify-transparency (default): Merkle proof surface
  • verify-pki (default): cert + CMS surface
  • verify-attributes (default): predicate DSL

Bundle size

Default build (all features): ~460 KB WASM. With only verify-transparency: ~180 KB.

Security considerations

  • wasm32-unknown-unknown doesn’t expose host randomness; that’s fine for verification (no random nonces needed).
  • Consumer MUST verify integrity attribute on the <script> tag.
  • Compiled with -C opt-level=z for size optimization.

References

Edit on GitHub github.com/confium/specs/blob/main/specs/61-wasm-verifier.adoc