Skip to content

Privacy doesn’t have to come at the cost of trust—this ZKP authentication DApp proves it. Built with Circom, snarkjs, and Solidity, users verify identity without revealing secrets, unlocking secure IPFS uploads. Modular, full-stack, and production-ready.

Notifications You must be signed in to change notification settings

Shubham0699/Auth_ZKP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auth_ZKP: ZKP-authorized IPFS Uploads

“Privacy doesn’t have to come at the cost of trust—this ZKP authentication DApp proves it.”

A privacy-first full-stack solution where users generate and verify zero-knowledge proofs before unlocking secure IPFS uploads. Built with Circom, snarkjs, Solidity, Hardhat, and React + Vite + Ethers.js.


Step 1: Prerequisites

  • Node.js v18+
  • pnpm (or npm/yarn)
  • Git
  • Linux/macOS/WSL2 (for Circom) or Docker
  • Hardhat v2.x (in contracts folder)
  • snarkjs v0.7.x & circom v2.x (in circuits folder)
  • MetaMask extension

Step 2: Project Setup

Clone and install dependencies:

git clone https://github.com/Shubham0699/Auth_ZKP.git
cd Auth_ZKP

# Root workspace install
pnpm install

# Or per subfolder:
# circuits/ ➔ pnpm install
# contracts/ ➔ pnpm install
# app/ ➔ pnpm install

Step 3: Build Circuits

cd circuits

# Compile circuit
circom password.circom --r1cs --wasm --sym -o build

# Powers of Tau ceremony (demo)
snarkjs powersoftau new bn128 12 build/pot12_0000.ptau
snarkjs powersoftau contribute build/pot12_0000.ptau build/pot12_0001.ptau --name="contrib1"
snarkjs powersoftau prepare phase2 build/pot12_0001.ptau build/pot12_final.ptau

# Groth16 setup & zkey generation
snarkjs groth16 setup build/password.r1cs build/pot12_final.ptau build/password_0000.zkey
snarkjs zkey contribute build/password_0000.zkey build/password_final.zkey --name="key1"

# Export verification key + Solidity verifier
snarkjs zkey export verificationkey build/password_final.zkey build/verification_key.json
snarkjs zkey export solidityverifier build/password_final.zkey build/Verifier.sol

Step 4: Deploy Smart Contracts

cd contracts

# Run local Hardhat node
pnpm hardhat node

# In new terminal, set env and deploy locally
export LOCAL_RPC_URL=http://127.0.0.1:8545
export PRIVATE_KEY=<YOUR_KEY>
pnpm hardhat run scripts/deploy.js --network localhost

Step 5: Start Frontend

cd app
pnpm run dev

Visit http://localhost:5173, connect MetaMask, verify your ZK proof, and upload files to IPFS.


Key Features

  • Zero-knowledge proof generation (Circom + snarkjs)
  • On-chain proof verification (Groth16)
  • Access-gated IPFS uploader (conditional React UI)
  • Full-stack modular architecture (circuits, contracts, frontend)

Future Improvements

  • Integrate PLONK or recursive proofs
  • Persist auth state in localStorage or backend
  • Add CI/CD for automated testing and deployment

License: MIT


About

Privacy doesn’t have to come at the cost of trust—this ZKP authentication DApp proves it. Built with Circom, snarkjs, and Solidity, users verify identity without revealing secrets, unlocking secure IPFS uploads. Modular, full-stack, and production-ready.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published