This page consolidates the performance measurements produced during the A.R.C. workstream (September 2025 - February 2026) for the Tx-Level Strategy, single service-provider prototype (v0.5), and explains how to reproduce them.
It answers the "Benchmarking of transaction construction latency, correctness and privacy guarantees" activity (Cardano Vision 2026, WP3 / Light Clients, T1.5) for deliverable D3.2.1. The executable specification tests protocol correctness; privacy and security claims are analysed separately rather than inferred from latency measurements (see section 4). This page focuses on the quantitative evidence.
Scope reminder: the delivered prototype is a single-SP, Tx-level flow
(register -> demonstrate -> prove -> verify/blind-sign -> submit). A multi-provider
("network") setting was not implemented (see Closing-Report.md).
Repository note. The component-benchmark harness is vendored in
benchmarks/. It was developed in the companioninput-output-hk/cavefish-zk-benchrepository; its commit history is preserved in this repository, with4cd06efas the importedmainsnapshot. The measured results are also reproduced inline in section 2.2.
Contents:
- What is measured
- ZK circuit performance (the bottleneck)
- End-to-end flow latency (prototype instrumentation)
- Correctness and privacy guarantees
- How to reproduce
- Sources
| Layer | What | Where the numbers come from |
|---|---|---|
| ZK component (Circom / Groth16 / SnarkJS) | Blake2b constraint count and setup / proving / verification time as a function of input size; setup has one sample per size, prover and verifier have multiple samples | the vendored benchmarks/ harness and its committed stats.json |
| Assembled Cavefish circuit | local compile / witness / setup / key-generation / prove / verify timings; compile time and circuit memory footprint are reported qualitatively in the historical analysis | zk-wbps (make ends with a benchmark report) and the January 2026 wiki analysis; no consolidated multi-sample benchmark of the assembled circuit is published here |
| Alternatives evaluated | folding (Nova), Halo2-based stack (Midnight-zk), "unequal hashing" (Poseidon in-circuit) | experiments and estimates documented in the wiki |
| End-to-end protocol flow (Haskell prototype) | per-step latency of register, demonstrate, prove, verify, submit, including every snarkjs sub-step |
performance.jsonl + performance-report.txt generated by each run of the nominal integration flow (PR #118) |
The circuit hashes the whole tx_body (txId = blake2b-256(tx_body)), so the
transaction-body size drives the circuit size. The distribution below was collected
from ~10k mainnet transactions sampled through BlockFrost (January 2026) and is used
for circuit sizing:
| Statistic | tx_body size (bytes) |
|---|---|
| min | 84 |
| median (p50) | 494 |
| mean | 785 |
| p75 | 906 |
| p90 | 1326 |
| p95 | 2512 |
| p99 | 5983 |
| max | 15036 |
Average transaction composition: body 785 B (39.4 %), witnesses 1089 B (54.6 %), auxiliary data 117 B (5.9 %), other 3 B (0.1 %).
The v0.5 circuit is sized for the mean: tx_body target 857 B + 32 B nonce = 889 B
= 28 x 254-bit limbs (message_size = 28*254), see
zk-wbps/README.md - Message sizing.
Measured during the January 2026 circuit-performance analysis (wiki, weeks 18-19):
- Binary hashing dominates the circuit. Blake2b (for
txId) and SHA-512 (for the Schnorr challenge) are bit-oriented and map poorly to R1CS; Blake2b over the variable-lengthtx_bodyis the main cost. - Scaling to the largest transactions is impractical with this stack: a 16 KiB
tx_body(the Cardano maximum) leads to > 10 minutes of circuit compilation and ~2 GB circuits; proving runs out of memory at the higher size percentiles on the development machines used. - A go/no-go threshold of 15-25 s proving time was discussed for the current approach, together with multiple circuit sizes keyed to the transaction length.
- A rough comparison with Midnight-zk (Halo2 / Plonk with lookup tables) showed better scaling for large transactions thanks to lookup-based SHA2/Blake2 gadgets, but a higher constant cost (lookup-table setup) that penalises small transactions.
The exact figures of a run on your machine (constraint count, per-phase timings of
compile / witness / trusted setup / Groth16 keygen / prove / verify) are printed by
make in zk-wbps/ (see section 5).
Measured component benchmark (Blake2b, the dominant cost). The
vendored benchmarks/ harness
measures each ZK component in isolation (Circom + Groth16 + SnarkJS). The Blake2b
sweep below is the load-bearing component result, since Blake2b over the tx_body is
what drives the Cavefish circuit. It is not an end-to-end or assembled-circuit
benchmark. Input size is the Blake2b message length in bytes; 2^k is the
Powers-of-Tau size selected for that instance. Setup was run once per size; prover
and verifier values are wall-clock averages. The n column is the prover sample
count (the verifier has 10 samples at every size):
| Blake2b input (B) | 2^k | Constraints | Setup (s) | Prover (s) | ± std | Verifier (s) | n |
|---|---|---|---|---|---|---|---|
| 128 | 17 | 79 387 | 42.5 | 2.95 | 0.11 | 0.339 | 30 |
| 256 | 18 | 158 418 | 101.2 | 7.66 | 0.38 | 0.464 | 10 |
| 384 | 18 | 237 450 | 134.2 | 8.95 | 0.39 | 0.467 | 10 |
| 512 | 19 | 316 481 | 180.8 | 12.63 | 0.41 | 0.371 | 10 |
| 640 | 19 | 395 513 | 216.2 | 13.30 | 0.21 | 0.356 | 10 |
| 768 | 19 | 474 545 | 232.6 | 13.74 | 0.37 | 0.351 | 10 |
| 896 | 20 | 553 578 | 326.6 | 25.35 | 2.07 | 0.408 | 10 |
| 1024 | 20 | 632 609 | 421.8 | 29.48 | 0.69 | 0.468 | 10 |
| 1152 | 20 | 711 641 | 427.9 | 24.93 | 0.64 | 0.389 | 10 |
| 1280 | 20 | 790 673 | 443.7 | 25.68 | 0.75 | 0.369 | 10 |
Reading it: constraints grow linearly with the input (~620 constraints/byte, i.e. ~79k per 128 B Blake2b chunk). Prover time shows large steps when the required Powers-of-Tau size increases (2.95 -> 7.66 s at 2^17 -> 2^18, 13.74 -> 25.35 s at 2^19 -> 2^20). Within one 2^k band the observed times are not monotonic with the constraint count: the four 2^20 instances range from 24.9 s to 29.5 s. The stored results do not contain enough run-order or host information to attribute that spread to noise, caching or another machine-level effect. Constraint counts are deterministic and reproducible; absolute times depend on the machine.
Caveats: the harness does not record the host hardware (CPU/RAM/OS), so absolute
times are not comparable across machines; and these are component measurements
(Blake2b alone) - the full wbps_cardano circuit (Blake2b txId + SHA-512 challenge
- ElGamal + Schnorr) is not yet benchmarked as one assembled circuit. Source:
benchmarks/stats.json(importedmainsnapshot4cd06ef; Groth16 + SnarkJS, circom 2.2.3, snarkjs 0.7.5). Pinning the commit matters: future harness changes may produce different results.
Documented in the wiki page zk-SNARKs for predicate verification - current design, problems and potential solutions (section 4, challenge C1 "the cost of binary hashing").
Circom + Groth16 + SnarkJS vs Midnight-ZK (Halo2 / Plonk). Measured in January
2026 (proving of the Blake2b hash over the tx_body, at the Cardano tx-size
percentiles of section 2.1), on a resource-limited laptop. A second Midnight run on a
Ryzen 9 5900X is included to show the hardware sensitivity. "PTAU" is the
Powers-of-Tau size 2^k used, not a duration:
tx_body (B) |
Circom-SnarkJS (PTAU / prover) | Midnight-ZK, laptop (PTAU / prover) | Midnight-ZK, 5900X (prover) |
|---|---|---|---|
| 84 (min) | 2^17 / 3 s | 2^17 / 30 s | 10 s |
| 494 (p50) | 2^19 / 13 s | 2^17 / 35 s | 10 s |
| 785 (mean) | 2^20 / 24 s | 2^17 / 36 s | 10 s |
| 906 (p75) | 2^20 / 27 s | 2^17 / 37 s | 11 s |
| 1326 (p90) | 2^20 / 28 s | 2^17 / 37 s | 10 s |
| 2512 (p95) | 2^21 / OOM | 2^17 / 39 s | 11 s |
| 5983 (p99) | 2^22 / OOM | 2^17 / 41 s | 12 s |
| 15036 (max) | - / - | 2^19 / 170 s | 43 s |
This is a different run from the sweep in section 2.2 and the two are not directly comparable: they agree at the small end (84 B here vs 128 B there, both 2^17, ~3 s; 494 B vs 512 B, both 2^19, ~13 s) but diverge around the mean, where 785 B here needs 2^20 / 24 s while 768 B in section 2.2 still fits in 2^19 / 13.7 s. The likely reason is that this table's instances were sized with headroom above the raw Blake2b circuit, crossing the 2^20 boundary earlier. Treat section 2.2 as the reproducible reference and this table as the comparative picture.
Reading it: Circom/SnarkJS (Groth16, BN254) is faster on small transactions but its
Powers-of-Tau size grows with the input and it runs out of memory from the p95
percentile up; Midnight (Halo2 with lookup-table SHA2/Blake2 gadgets, BLS12-381) pays
a large constant base cost that penalises small transactions but scales far better to
large ones, and it benefits strongly from hardware (the 5900X run is ~3-4x faster than
the laptop). These are Blake2b-only proving times, not the full assembled circuit:
the SHA-512 of the Schnorr challenge is computed over a fixed-size input
(R || X || txId), so it adds a roughly constant cost on top; the contemporaneous
estimate from the team was that including it would put the total at "a bit more than
double" these figures for the small-transaction cases. Source: #arc-cavefish
measurements, January 2026 (the wiki weeks 18-19 report refers to this comparison).
Folding (Nova) - measured on WSL, Intel i7-13620H (10 cores, 2.40 GHz), 16 GB RAM.
SHA-256 in Nova, folding steps only:
| Message blocks (1 block = 64 B) | Prover time (s) |
|---|---|
| 1 | 0.065 |
| 2 | 0.071 |
| 4 | 0.098 |
| 8 | 0.131 |
| 16 | 0.222 |
| 32 | 0.381 |
| 64 | 0.642 |
| 128 | 1.201 |
Compressed SNARK in Nova (executed once at the end):
| Constraints in the step circuit | Prover time (s) |
|---|---|
| 0 | 2.15 |
| 6399 | 3.04 |
| 22783 | 3.45 |
| 55551 | 4.39 |
| 121087 | 6.32 |
| 252159 | 10.33 |
| 514303 | 16.83 |
| 1038591 | 35.10 |
Unequal hashing (compute blake2b-256(tx_body) outside the circuit, Poseidon
inside, bind both with a universal hash - KVW25).
The prover times below are estimates, obtained from the linear regression
t_s = 0.001137 * stmt_bytes + 1.109 fitted on the paper's Groth16 measurements
(10-core MacBook, Apple M1 Max, 32 GB, macOS 15.6), evaluated at the Cardano
transaction-size percentiles of section 2.1:
tx_body size (B) |
Estimated prover time (s) |
|---|---|
| 84 (min) | 1.20 |
| 127 (paper) | 1.25 |
| 494 (p50) | 1.67 |
| 508 (paper) | 1.69 |
| 785 (mean) | 2.00 |
| 906 (p75) | 2.14 |
| 1326 (p90) | 2.62 |
| 2512 (p95) | 3.97 |
| 5983 (p99) | 7.91 |
| 8128 (paper) | 10.35 |
| 15036 (max) | 18.20 |
Other options analysed qualitatively in the same page: zkVMs, split hashing, variable-length strategies (hashing as a black box vs. conditional state updates, SHA-2 vs. Blake2 padding). The resulting recommendations are summarised in Recommendations for future steps.
Every run of the nominal integration flow (cabal test cavefish-tests:test) records
one JSON line per timed operation in
output/tests/integration-cavefish-nominal-flow/performance.jsonl and renders
performance-report.txt next to it (also printed at the end of the test). Events are
tagged with the registration and session identifiers, so timings can be attributed
per account and per session.
Timed operations:
| Label | Step | What it covers |
|---|---|---|
endpoint.register |
register | account registration, including snarkjs.generate.proving.key (Groth16 zkey) and snarkjs.generate.public.verification.context |
build.transaction |
demonstrate | transaction construction by the service provider from the intent |
endpoint.demonstrate |
demonstrate | commitment construction: snarkjs.build.commitment, snarkjs.export.statement.json |
endpoint.prove |
prove | challenge/witness/proof generation: snarkjs.generate.witness, snarkjs.generate.proof |
snarkjs.verify |
verify | client-side Groth16 proof verification |
endpoint.submit |
submit | blind-signature completion and transaction submission (emulator) |
The report gives, per label: count, average, min, max and delta (ms), an overall
summary, per-account / per-session sections and the slowest events. Endpoint events
contain their SnarkJS sub-events, so Total recorded time and the account/session
totals deliberately double-count nested work. They are diagnostic totals, not
end-to-end latency. Use the endpoint rows (and the report's wall-clock window) for
headline latency figures.
The build.transaction event records tx_body_bytes. Report that value with every
reference run: circuit cost is driven by transaction-body size, so a latency without
the corresponding byte size is not comparable to another run. Keep the raw JSONL
next to the rendered report; the report alone cannot be independently regrouped or
checked.
Reference run (v0.5, nominal flow, emulator-backed submission):
| Operation | n | Average (ms) | Min (ms) | Max (ms) |
|---|---|---|---|---|
endpoint.register |
1 | 10 285.19 | 10 285.19 | 10 285.19 |
endpoint.demonstrate |
3 | 234.93 | 224.09 | 245.33 |
endpoint.prove |
3 | 4 243.22 | 4 188.37 | 4 333.03 |
snarkjs.verify |
3 | 231.76 | 222.70 | 246.81 |
endpoint.submit |
3 | 4.95 | 4.61 | 5.57 |
The measured tx_body was 196 B in all three sessions. The report's wall-clock
window was 24.49 s for one registration followed by three sequential sessions.
Registration was dominated by Groth16 proving-key generation (9 959.64 ms of
10 285.19 ms). Proving was dominated by witness generation (1 511.84 ms average)
and proof generation (2 728.05 ms average). These endpoint and sub-step timings are
not additive across rows because the sub-steps are nested inside their endpoints.
The test console independently reported the nominal scenario as PASS (1 example, 0 failures) in 24.4943 s, matching the performance-event window after rounding.
The same console later reported the separate wbps-integration-tests suite as
PASS (5 tests) in 124.78 s. That suite duration includes several independent
integration cases and is recorded as a correctness/test outcome, not as end-to-end
Cavefish latency.
Run context (27 August 2026): Parallels VM, Ubuntu 24.04 / Linux
6.8.0-134-generic aarch64, 8 allocated Apple-Silicon vCPUs, 62 GiB RAM, Circom 2.2.2,
SnarkJS 0.7.6. The checkout was commit 1b8c421 plus a local, behaviour-preserving
refactor that moved the test's toAddressW helper into Intent.Example.DSL; the two
output files were generated together. This is retained as a measured v0.5 reference,
not represented as a clean-checkout run. Re-runs from the current branch should use
the commands below and report their own commit and environment.
These properties are not performance metrics, and the evidence is different for correctness and for privacy/security:
- Correctness - the nominal flow is an executable specification
(prototype/packages/tests/test/Cavefish/Nominal.hs):
it asserts that the proof verifies against the rebuilt statement, completes the
blind signature, submits the transaction and checks that it is accepted by the
emulated chain (
TxStatusSubmitted). In the reference execution above, both the nominal scenario (1 example) and the separate WBPS integration suite (5 tests) passed. Unit and integration suites:cabal test all(see prototype/README.md). - Privacy / security properties (weak blindness, unforgeability, selective disclosure, private-until-posted) - analysed, rather than established by these performance tests, in the security analysis of the first prototype (issue #65) and in the paper Cavefish: Communication-Optimal Light Client Protocol for UTxO Ledgers (ePrint 2026/217).
Prerequisites: see prototype/README.md
(Nix, Git LFS artefacts, prebuilt babyjubjub-keygen).
End-to-end flow report:
git lfs install && git lfs pull
cd prototype
nix develop
cabal update
cabal test cavefish-tests:test
# report: output/tests/integration-cavefish-nominal-flow/performance-report.txt
# raw events: output/tests/integration-cavefish-nominal-flow/performance.jsonlBefore publishing the result, copy both output files together and extract the
tx_body_bytes tag from the raw events. Do not use Total recorded time as flow
latency: it sums nested endpoint and SnarkJS events.
Circuit benchmark (compile, witness, trusted setup, Groth16 keygen, prove, verify):
cd zk-wbps
nix develop
make # = compile + input + witness + setup + prove + verify + bench-report
make info # constraint count (snarkjs r1cs info)
# per-run artefacts and logs: build/wbps_cardano/runs/<UTC timestamp>/logs/Component sweeps (the table in section 2.2) - the vendored benchmark harness:
git submodule update --init --recursive
cd benchmarks
# needs circom 2.2.3, snarkjs 0.7.5, Python 3.12, numpy 1.26.4 and wget 3.2
python3 scripts/circom-benchmark.py \
-i blake2b -c 512 -f -s 1 -p 10 -v 10 # recreate one instance and collect samples
python3 scripts/info.py -i blake2b -p # aggregate all local Blake2b instances-f deletes any existing build directory for that instance before the run; without
it, full mode refuses to reuse an existing configuration. Conversely, execution-only
runs append samples to log_plain.json. Preserve the command line and the raw
per-instance log with any published aggregate so the sample provenance remains
auditable. The historical 128 B row has 30 prover samples; the other rows have 10.
When publishing new numbers, always record: hardware (CPU, allocated cores, RAM), OS
and kernel, VM/native execution, commit hash, input size, circom and snarkjs
versions, sample counts, and whether the run used the LFS artefacts or regenerated
them.
benchmarks/(companion-repositorymainimported at4cd06ef) andbenchmarks/stats.json: the measured component benchmarks (Blake2b sweep, SHA2, Poseidon2, scalar-mul), Groth16 + SnarkJS.- Wiki, bi-weekly report weeks 18-19 (January 1-15, 2026): circuit performance analysis, transaction-size sampling, Circom vs. Midnight-zk comparison, go/no-go threshold.
- Wiki, zk-SNARKs for predicate verification - current design, problems and potential solutions: hashing cost analysis, Nova benchmarks, unequal-hashing estimates.
- Wiki, Recommendations for future steps.
- zk-wbps/README.md (message sizing) and zk-wbps/Makefile (
bench-report). - Prototype instrumentation: WBPS.Core.Performance, PR #118.
- Closing-Report.md and the wiki February 2026 closing report.