ZKAgeGuard
A QR code component for ZK age verification that uses Self protocol and a Circom circuit to generate proofs via Self app, ensuring age thresholds/ranges with easy integration and on-chain validation.
Created on 15th March 2025
•
ZKAgeGuard
A QR code component for ZK age verification that uses Self protocol and a Circom circuit to generate proofs via Self app, ensuring age thresholds/ranges with easy integration and on-chain validation.
The problem ZKAgeGuard solves
ZKAgeGuard tackles the tricky problem of age verification in apps by making it secure, private, and simple. Developers can use this QR code component to restrict access—like ensuring dating app users are over 18 or content viewers are within a specific age range—without users ever sharing their birthdates. Powered by Self’s zero-knowledge proofs and a custom Circom circuit, it integrates easily, keeps data safe with trusted attestations, and lets users verify age with a quick scan. It’s a lightweight way to meet compliance needs or enforce rules, all while cutting complexity and boosting privacy.
User Interaction and Data Flow
When a user encounters an app with ZKAgeGuard integrated—say, a dating app requiring users to be over 18—they’re presented with a QR code on the app’s interface. They open the Self app on their phone, scan the QR code, and approve sharing a zero-knowledge proof of their age, derived from a trusted source like their passport. The ZKAgeGuard, leveraging Self’s configuration, uses a custom Circom circuit to generate a proof confirming the user meets the app’s age threshold and range (e.g., over 18 and between 21-35) without revealing their exact birthdate. This proof is sent securely to the app’s backend via the endpoint. The backend verifies it using the Self SDK and ZKAgeGuard’s logic with a smart contract for on-chain validation, ensuring cryptographic integrity. If valid, the app grants access —while the user sees a success message. The process is quick, private, and seamless, with no sensitive data stored or exposed beyond the proof itself.
The project architecture and development process
Project Architecture
ZKAgeGuard’s architecture splits into three parts. The front-end is a React based QR code component using @selfxyz/qrcode which can be used by app developers to ensure age thresholds/ranges. The backend, built with Node.js and @selfxyz/core, verifies proofs via a custom Circom circuit. A Solidity contract that handles on-chain validation.
Core Functionality
It generates zero-knowledge proofs through the Self.xyz app using passport data. A custom circuit privately checks minimum age and range. The QR code starts the proof flow, and the backend confirms eligibility.
Key Implementation Details
The circuit, age_validation.circom, uses Groth16 and is compiled with Circom/SnarkJS. The flow goes: QR scan to Self app proof, then backend check, with on-chain verification step.
Product Integrations
- Self Protocol
Key differentiators and uniqueness of the project
ZKAgeGuard enhances Self Protocol’s ZK age verification with a React based QR code component that adds dual age checks—minimum threshold and range (e.g., over 18, 21-35)—in one proof. Its custom Circom circuit, seamless Self protocol integration, and on-chain validation make it more flexible, developer-friendly, and privacy-focused than Self’s baseline service.
Tracks Applied (1)
Integrate Self into your application to verify your users' age, nationality or sanction list status
Self Protocol by Celo
Cheer Project
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.
