Research · Profiling

zkProf Harness

A profiling harness for zero-knowledge proving workloads that runs in the browser. It asks where the time goes and whether the clock that measured it can be trusted.

What it measures

Browsers coarsen performance.now() to blunt timing side channels. The coarsening depends on whether the page is cross-origin isolated. It is roughly 5 µs when the page is isolated and roughly 100 µs when it is not. That is a 20 times difference in the resolution of every number a browser profile produces.

Every report from the harness records the measured clock resolution and the isolation state. The harness refuses to report a number it could not resolve. The server that ships with it can run with isolation on or off, so both deployment contexts can be measured.

Status

This is a research prototype. Every work unit in the table below is merged to the main branch. Nothing in the repository is a benchmark. The committed measurements are single-machine and single-session runs with a single sample, and the repository says so next to each one.

AreaWhat it covers
CoreSpan API, clock abstraction, timer-resolution handling and the report model.
Arkworks backendA real Groth16 proof over BN254 on the native target.
WASM targetsScalar and +simd128 modules, a harness page and a server that sets the isolation headers.
MarshallingA microbenchmark of the call across the host and WASM boundary.
WebGPUA kernel dispatch checked against the CPU reference, and timestamp-query timing.
Render and diffCommands that turn reports into readable output and compare two of them.
Backend interfaceA backend trait with the arkworks implementation and a stub for tests.
Receipt verifierA verifier crate with a browser page and an independent twin, plus a combined bundle verifier that reports the proof half and the transparency half separately.
ReportingAn exporter for the csp-benchmarks suite, a FibRace-compatible view and a workload characterization of the AINumbers receipts.

Backends and circuits

BackendCircuitsStatus
arkworks-groth16merkle-poseidon and sha256Production
stubNoneTest harness

The merkle-poseidon circuit proves membership of a leaf in a Poseidon Merkle tree. The sha256 circuit proves knowledge of a preimage for a public digest. It comes from the csp-benchmarks suite, so a result on it can be compared with that suite.

The prover is taken apart so each stage can be timed. The stages are witness generation, the NTT, field arithmetic, the multi-scalar multiplications and a remainder. The harness checks the split prover against the upstream one, and the two proofs must be equal. Every run verifies its own proof before it writes a report.

Targets

The native binary runs the arkworks workload. The scalar and SIMD WASM builds run in a Web Worker inside the browser page, so the tab stays responsive. A WebGPU path checks a field kernel against the CPU reference. A threaded WASM build compiles but refuses to produce a report.

Where to get it

🔒 All inputs are processed locally in your browser. No data is transmitted. Do not enter real personal data — use synthetic or anonymised inputs only.