research: Poseidon2 vs Poseidon (queue item #2) — REJECT - #39
Open
alexandre-mrt wants to merge 1 commit into
Open
research: Poseidon2 vs Poseidon (queue item #2) — REJECT#39alexandre-mrt wants to merge 1 commit into
alexandre-mrt wants to merge 1 commit into
Conversation
Built Poseidon2 shadow circuits (transfer2/compliance2/withdraw2.circom, not wired into the deployed protocol) mirroring the production circuits 1:1, using @taceo/circom-lib's audited Poseidon2 templates. Independently cross-validated the hash construction against a from-scratch JS re-implementation before trusting it. Non-linear constraints dropped ~9-10% per circuit as hypothesized, but linear constraints grew more, and measured Node proving time got slower across all three circuits (+12-15%, mean of 10 runs) — the hypothesis's own number moved the wrong way. Verdict: REJECT for Veil's narrow-arity hash workload; the finding and a wide-arity follow-up are queued. Also: re-confirmed on-chain gas (queue item #1) is blocked by this session's proxy policy (403 on github.com/crates.io/Sui fullnode), and caught + fixed a real missing pathIndices boolean check in an early draft of merkle_proof2.circom before finalizing any numbers. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BbrvAftpwmT76AzJHa8fAe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Nightly research-loop run. Queue item #2: does swapping circomlib's Poseidon for Poseidon2 move
Veil's constraint count and proving time in the direction the Poseidon2 literature suggests, for
Veil's actual hash workload (not a synthetic benchmark)?
Verdict: REJECT. Full writeup:
docs/research/2026-08-21-poseidon2-hash.md.transfer2/compliance2/withdraw2.circom) mirroring theproduction circuits 1:1, using
@taceo/circom-lib's Poseidon2 templates. Not wired into thedeployed protocol —
pool.move,compliance.move,verifier.move, the frontend prover, andthe existing trusted-setup ceremony are all untouched.
against a from-scratch JS re-implementation built directly on the raw permutation, before
trusting the circuit — both matched bit-for-bit.
linear constraints grew more (+4.7% to +28.2%), and measured Node proving time got slower for
all three circuits by a similar margin (transfer +13.8%, compliance +14.5%, withdraw +12.0%,
mean of 10 runs, real Groth16
fullProve) — the hypothesis's own number moved the wrong way.tampered Merkle sibling, a non-boolean path selector, and a forged credential leaf/context
binding. One of those tests (N7) exists because I caught and fixed a real missing
pathIndicesboolean check in an early draft ofmerkle_proof2.circombefore finalizing anynumbers — documented in the report as a caution about hand-mirroring circuits.
reason than last time — this session's outbound proxy denies
github.com,crates.io, and theSui testnet fullnode with a policy-level 403, not a missed attempt.
EXPERIMENTS.md: item feat: Tier 3 — KYC compliance circuit + ElGamal auditor pattern #2 replaced with a narrower wide-arity Poseidon2 follow-up(tonight's data suggests Poseidon2 could still win once amortized over more absorbed elements
per permutation — untested here).
BASELINE.mdis unchanged (verdict is REJECT, not KEEP).Test plan
circuits/test/poseidon2-kat/kat_check.mjs— independent cross-validation, both constructions matchcircuits/test/poseidon2.test.mjs— 10/10 pass (3 positive controls + 7 negative tests)transfer.test.mjs43/43,withdraw.test.mjs35/35,compliance.test.mjs30/30scripts/src/test-converter.ts109/109,scripts/src/test-compliance-utils.ts67/67frontendvitest 19/19sui move test(124 tests) — still blocked, nosuiCLI / network access this session (see report)Generated by Claude Code