Skip to content

feat: ZK-SNARK proof system for Benford compliance on-chain attestation#358

Merged
Inkman007 merged 2 commits into
Ledger-Lenz:mainfrom
joel-metal:feature/issue-194-zk-benford
Jun 30, 2026
Merged

feat: ZK-SNARK proof system for Benford compliance on-chain attestation#358
Inkman007 merged 2 commits into
Ledger-Lenz:mainfrom
joel-metal:feature/issue-194-zk-benford

Conversation

@joel-metal

Copy link
Copy Markdown
Contributor

Summary

  • integrations/zk_attestor.py: BenfordZKProver generates Fiat-Shamir non-interactive ZK proofs of Benford MAD correctness — Pedersen commitments via py_ecc (BN128 curve), binary Merkle tree commitment for up to 1000 trade amounts, proof size < 256 bytes (Soroban limit). attach_benford_proof_to_alert() injects proof into alert payloads for high-risk scores (> 70). Trade amounts never logged — only proof hashes emitted.

  • docs/zk_attestation.md: Circuit statement, CKKS/Fiat-Shamir parameter rationale, trusted setup notes (none required), Soroban Rust verification stub, Merkle commitment design, security properties, V3 Groth16/zkVM upgrade path.

Test plan

  • BenfordZKProver.prove() then verify() returns True for valid proof
  • Tamper one trade amount → verify_with_data() returns False
  • attach_benford_proof_to_alert adds proof for score > 70, skips for score ≤ 70
  • Proof bytes < 256 bytes

Closes #194

🤖 Generated with Claude Code

…ion on-chain

Closes Ledger-Lenz#194

- integrations/zk_attestor.py: BenfordZKProver class generates and verifies
  Fiat-Shamir non-interactive ZK proofs of Benford MAD compliance; Pedersen
  commitments via py_ecc (BN128 curve); Merkle commitment for trade amounts
  (up to 1000 per proof); proof size < 256 bytes for Soroban compatibility;
  attach_benford_proof_to_alert() injects proof into alert payload for
  high-risk scores (> 70); trade amounts never logged (only proof hash)

- docs/zk_attestation.md: circuit statement, CKKS parameter rationale,
  Fiat-Shamir vs Groth16 trade-off, trusted setup notes, Soroban Rust
  verification stub, Merkle commitment design, proof field documentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@joel-metal Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Inkman007 Inkman007 merged commit 5e4236f into Ledger-Lenz:main Jun 30, 2026
0 of 3 checks passed
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.

Implement Zero-Knowledge Proof System for Benford Compliance Attestation On-Chain

2 participants