Age verification is required for many services—alcohol, gambling, adult content. Traditional methods expose birthdates unnecessarily. ZK proofs enable proving "I am over X" without revealing when you were born.
The Problem with Current Age Verification
- Services collect and store birthdates
- ID scans capture far more than age
- Data breaches expose personal information
- Users tracked across services via birthdates
We need to verify age without collecting age.
ZK Age Verification Design
The circuit proves a simple predicate:
The Proof Statement
"I possess a valid credential containing a birthdate, and today's date minus that birthdate is greater than or equal to the required age."
// Simplified age verification circuit
template AgeVerification() {
signal private input birthYear;
signal private input birthMonth;
signal private input birthDay;
signal private input credentialSignature;
signal input currentYear;
signal input currentMonth;
signal input currentDay;
signal input minimumAge;
signal output isOldEnough;
// Verify credential signature (not shown)
// Calculate age from dates
// Compare to minimum
// Output 1 if old enough, 0 otherwise
}
Implementation Architecture
- Credential Setup: User obtains signed credential with birthdate
- Proof Request: Service requests age proof with minimum age
- Proof Generation: User generates ZK proof on device
- Verification: Service verifies proof, learns only pass/fail
Security Considerations
Credential Security
- Credentials must be bound to identity (not transferable)
- Issuer must be trusted (government, bank, etc.)
- Revocation mechanism for compromised credentials
Proof Freshness
- Include timestamp or nonce to prevent replay
- Current date should be verified
Performance
ZK age verification is fast:
- Proof generation: ~100-500ms on mobile
- Proof verification: ~10-50ms
- Proof size: ~200-500 bytes
This is practical for real-time verification.
Integration Example
// Client-side proof generation
const proof = await h33.zk.proveAge({
credential: storedCredential,
minimumAge: 21,
verifierNonce: serviceProvidedNonce
});
// Server-side verification
const valid = await h33.zk.verifyAge(proof, {
minimumAge: 21,
nonce: serviceProvidedNonce
});
if (valid) {
// Grant access - age confirmed, birthdate unknown
}
Regulatory Landscape
Regulations are evolving toward privacy-preserving verification:
- EU Digital Identity Wallet supports selective disclosure
- UK Age Verification regulations compatible with ZK
- Privacy advocates pushing for ZK adoption
ZK age verification protects user privacy while meeting regulatory requirements. It's the future of age-gated services.
Ready to Go Quantum-Secure?
Start protecting your users with post-quantum authentication today. 1,000 free auths, no credit card required.
Get Free API Key →