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
- Caller submits proof components (
proof_a,proof_b,proof_c) and public inputs - Program computes a deterministic proof hash from all components
- Bloom filter is checked for duplicates
- Proof components are validated (non-zero check)
- Bloom filter is updated with the new proof hash
ProofVerifiedevent 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 fulle(-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..png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=8b4c7e6431e9a6af1ef23b77bb4ff5fd)
.png?fit=max&auto=format&n=VsjUqn6fLqEhBiuI&q=85&s=d5651a45e4bfbabc33f74e146af3f94a)