feat: ZK-SNARK proof system for Benford compliance on-chain attestation#358
Merged
Inkman007 merged 2 commits intoJun 30, 2026
Merged
Conversation
…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>
|
@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! 🚀 |
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
integrations/zk_attestor.py:BenfordZKProvergenerates Fiat-Shamir non-interactive ZK proofs of Benford MAD correctness — Pedersen commitments viapy_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()thenverify()returns True for valid proofverify_with_data()returns Falseattach_benford_proof_to_alertadds proof for score > 70, skips for score ≤ 70Closes #194
🤖 Generated with Claude Code