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 Success

Verification Steps:

  1. Proof Verification: Smart contract calls precompiled elliptic curve pairing operations to verify the ZK proof cryptographically

  2. Nullifier Check: Queries nullifier mapping to ensure commitment hasn’t been spent before

  3. Public Input Validation: Confirms public signals from proof match transaction parameters (token address, recipient, etc.)

  4. 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