Measuring a hash-based STARK privacy pool on Ergo: what in-script verification costs, where its soundness caps, and what a native verifier would need

What this is, and what it asks. We built a fixed-denomination hiding pool whose membership proof is a hash-based STARK, and verified it in ErgoScript on unmodified nodes — no fork — then measured the whole lifecycle on a devnet.

This is the privacy-proof companion to the base-layer post-quantum work already on this forum (the exposure scan and no-fork hash-based spend, [5369]; the SLH-DSA verifier, quantum-day vault and rotating address, 5372; the key derivation, 5385). The point of this post is not a product — it is a measurement: what does in-script STARK verification cost on Ergo today, where does its soundness cap under the relay-size limit, and what would a native verifier (the subject of EIP-0045, 5316 or transaction-chaining need to do to make it secure? It is devnet-only, unaudited, and must not hold real funds. Nothing for holders to do; this is a request for review before testnet, and empirical input to the native-verifier question.

The headline finding. It runs — a ~14 KB verifier expression plus a ~48 KB proof fit, just, under Ergo’s 98,304-byte relay limit, so a withdrawal verifies on a stock node. But that budget forces the FRI parameters down to 16 queries, and at those parameters the provable soundness is low: the query phase gives a soundness error of about 2⁻⁴⁰ (Reed–Solomon at the Johnson radius, rate 1/32), and 20 bits of grinding raise an attacker’s work to about 2⁶⁰. A ~2⁶⁰ grind is embarrassingly parallel and classically cheap — Bitcoin-scale hardware does it in well under a second — so at the proven bound a resourced classical attacker can forge a withdrawal today. The pool’s safety rests on the true soundness sitting well above that proven floor (nearer the ~99 the tooling conjectures); recent work disproving the up-to-capacity proximity-gaps conjecture in its stated form (Crites–Stewart 2025/2046; and, for Reed–Solomon over a smooth multiplicative subgroup of a prime field — our code family — Krachun–Kazanin–Haböck 2026/782) removes our evidence for that higher number without lowering the true one. Whether it bites our exact parameters is open (ask 2). So the measured result is: in-script STARK verification works on Ergo, but the relay cap holds it at a soundness floor that is not yet safe.

Why that is the interesting number: soundness vs. transaction size. Lifting the floor means more FRI queries — and the sweep shows that in the degree-2 extension F_{p²}, the provable figure caps near 94 bits at 32 queries (beyond that the field terms, not the queries, bind). Thirty-two queries roughly doubles the per-query openings, pushing the withdrawal over the 98 KB relay cap. So a safe classical floor cannot be reached in a single transaction with this
construction. Two ways out, and both are what a serious reviewer should weigh:

  • A native verifier (EIP-0045’s direction): if the node verified STARKs natively, the 14 KB in-script expression and much of the per-query overhead leave the transaction, and the query budget is set by security rather than by relay bytes. Our measurements are a concrete statement of what that opcode would have to accommodate.

  • Transaction-chaining (no fork): split the verification across several chained transactions, each carrying the verifier’s intermediate state, the way a single hot box serves many operations today. We have not built this yet; it is the next thing we will run and measure, and we will report it as a follow-up to this post.

If a forged withdrawal did get through, a turnstile invariant in the contract bounds the damage: the pool is one box with a visible balance and fixed denominations (so ordinary UTXO value-conservation already stops minting ERG), and each spend moves exactly one denomination, so one forged proof steals at most one denomination, never more than the pool holds. It protects the chain’s supply, not the depositors.

The rest of the security budget, stated honestly.

  • Classical, per component. The binding term is the FRI low-degree test above (~2⁻⁴⁰ query error, +20-bit grinding work-factor — “proven” for the interactive protocol; the Fiat–Shamir compilation of our exact fold is not covered by a published round-by-round proof, so for the deployed non-interactive proof it is conjectured — ask 3). The other terms (ALI batching, DEEP quotient, FRI commit-phase, SHA-256 Merkle collision) sit at ~2⁻⁹⁰ or better at |F_{p²}| ≈
    2¹²⁸ and do not bind here, but they are the ceiling once queries rise. n throughout is the code block length (~2¹⁴: a ~512-row trace times the 32× blowup), not the 2¹⁵-leaf membership tree.

  • Post-quantum. The reason to use a hash-based proof at all: there is no discrete-log assumption to break, so no structural Shor attack. But the post-quantum soundness number is moot until the classical floor is raised — a quantum adversary does not need Grover when the classical 2⁶⁰ grind is already cheap. For the record, the query-model estimate is the classical figure halved (~30 bits), a corollary of the QROM bound of Chiesa–Manohar–Spooner 2019/834 over the round-by-round soundness of Block et al. 2023/1071 (a classical result); it is an estimate, not a theorem for our instantiation, and even the concrete Grover attack sits within NIST’s MAXDEPTH range, not beyond it. The honest statement is: hash-based soundness is the right direction for post-quantum; the current parameters do not yet deliver a meaningful post-quantum level, because they do not yet deliver a safe classical one.

  • Hiding is computational, and that is a property of the hash-based STARK itself, not of the leaf. The trace — which carries s, r, the path and the index — is committed under salted SHA-256 Merkle leaves and opened at the query positions; an unbounded adversary inverts those openings and reads it, whatever the leaf commitment is. So everlasting privacy is out of reach for any hash-based IOP. s and r are two Goldilocks elements each (≈128 bits); the leaf digest is four elements (≈256 bits, ≈128-bit collision resistance); linking a deposit to a withdrawal costs ≈2¹²⁸ classically / ≈2⁶⁴ under Grover (NIST Category 1), conditional on Poseidon2’s algebraic security at this width. Zcash Sprout shares this (a hash commitment); Sapling and Orchard use perfectly-hiding commitments — but even they are not everlastingly private against a quantum adversary, since their note ciphertexts ride on elliptic-curve key exchange that Shor breaks. (Statistically-hiding hash commitments do exist — Halevi–Micali — but they would not help, because the STARK’s zero-knowledge is the limiting layer.)

Versus the existing mixer. ErgoMixer is deployed, used, and classically ~128-bit; this prototype is devnet-only and classically ~60-bit at the proven bound — so it is not a drop-in improvement. Where a hash-based design wins is the quantum axis, and on two counts: a quantum adversary cannot forge the membership proof (no Shor target), and cannot retroactively de-anonymize past withdrawals the way Shor against the mixer’s discrete-log unlinkability would (our hiding is Grover-only at ≈2⁶⁴). It is not post-quantum end-to-end regardless: Ergo payout authorization and user keys are secp256k1, which is exactly what the base-layer work ([5369]/[5372]/[5385]) addresses — this pool and that work are two halves of the same program, and neither alone is end-to-end.

How the pieces bind (the one mechanism worth stating precisely). The box script pins the verifier by hash — blake2b256(getVar(7)) == VerifierHash — and runs it with executeFromVar, so the spender cannot substitute a permissive verifier. The committed Merkle root (from the box’s register), the revealed nullifier (checked absent in and inserted into an on-chain AVL set), and the payout (OUTPUTS(0)) are bound into the proof’s public inputs, so a mempool observer cannot redirect the withdrawal. Pool identity is a singleton token minted by a one-shot launcher whose script forces a clean genesis and the canonical pool script; a client verifies lineage back to a launcher hash it trusts.

Deposits append a leaf to a depth-15 Poseidon2-over-Goldilocks tree, recomputed on chain (~106k units, ~14 KB). STARKs need no trusted setup. The anonymity set is per-denomination (1/10/100 ERG) and only as large as that pool’s live deposits — today, zero.

What we would value review on (we will share the AIR, the verifier expression, the exact Plonky3 configuration, and the soundness derivation with anyone who takes an item up — same as 5369 shipped code with a static page):

  1. The classical error budget above — is it right for this exact shape, and what is the honest proven work factor?

  2. Does the capacity-conjecture disproof materially affect our parameters (n≈2¹⁴, rate 1/32, challenges in F_{p²})? The bad-challenge construction in the cited work is explicit; we have not computed its impact at our parameters.

  3. Is a round-by-round soundness proof tractable for our exact fold (one arity-8 fold driven by powers of a single challenge) composed with DEEP-ALI — the piece that would make the non-interactive soundness a theorem rather than an estimate?

  4. For the native-verifier question (EIP-0045): given these measurements, what query budget and proof size would an opcode need to support to reach a provable ~100-bit classical floor — and is transaction-chaining a credible no-fork alternative worth us building and measuring next?

Tell us where this is wrong. This is a measurement of what Ergo can do in script today and what it would take to do it safely, not a claim that it is safe today.

Thanks for publishing these measurements and being explicit about the prototype’s limits. I think they can inform a broader question: what would it take to give Ergo reusable post-quantum authorization and proof-verification capabilities across its eUTXO model, with this pool as one demanding use case?

I would start by fixing the security target, then asking what Ergo must change to accommodate it. For the long-term system, I would argue for a deployment floor of 128-bit post-quantum security under an explicit attack-cost model. The discussion in ZK episode 393 (zeroknowledge.fm/podcast/393/), around 29–31 minutes, makes the case for 128 bits of provable security rather than conjectural estimates. That passage does not itself define 128 bits of quantum attack work: we still need to specify the classical and quantum models separately. A 128-bit classical estimate, a NIST category and 128-bit quantum security are not interchangeable. The protocol and transport constraints should adapt to the chosen security requirement, rather than the requirement being reduced until the proof fits.

“Provable” here means a concrete bound under clearly declared assumptions, not assumption-free cryptography. Each component needs its own analysis, and the composition needs one too: nominally assigning 128 bits to the field, hash, transcript and signature does not automatically produce a 128-bit system. Soundness, spending authorization and privacy also need separate guarantees. A 100-bit classical milestone can be useful for research, but it would not close that deployment target.

There are two claims in the post I would qualify. A conservative soundness bound does not establish an efficient withdrawal forgery at that bound; the 2^60 claim needs an applicable attack and its cost per attempt, including for the Bitcoin-throughput comparison. Conversely, avoiding the discrete-log route through Shor does not establish quantum unforgeability. The recent small-field results are a reason to examine the exact construction, not to infer either practical insecurity or adequate security from the label “hash-based.”

Your links to the vault and key-derivation work already recognize the authorization side of this. To complete that path, Schnorr alone cannot remain sufficient to spend funds once post-quantum protection is claimed. A STARK proving that a Schnorr signature verifies would also accept a valid signature produced by a quantum attacker. A hybrid requiring both classical and independently secure PQ authorization may be a migration option; a Schnorr-only alternative does not provide the same guarantee. Existing boxes retain their locking conditions, so migration, recovery and the protection of payout destinations need explicit treatment. Replacing a signature check also does not automatically preserve Sigma’s private OR and threshold semantics.

For EIP-0045, the aim is a reusable verification facility, but its proposed initial RISC Zero profile is an interoperability candidate. Its stated estimate is roughly 95 conjectured classical bits, not a production custody target or a PQ guarantee. Completing the implementation and activation work would not, by itself, increase that security. A stronger profile would need its own specification, analysis, identity and validation. Your Plonky3 configuration is not directly interchangeable with that RISC Zero profile.

Native execution of the same verifier on the same proof and parameters would be a useful comparison: it isolates execution overhead without changing the cryptographic argument. It does not automatically eliminate the proof openings. If the field terms make your current bound plateau near 94 bits, reaching a stronger target needs a tighter analysis or a change of parameters/protocol; extra queries or splitting the same verification across transactions do not resolve that alone. That is a limit of the stated analysis, not necessarily an intrinsic ceiling on the construction.

A coherent way to advance in parallel might be:

  • On the pool side, publish a minimal reproducible package: exact AIR and transcript, prover/verifier revisions, parameter configuration, one proof with its public statement, and the complete transaction and devnet measurements. That gives independent reviewers a concrete object to reproduce.
  • Alongside it, identify the first term preventing the chosen security target and map the resulting size/cost tradeoff. This would show whether the next useful change is a stronger field, different proof parameters, a tighter argument or a different construction. Keep proven and conjectured results, and classical and quantum guarantees, visibly separate.
  • At the application/protocol boundary, specify what every accepted proof must bind: the relevant box/state identity, recipient, value and assets, nullifier or other replay protection, and the authorized transition. The native-verifier work can then address the corresponding formats, independent verifier agreement, worst-case metering, node admission, reorg behavior and activation requirements. Those remain substantial open work, not consequences of a successful devnet withdrawal.

I would keep aggregation as a subsequent option across eligible eUTXO spends, rather than make pool-specific batching the architectural starting point. Direct PQ authorization should remain a baseline: a general proof system has to justify its additional cost. If aggregation helps, compare cost per finalized spend at the same security target and assumptions, including proving latency. Larger batches can change the security bound; aggregation also does not remove double-spend checks or data-availability requirements, and it does not make transparent transactions private.

That would let the pool advance as a useful test case while keeping the wider objective clear: a reusable capability with an explicit security target, a migration path, and measurements that tell us which protocol changes are actually needed.

Prepared with Claude (Anthropic, Claude Opus 5.5), which checked each point against the build record; reviewed by Grok, Gemini and Muse.

Thank you. This is the review the post asked for. I’ll follow your order.

The target. Agreed: the target comes first. Classical, quantum query-model and quantum cost-model figures should be reported separately, and the composition needs its own analysis, not just the components. Below, we give classical and quantum query-model figures. We haven’t computed a cost-model figure (circuit depth against NIST’s MAXDEPTH), and we’ll name the model whenever we do.

Where we differ: you propose 128 bits post-quantum as the floor. For the pool’s soundness we’d accept 128 classical bits, proven (about 64 in the query model), but only for a verifier that can be upgraded. A soundness break can only be exploited while the verifier is live, and an upgradable one can be retired. Our verifier is pinned by hash today, so by that rule it falls short. If the floor is 128 post-quantum in the query model, the last row of the table below is what it costs this construction. The ~91 we’re building next is a research milestone, as you said of 100.

Hiding is the property that has to hold for the life of the chain. Linking a deposit to a withdrawal costs about 2¹²⁸ classically and 2⁶⁴ Grover queries (comparable to NIST Category 1, AES-128 key search), conditional on Poseidon2’s security at this width. The record it protects stays on chain forever. A higher level means wider secrets and a wider hash; everlasting hiding needs a different construction.

On composition: the pool’s soundness also depends on the collision resistance of the in-circuit Poseidon2 (a leaf collision is a double withdrawal) and of SHA-256 in the commitments. The package will state each term and how they combine.

The two claims. You’re right on both.

  • At the proven bound, a cheating prover’s chance per proof attempt is about 2⁻⁴⁰ (16 queries at rate 1/32), and grinding makes each attempt cost about 2²⁰ challenger hashes. A fresh attempt needs only a new grinding search, not new commitments. That is a floor of about 2⁶⁰ expected work for the interactive protocol; for the deployed non-interactive proof the floor is conjectured. It is not an attack: we know of no construction that reaches that acceptance at our parameters.
  • The Bitcoin comparison doesn’t hold. Those ASICs hash 80-byte headers and can’t run Plonky3’s challenger.
  • The conjectured ~99 bits lost its supporting evidence with the proximity-gaps results. Whether those results bite our parameters is still open.
  • “No Shor target” only means there is no discrete-log assumption for Shor to break. It does not establish quantum unforgeability.

Authorization. Agreed that Schnorr can’t stay sufficient once post-quantum protection is claimed, and that a STARK over a Schnorr check would accept a quantum forger’s signature.

  • The pool’s own input needs no signature. The proof spends it and binds the payout’s script and value, so the payout can go to a lock with hash-based keys, or to a hybrid that requires both, as you suggest. Thread 5372 built such locks on a devnet; they are not for value yet.
    Thread 5385 proposes deriving their keys from the wallet seed; no wallet implements it.
  • For boxes that already sit under P2PK, we think the shape is a soft-fork restriction after a voted flag, with a rescue for owners who can prove knowledge of their seed. That EIP isn’t written yet.
  • Agreed that a signature swap doesn’t bring Sigma’s OR and threshold semantics with it.

EIP-0045. Agreed that the first profile (about 95 conjectured classical bits, no post-quantum claim) and our configuration aren’t interchangeable. For scale: the Johnson-regime arithmetic that gives our 40 bits gives about 50 for its 50 queries at rate 1/4 with no grinding. A September review on the PR made the same point. I’ve asked two questions on the PR about contracts that have to outlive a profile: PR 103 comment.

Native verifier, and splitting the verification. Agreed on both.

  • In the measured withdrawal (65,456 bytes), the proof is 47,688 bytes, the verifier expression 14,394, and the rest is the transaction’s other bytes. A native verifier saves about 22 % of the bytes. A larger query budget would come from a larger transaction allowance, not from going native.
  • Splitting the same verification doesn’t move the field terms. In F_{p²} the most any number of queries reaches is 94.34 bits. About 91 fits in one transaction, so chaining buys at most about 3 bits.
  • That changes the plan in the post. About 91 proven bits fit in one transaction by raising the blowup instead of chaining: rate 1/64 and 24 queries give a modelled withdrawal of about 90.6 KB, under the 98,304-byte relay default. So chaining is no longer next.
  • The same-proof native comparison you suggest needs a node-side verifier for this configuration. We haven’t scheduled it.

Your three tracks.

  1. The package, as you list it: the AIR, transcript and challenger; the prover and verifier revisions; the configuration; one proof with its public statement; the complete withdrawal transaction; and the devnet measurements. We’ll add the estimator calls and the proof-layout model behind the numbers here.
  2. The first binding term. At the deployed configuration it is the FRI query term: about 40 bits of query error and a separate 20-bit grinding work factor. With more queries, the next term in F_{p²} is batch combination in Plonky3 0.8.0’s Johnson-regime estimate, over the 114 batched functions. That caps the proven figure at 94.34 at rate 1/32, and the cap falls as blowup rises (88.34 at 1/256). As you suspected, this is a limit of the analysis that we haven’t shown to be a property of the construction. Whether a tighter batching argument recovers bits here is open. The way past it that we can compute is a larger field. Estimated sizes (the estimator’s Johnson regime; proven for the interactive protocol, conjectured for our non-interactive proof):
target needs proof (modelled) under the 98,304-byte relay default?
~91 F_{p²}; rate 1/64, 24 queries: binding term batch combination 91.25; query error ~68 + 24-bit grinding 70–73 KB; withdrawal 88–91 KB yes
128 a ≥ 192-bit field (Plonky3 ships a cubic and a quintic Goldilocks extension; the pool over them is untested); rate 1/256, 28 queries: query error 112 + 24-bit grinding, capped at 128 by SHA-256’s (assumed) collision resistance ~120 KB no: staged through data inputs or chained; no fork
128, quantum query model (CMS19) ~256 bits from query error alone (rate 1/256, 64 queries), a ~320-bit field (the quintic), and a hash with ≥ 384-bit output for collision resistance under BHT ~400 KB no. ErgoScript’s hash functions are blake2b256 and sha256; a wider hash means an opcode (a fork), or SHA-512 built from 6.0’s bitwise operations (expressible, cost unmeasured)
  1. Binding. An accepted proof today binds:

    • the root, which must be in the pool’s root history;
    • the nullifier, checked absent and then inserted;
    • the payout’s script and value (the pool is ERG-only).

    It does not bind the pool’s identity, and we ran the consequence on a devnet. Anyone can create a box under the pool script. A copy with a real pool’s root and an empty nullifier set lets an earlier depositor withdraw again, out of whatever new deposits the copy attracts. What stops this today is outside the proof: the singleton pool token and the client’s lineage check, so an honest client never deposits into the copy. The next build binds the pool’s token id into the proof.

    The pool’s transition (the append, the nullifier insertion, exactly one denomination out) is checked by the contract, not the proof. The statement we publish will list both sides.

Aggregation. Agreed, later. When it comes, we’ll compare cost per finalized spend against direct post-quantum authorization at the same target and assumptions, including proving latency.