Skip to main content
The lucid_zkml_verifier program verifies Groth16 zero-knowledge proofs for ML model inference on Solana. It links verified proofs to inference receipts and uses a bloom filter to prevent duplicate verification. Program ID (devnet): 69cJRFGWijD1FdapQ2vz7VP6x2jcXRQyBws9VzzPpqAN

Instructions

Account Structures

ModelCircuit

PDA seeds: ["model", model_hash] Stores the Groth16 verifying key components for a registered model.

VerifiedProof

Optional on-chain record for high-value proofs.

ProofBloomFilter

PDA seeds: ["bloom", authority] 16KB bloom filter with 7 hash functions for approximately 0.1% false positive rate at 10,000 proofs.

Verification Flow

  1. Caller submits proof components (proof_a, proof_b, proof_c) and public inputs
  2. Program computes a deterministic proof hash from all components
  3. Bloom filter is checked for duplicates
  4. Proof components are validated (non-zero check)
  5. Bloom filter is updated with the new proof hash
  6. ProofVerified event is emitted with the linked receipt hash

Batch Verification

Verify up to 10 proofs in a single transaction for gas efficiency:

Bloom Filter Details

  • Size: 2048 bytes (16,384 bits)
  • Hash functions: 7 (double hashing: h(i) = (h1 + i * h2) mod bit_count)
  • False positive rate: ~0.1% at 10,000 proofs
  • Purpose: Prevents the same proof from being verified twice on-chain

Events

Current Status

The Groth16 pairing check is currently a stub — proof components are validated for non-zero values and authority is checked, but the full e(-A, B) * e(alpha, beta) * e(vk_x, gamma) * e(C, delta) == 1 pairing equation is not yet computed on-chain. Full verification requires Solana’s alt_bn128 syscalls (available since v1.16). Only the bloom authority can submit proofs, preventing unauthorized verification while the pairing check is being finalized.