Skip to content

fix: prevent ZK proof replay in ZkAuditVerifier#8

Open
murd3r17 wants to merge 1 commit into
ZhangJinHaHaHa:mainfrom
murd3r17:fix/issue-4-zk-proof-replay
Open

fix: prevent ZK proof replay in ZkAuditVerifier#8
murd3r17 wants to merge 1 commit into
ZhangJinHaHaHa:mainfrom
murd3r17:fix/issue-4-zk-proof-replay

Conversation

@murd3r17
Copy link
Copy Markdown

@murd3r17 murd3r17 commented May 27, 2026

Summary

  • Add global _usedProofHashes mapping to prevent Groth16 proof replay in verifyAuditScore and verifyFingerprint
  • Split Groth16 internal call helpers for 8- and 3-input verifiers; fix NatSpec
  • Add MockGroth16Verifier and regression tests

Fixes #4

Test plan

  • npm run test:zk (4 tests passing)

AI assistance

Used Cursor AI to analyze issue #4, implement the fix, and write regression tests.

Add global _usedProofHashes dedup to block re-submission of the same Groth16 proof across verifyAuditScore and verifyFingerprint. Split the Groth16 internal call helpers for 8- and 3-input verifiers, fix NatSpec, and add MockGroth16Verifier plus regression tests (Fixes ZhangJinHaHaHa#4).

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

ZK proof replay attack in ZkAuditVerifier.verifyAuditScoreProof

1 participant