ZK-Digilocker

ZK DigiLocker: Private doc verification with ZKP, Ethereum, ENS, and React UI.

ZK-Digilocker

Created At

ETHGlobal New Delhi

Project Description

ZK DigiLocker is a decentralized application (dApp) designed to provide privacy-preserving document verification using zero-knowledge proofs. It allows users to prove specific attributes of their documents (e.g., being over 18, nationality, or document validity) without disclosing sensitive information. Built for the ETHGlobal New Delhi Hackathon, the project integrates cutting-edge blockchain technologies to deliver a secure, scalable, and user-friendly system. Key components include:

Zero-Knowledge Proofs: Using Circom and Groth16, users generate proofs for document claims locally, ensuring personal data never leaves their device. Only boolean results are shared on-chain.

Dynamic PDF Processing: The system extracts data from various passport PDF formats using pdf-parse, enabling flexible verification.

ENS-Style Naming: Users create memorable pseudonyms for their verified profiles, enhancing usability and privacy.

Smart Contracts: Deployed on Ethereum Sepolia, contracts like PassportProofVerifier validate ZK proofs, while ProfileManager handles ENS mappings and profile data.

The Graph Integration: A subgraph indexes blockchain events (e.g., ProfileVerified), enabling real-time, decentralized querying via GraphQL.

Frontend: Built with React, Vite, RainbowKit, and Wagmi for wallet connectivity, styled with Tailwind CSS for a responsive, mobile-friendly UI.

Privacy & Security: ZK proofs ensure cryptographic security, and ENS-style names eliminate the need for real-world identifiers.

The system is production-ready, tested on Sepolia, and features a streamlined user flow: connect wallet, upload PDF, generate proof, choose an ENS name, and submit for verification. Verifiers can query profiles by ENS name to view verification status without accessing personal data. The Graph’s decentralized indexing ensures transparent, real-time analytics.

How it's Made

ZK DigiLocker was developed as a solo project for the ETHGlobal New Delhi Hackathon, combining multiple technologies for a full-stack decentralized solution:

ZK Circuits (Circom):

Circuits for age, nationality, and expiry verification were written in Circom.

Groth16 proof system ensures efficient and secure proof generation.

Trusted setup completed using Powers of Tau for cryptographic integrity.

Inputs: Document attributes (e.g., age, nationality); Outputs: Boolean verification results.

Scripts (build-circuit.ps1, install-circom.ps1) automate circuit compilation and setup.

Smart Contracts (Solidity):

PassportProofVerifier.sol: Validates Groth16 proofs submitted by users.

ProfileManager.sol: Manages ENS-style name mappings and profile data.

Deployed on Ethereum Sepolia using Hardhat.

Events like ProfileVerified emitted for subgraph indexing.

Tested with Hardhat test suites for reliability.

Frontend (React + Vite):

Built with React for a dynamic, responsive UI.

RainbowKit and Wagmi handle Ethereum wallet integration.

pdf-parse library dynamically extracts data from uploaded passport PDFs.

SnarkJS integrates ZK proof generation in the browser.

Tailwind CSS ensures a polished, mobile-friendly design.

The Graph Subgraph:

Indexes blockchain events (e.g., ProfileVerified) for real-time querying.

Schema includes entities like User, Profile, VerificationEvent, and DailyStats.

GraphQL API powers frontend queries for profiles and verification history.

Deployed using The Graph Studio.

Development Workflow:

Node.js 18+ and Yarn for dependency management.

Hardhat for smart contract deployment and testing.

Custom PowerShell scripts for circuit building and Circom setup.

Sepolia testnet for deployment and testing.

GitHub repository (zk-digilocker) for version control and collaboration.

The project was designed to be production-ready, with a focus on privacy, scalability, and user experience. It demonstrates technical innovation through dynamic PDF processing, flexible ZK circuits, and seamless blockchain integration.

background image mobile

Join the mailing list

Get the latest news and updates