Privacy-Preserving Identity Verification using Zero-Knowledge Proofs & ePassport Data
Verify your identity without revealing personal information. Powered by ZK-SNARKs and NFC passport reading.
Overview ยท How It Works ยท Architecture ยท Components ยท Quick Start ยท Use Cases
ZKAuth is a decentralized identity verification system that enables users to prove attributes about themselves (like being over 18) without revealing their actual personal data. By combining:
- ๐ฑ NFC-enabled passport reading on Android devices
- ๐ Zero-Knowledge Proof generation using ZoKrates
- โ๏ธ On-chain proof verification via Ethereum smart contracts
- ๐ Web3-native DApp integration with modern frontend
Users can cryptographically prove claims about their identity while maintaining complete privacy over their sensitive passport data.
| Feature | Description |
|---|---|
| ๐ Privacy-First | Your passport data never leaves your device. Only cryptographic proofs are shared. |
| โ ICAO 9303 Compliant | Full support for international ePassport standards |
| ๐ On-Chain Verification | Proofs verified by Ethereum smart contracts for trustless verification |
| ๐ฑ Mobile-Native | Android app with OCR, NFC, and QR code support |
| ๐๏ธ Decentralized | No central authority required for verification |
| ๐ Reusable Proofs | Generate proofs once, use across multiple DApps |
ZKAuth operates through a seamless flow between the mobile app, web DApps, and blockchain smart contracts.
The complete verification flow involves 7 key steps:
- MRZ Capture & NFC Scan - User reads their passport using the ZKAuth Android app
- Secure Storage - Passport data is encrypted and stored locally on the device
- QR Code Generation - DApp creates a verification challenge encoded as a QR code
- QR Scanning - User scans the QR code with the ZKAuth app
- ZK Proof Generation - App generates a zero-knowledge proof based on the challenge
- Proof Submission - Proof is sent to the verification server
- On-Chain Validation - Admin-side DApp fetches and validates the proof on-chain
This diagram illustrates the interaction between the DApp and ZKAuth mobile app:
DApp Side:
- User interacts with DApp and selects "Verify Age"
- DApp creates a verification challenge with specific criteria
- Challenge is encoded as JSON and converted to QR code
- QR code is displayed on screen for the user
ZKAuth App Side:
- User scans the QR code with the mobile app
- App parses and validates the JSON challenge
- Challenge data is stored and prepared for proof generation
- App signals readiness for ZK proof generation
This comprehensive flow shows the complete passport onboarding process:
User Onboarding:
- User opens ZKAuth app and is prompted to add a passport
- Choice between OCR (camera) scanning or manual MRZ input
Key Generation & NFC:
- BAC key is derived from MRZ data
- Passport chip is read via NFC communication
Security Verification:
- โ BAC (Basic Access Control)
- โ PACE (Password Authenticated Connection Establishment)
- โ AA (Active Authentication)
- โ CA (Chip Authentication)
- โ CSCA (Certificate Authority Validation)
Data Handling:
- Data fields extracted from passport chip
- Encrypted and stored securely on device
- Identity data ready for ZK proof generation
ZKAuth/
โโโ ๐ฑ PassportAndroidApp/ # Android mobile application
โ โโโ app/src/main/
โ โ โโโ java/example/jllarraz/ # Kotlin source code
โ โ โ โโโ passport/ # Passport reading logic
โ โ โ โโโ camera/ # OCR & QR scanning
โ โ โ โโโ nfc/ # NFC communication
โ โ โ โโโ zk/ # ZK proof generation
โ โ โโโ assets/zokrates/ # ZoKrates proving keys
โ โ โโโ res/ # Android resources
โ โโโ libs/ # External libraries (JMRTD)
โ
โโโ ๐ ZK-Minimal-DApp/ # Web application & smart contracts
โ โโโ Foundry-Backend/ # Solidity smart contracts
โ โ โโโ src/
โ โ โโโ AuthBluePrint.sol # Base authentication contract
โ โ โโโ RandomDApp.sol # Example DApp implementation
โ โโโ frontend/ # Next.js React application
โ โ โโโ app/ # App router pages
โ โ โโโ components/ # React UI components
โ โ โโโ contracts/ # Contract ABIs
โ โโโ zk-passport-auth/ # ZK verification system
โ
โโโ ๐ media/ # Documentation assets
A comprehensive Android application for reading and verifying ePassport documents.
| Category | Capabilities |
|---|---|
| ๐ Passport Reading | OCR-based MRZ scanning, NFC chip reading, Manual data entry |
| ๐ Security Protocols | BAC, PACE, EAC, Active Authentication, Chip Authentication |
| ๐ Verification | CSCA certificate chain validation, Cryptographic hash verification |
| ๐ฑ Mobile Features | QR code scanning, ZK proof generation, Encrypted local storage |
- Language: Kotlin
- NFC/Passport: JMRTD 0.7.35, Bouncy Castle
- OCR: Google ML Kit Text Recognition
- Camera: CameraX, ML Kit Barcode Scanning
- ZK Proofs: ZoKrates.js via WebView
- Security: Android Security Crypto, EncryptedSharedPreferences
- Android 6.0+ (API Level 23)
- NFC-enabled device
- Camera for OCR/QR scanning
๐ Full Android App Documentation โ
A decentralized web application for requesting and verifying ZK proofs.
| Feature | Description |
|---|---|
| ๐ Wallet Integration | RainbowKit for seamless Web3 wallet connections |
| ๐ฑ QR Generation | Dynamic QR codes for verification requests |
| โ๏ธ Smart Contracts | Ethereum-based proof verification |
| ๐จ Modern UI | Next.js 15 + React 19 + Tailwind CSS |
| ๐จโ๐ผ Admin Panel | Dashboard for managing verification requests |
AuthBluePrint.sol - Base abstract contract providing:
// Core authentication states
enum AuthState { NONE, REQUESTED, PENDING, VERIFIED, FAILED }
// Key functions
function genQRCodeInfo() public; // Generate verification challenge
function validateProof(...) public; // Verify ZK proof on-chainRandomDApp.sol - Example implementation showing custom verification logic.
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS, shadcn/ui
- Web3: ethers.js, Wagmi, RainbowKit
- Contracts: Solidity, Foundry, OpenZeppelin
๐ Full DApp Documentation โ
# Required tools
- Node.js 18+ & pnpm
- Android Studio (for mobile app)
- Foundry (for smart contracts)
- Gitgit clone --recurse-submodules https://github.com/roudra323/ZKAuth.git
cd ZKAuthcd ZK-Minimal-DApp/Foundry-Backend
forge install
forge build
forge testcd ../frontend
pnpm install
# Create environment file
cat > .env.local << EOF
NEXT_PUBLIC_CONTRACT_ADDRESS=your_contract_address
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=your_wallet_connect_id
EOF
pnpm dev- Open
PassportAndroidApp/in Android Studio - Sync Gradle dependencies
- Configure CSCA certificates (optional)
- Build and run on NFC-enabled device
Prove you're over 18/21 without revealing your birthdate to access age-restricted services.
Verify nationality or identity for financial services while preserving privacy.
Prove citizenship eligibility without linking votes to your identity.
Verify credentials for exclusive events without sharing personal data.
Comply with age regulations while maintaining user privacy.
| Layer | Protection |
|---|---|
| ๐ฑ Device | Passport data encrypted with Android Keystore |
| ๐ Transmission | Only ZK proofs leave the device, never raw data |
| โ๏ธ Blockchain | Proofs verified without revealing inputs |
| ๐ Verification | Zero-knowledge: verifier learns only true/false |
- ICAO 9303 - International standard compliance
- BAC - Basic Access Control for chip access
- PACE - Password Authenticated Connection Establishment
- EAC - Extended Access Control for biometrics
- Active Authentication - Proves chip authenticity
- CSCA Validation - Country certificate chain verification
| Module | Path | Technology |
|---|---|---|
| Android App | PassportAndroidApp/ |
Kotlin, Android SDK |
| Smart Contracts | ZK-Minimal-DApp/Foundry-Backend/ |
Solidity, Foundry |
| Web Frontend | ZK-Minimal-DApp/frontend/ |
Next.js, React, TypeScript |
| ZK Circuits | ZK-Minimal-DApp/zk-passport-auth/ |
ZoKrates |
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Use functional programming paradigms
- Follow TypeScript best practices
- Write comprehensive tests
- Document new features
- ICAO 9303 - Machine Readable Travel Documents
- EIP-712 - Typed structured data hashing
- ZoKrates - ZK-SNARK toolbox
- JMRTD - Java Machine Readable Travel Documents
- Foundry - Ethereum development toolkit
- RainbowKit - Web3 wallet integration
This project is licensed under the MIT License - see the LICENSE file for details.
The Passport Android App component is licensed under Apache License 2.0.
- ZoKrates Team - ZK-SNARK framework
- JMRTD Project - Passport reading library
- OpenZeppelin - Smart contract security
- shadcn/ui - UI component library
- The Ethereum and ZK communities for advancing privacy-preserving technologies
Built with โค๏ธ for privacy-preserving identity verification


