Skip to content

research: onchain-gas-baseline - #91

Open
alexandre-mrt wants to merge 1 commit into
mainfrom
claude/intelligent-cannon-kns470
Open

alexandre-mrt wants to merge 1 commit into
mainfrom
claude/intelligent-cannon-kns470

Conversation

@alexandre-mrt

Copy link
Copy Markdown
Owner

What was tested

Queue item #1: on-chain gas per entry point. Hypothesis — Groth16 verification is ≥ 50 % of shielded_transfer net gas, so aggregation is the top gas lever.

Result (verdict: KEEP — hypothesis refuted, baseline established)

  • Built sui 1.72.1 from the revision contracts/Move.toml pins (45m52s), ran a localnet, drove 8 entry points with real Groth16 proofs.
  • shielded_transfer: 2,872,944 MIST net. Computation is floored at 1,000,000 MIST for every call; storage is 65 % of net.
  • Verifier isolated with an N-calls-per-PTB probe: ≈ 270,000 MIST per transfer verify (9.4 % of the tx), ≈ 248,000 withdraw, ≈ 84,600 for prepare_verifying_key. Matches the protocol-config constants within ~2 %.
  • Consequence: aggregated verification saves ~0 on-chain for a single transfer (queue research: contra confidential transfers PoC + nightly research loop #3 demoted); storage footprint is the new top item.
  • Closes the Move-suite gap: sui move test 124/124.

Caveats: localnet at RGP 1000, not mainnet; compliant_transfer not driven; pot15 regenerated locally (Hermez ptau no longer downloadable) so proving-time rows were not re-run.

Tests

Move 124/124, circuits 43/30/35, converter, compliance utils, fuzz (6 properties), frontend vitest 19 — all green.

No circuit or contract code changed (no soundness/leakage delta).

Writeup: docs/research/2026-10-11-onchain-gas-baseline.md. Bench: scripts/bench/gas-local.ts.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TG7BPaetzKjNgyRCUAsGNh


Generated by Claude Code

Builds sui from the pinned rev, measures gas for 8 entry points with real
Groth16 proofs on localnet, isolates verifier cost via an N-call PTB probe.
Verify ~270k MIST = 9.4% of shielded_transfer; storage is 65%. Updates
BASELINE, LEDGER, EXPERIMENTS (aggregation demoted, storage item added).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TG7BPaetzKjNgyRCUAsGNh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants