research: poseidon-constraint-attribution - #48
Conversation
Re-verifies on-chain gas (item #1) is structurally blocked this session (GitHub access scoped to this repo only, plus a categorical network-policy block across six different Sui RPC providers) rather than a toolchain gap, and re-ranks the queue accordingly. Pivots to measuring Poseidon's exact non-linear-constraint share per circuit via scripts/bench/constraint-breakdown.mjs: transfer.circom 93.1%, compliance.circom 94.3%, withdraw.circom 78.0%, reconciled exactly against a fresh full-circuit compile. This bounds what a future Poseidon2 port could ever save, without shipping an unverified from-scratch Poseidon2 gadget (no verified source is reachable from this session either). Also adds circom2 (npm-distributed circom 2.2.3, WASM) as a devDependency in circuits/ — a GitHub-independent reproduction path that reproduces the 2026-07-22 baseline bit-for-bit, since the original from-source cargo build no longer works in every environment this loop runs in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017K5iSV2PDEVBMhH23j9a7y
|
CI on this PR: Both fail identically, at the very first step, before any checkout of test code: That pin is in Proposed patch, for whoever picks this up: the pinned commit SHA for Not blocking this PR's own changes (measurement scripts + docs; Generated by Claude Code |
Summary
Nightly research loop, 2026-08-30. Two parts:
Re-verified queue item feat: Veil privacy payment protocol — full stack MVP #1 (on-chain gas) and confirmed it's now structurally blocked, not a toolchain gap: this session's GitHub access is scoped to
alexandre-mrt/veilonly (blockssuiCLI release binaries), and direct JSON-RPC to six different Sui fullnode providers all get an identical network-policyconnect_rejected/403. Needs a human to grant GitHub access toMystenLabs/suior add a network-policy exception — no in-session workaround exists. Re-ranked inEXPERIMENTS.mdwith this noted so future nights don't re-spend a night on it.Measured Poseidon's exact share of each circuit's constraint budget (
scripts/bench/constraint-breakdown.mjs): compiled every named gadget (Poseidon(2/3/4/5), range checks, comparators, the wholeMerkleProof(20)template) in isolation viacircom2, and reconciled the sum against a fresh full-circuit compile — exact to within 0–3 constraints for all three circuits.transfer.circomcompliance.circomwithdraw.circomThis bounds what a future Poseidon2 port could ever save. The port itself is PARKed — no verified Poseidon2
.circomgadget is reachable from this session (same GitHub-scoping root cause as item feat: Veil privacy payment protocol — full stack MVP #1); writing one from memory was rejected as unverified crypto rather than measured.Added
circom2(npm-distributed circom 2.2.3, WASM) as acircuits/devDependency — a GitHub-independent reproduction path that reproduces the 2026-07-22 baseline bit-for-bit, since the original from-sourcecargo buildagainst a clonediden3/circomno longer works in every environment this loop runs in.Full report:
docs/research/2026-08-30-poseidon-constraint-attribution.md. Ledger, experiment queue, andBASELINE.mdall updated.Test plan
node --experimental-vm-modules test/{transfer,compliance,withdraw}.test.mjs— 108/108 pass (real Groth16 proofs, freshly compiled withcircom2)cd scripts && bun run src/test-converter.ts— 109/109 passcd scripts && bun run src/test-compliance-utils.ts— 67/67 passcd scripts && bun run src/fuzz-tests.ts— 6/6 properties × 500 cases passcd frontend && bunx vitest run— 19/19 passcd contracts && sui move test— NOT RUN, same pre-existing blocker as 2026-07-22 (nosuiCLI available this session)node scripts/bench/constraint-breakdown.mjs— reproduces the per-gadget table and reconciliation in the reportNo circuit, Move module, or frontend proving code was changed — this is a measurement-only night.
Generated by Claude Code