Proof Validation Flow
The on-chain proof validation process ensures only valid, authorized transactions are processed:
Transaction Submission
↓
┌────────────────────┐
│ Extract Proof & │
│ Public Signals │
└────────┬───────────┘
↓
┌────────────────────┐
│ Verify Proof │
│ (Elliptic Curve │──→ Invalid? → Revert
│ Pairings) │
└────────┬───────────┘
↓ Valid
┌────────────────────┐
│ Check Nullifiers │
│ Not Double-Spent │──→ Already Used? → Revert
└────────┬───────────┘
↓ Unique
┌────────────────────┐
│ Verify Public │
│ Inputs Match │──→ Mismatch? → Revert
│ Transaction │
└────────┬───────────┘
↓ Match
┌────────────────────┐
│ Execute State │
│ Changes │
│ (Update Pool, │
│ Store Nullifiers)│
└────────┬───────────┘
↓
Transaction SuccessVerification Steps:
Proof Verification: Smart contract calls precompiled elliptic curve pairing operations to verify the ZK proof cryptographically
Nullifier Check: Queries nullifier mapping to ensure commitment hasn’t been spent before
Public Input Validation: Confirms public signals from proof match transaction parameters (token address, recipient, etc.)
State Updates: If all checks pass, updates contract state (stores nullifiers, creates new commitments, transfers tokens)
Security Properties:
Soundness: Invalid proofs are rejected with overwhelming probability
Completeness: Valid proofs always pass verification
Zero-Knowledge: Verifier learns nothing beyond validity
Non-Malleability: Proofs cannot be modified and remain valid
Last updated