GeoPrivacy is an innovative web application that generates zero-knowledge proofs for location verification, ensuring maximum privacy and security. The application has been updated with improved TypeScript configuration and testing capabilities.
- π Zero-Knowledge Location Proofs
- πΊοΈ Interactive Map Integration
- π‘οΈ Privacy-First Design
- π Precise Location Verification
- Frontend: React 18 with TypeScript
- Styling: Tailwind CSS with primary (light green) and secondary (light blue) colors
- Mapping: React Leaflet
- Zero-Knowledge Proofs: Noir Circuit and Aztec Network
- Testing: Jest and React Testing Library
# Install dependencies
npm install --legacy-peer-deps
# Start frontend
npm run start:frontend
# Start backend
npm run start:backend
# Run tests
npm test
GeoPrivacy introduces an innovative payment mechanism for Zero-Knowledge Proofs:
- Network: OP Sepolia
- Proof Generation Cost: 0.5 USDC
- Smart Contract:
GeoPrivacyPayment.sol
- Purchase a proof token via our smart contract
- Token is valid for a single ZK proof generation
- Secure and traceable blockchain-based payment
- Web3 Wallet compatible with OP Sepolia
- USDC on OP Sepolia
- Web3 Connection
- Node.js (v18+)
- npm or yarn
- React 18.x (for compatibility with react-leaflet)
- TypeScript 5.x
- Comprehensive unit testing
- Static code analysis
- Gas optimization
- Regular security audits
- Automated tests on every push and pull request
- Code coverage reporting
- Security vulnerability scanning
- Vercel deployment with GitHub Actions
- Configured with VERCEL_TOKEN, VERCEL_ORG_ID, and VERCEL_PROJECT_ID secrets
# Run all contract tests
npm run test:contracts
# Generate test coverage report
npm run test:contracts:coverage
# Analyze gas usage
npm run test:contracts:gas
- All sensitive data managed via environment variables
- Private keys and API keys never committed to repository
- Regular dependency updates
- Implemented access control mechanisms
- Set up environment variables:
cp .env.example .env
# Edit .env and add:
# OP_SEPOLIA_RPC_URL=https://sepolia.optimism.io
# PRIVATE_KEY=your_private_key
# OPTIMISM_ETHERSCAN_API_KEY=your_api_key
- Deploy the contract:
npx hardhat run scripts/deploy.ts --network op-sepolia
- Verify the contract (optional):
npx hardhat verify --network op-sepolia DEPLOYED_CONTRACT_ADDRESS
- Network: OP Sepolia
- Token Cost: 0.5 USDC
- Smart Contract:
GeoPrivacyPayment.sol
- npm
-
Clone the repository
git clone https://github.com/yourusername/geoprivacy.git
-
Install dependencies
cd geoprivacy/frontend npm install
-
Run development server
npm run dev
Deployed on Netlify. Visit GeoPrivacy App
We use zero-knowledge proofs to verify location without revealing sensitive data.
MIT License
Contributions are welcome! Please read our contributing guidelines.
AztecNoir Team - Privacy Innovators project using Zero-Knowledge Proofs with Noir and Aztec Network
GeoPrivacy is a cutting-edge application that allows users to generate zero-knowledge proofs of their location without revealing exact coordinates. Using the Noir ZK framework, users can prove they are within a certain radius of a specified location (Paris) without disclosing their exact position.
- Frontend: Next.js + React (TypeScript)
- Zero-Knowledge Proofs: Noir circuits
- Verification: Custom Haversine distance calculation
/GeoPrivacy
βββ frontend/
β βββ circuits/ # Noir ZK circuits
β β βββ src/main.nr # Main circuit implementation
β β βββ Nargo.toml # Circuit configuration
β βββ components/ # React components
β βββ pages/ # Next.js pages
β βββ tests/ # Frontend tests
βββ docs/ # Project documentation
- Location Verification: Prove presence within a radius of Paris
- Timestamp Verification: Ensure the proof is recent (within 24 hours)
- Privacy-Preserving: Zero-knowledge proofs reveal nothing about exact coordinates
To keep dependencies up to date, use the following scripts:
./update_deps.sh
.\update_deps.ps1
These scripts will:
- Update npm packages
- Run npm audit fix
- Update Noir circuit dependencies
- Install Dependencies:
npm install
- Install Noir/Nargo (if not already installed):
curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash
noisup -v 1.0.0-beta.3
- Compile Circuit:
cd frontend/circuits
nargo compile
- Run Development Server:
cd frontend
npm run dev
- Circuit Testing:
cd frontend/circuits
nargo compile # Compile the circuit
nargo execute # Execute with inputs from Prover.toml
nargo info # View circuit info and metrics
- Frontend Tests:
npm test
- Lint Code:
npm run lint
- Fix Lint Issues:
npm run lint:fix
- Type Check:
npm run typecheck
- Build for Production:
npm run build
- Meaningful Use of Noir
- Public GitHub repository
- Clear README
- Working frontend (Γ complΓ©ter)
- Demo recording (Γ complΓ©ter)
The core of GeoPrivacy is a Noir circuit that implements:
- Custom Trigonometric Functions: Approximations for sine and cosine using Taylor series
- Haversine Distance Calculation: For accurate Earth-surface distance calculations
- Radius Constraint: Verify user is within specified radius of target
- Timestamp Verification: Ensure proof is recent