A decentralized zero-knowledge DApp built with Midnight’s Compact language that allows users to prove they hold valid certifications or identity attributes—without revealing any sensitive information.
zkBadge enables anyone to register and prove ownership of a digital certificate (like a degree, license, or ID clearance) privately using ZK proofs. Admins verify the legitimacy of certificate hashes off-chain. Verified users can then access gated features without exposing personal data.
- ✅ Private ZK Certificate Registration
- ✅ Off-chain Verification with On-chain Status Tracking
- ✅ Access Gated Features Based on Verification
- ✅ Connects with Lace Wallet
- ✅ Built using Midnight’s Compact smart contract language
- ✅ Frontend built with React + TailwindCSS
- Prove you're certified in a field (e.g., KYC, license, diploma) without sharing personal info.
- Access gated DAOs, jobs, or services privately.
- Integrate with Discord, Web3 platforms, or real-world events requiring private access control.
register(): Register a certificate hash with ZK proofverify_certificates(): Admin approves known/legit certificate hashescheck_verification(): Anyone can check if a user is verifiedaccess_private_feature(): Grants verified users access to protected resources
- Connect Lace Wallet
- Disclose private certificate as a ZK proof
- Submit proof to smart contract
- View verification status
- Access private content
See
frontend/
- Lace Wallet
- Midnight CLI or devnet tools
- Node.js ≥ v18
- Yarn
# run proof server
docker run -p 6300:6300 midnightnetwork/proof-server -- 'midnight-proof-server --network testnet'
node -v
yarn install
cd packages/contracts
npx turbo run build
cd ../api
npx turbo run build
# To run the cli DApp instance
cd .. && cd packages/cli
npx turbo run build
# You can either run the cli DApp testnet mode or in undeployed mode
yarn testnet-remote # For testnet-mode
yarn standalone # For undeployed mode
cd ../frontend
npx turbo run build
yarn buildnpm install -g vitest
cd packages/contracts
npx turbo run build
yarn testNote: Make sure
packages/frontendis correct; adjust if your frontend folder uses a different name.
-
User holds a certificate issued by a trusted authority
-
They generate a ZK proof using the witness function
-
Contract checks that:
- Certificate is valid
- Not expired
- Owned by the prover
-
Admin verifies hash off-chain and calls
verify_certificates() -
User gains access to
access_private_feature()
| Layer | Tech |
|---|---|
| Smart Contract | Midnight Compact Language |
| ZK Proofs | Disclose / Witness functions |
| Wallet | Lace Wallet |
| Frontend | React + TailwindCSS + Vite |
| Chain | Midnight Testnet |
- Team: DavyKing
- Status: ✅ Complete
- License: MIT
- Fully automate issuer verification via oracle or cross-contract call
- Integrate Discord bot for real-time badge gating
- Add NFT-based badges for off-chain identity portability
- Node version: Use Node ≥ v18 for compatibility with Vite and Midnight tools
- Vite + WASM top-level await: If your build fails due to WASM, add
vite-plugin-wasmand ensure ESM imports - Turbo caching: Run
npx turbo cleanif cached builds cause stale outputs