GeoPrivacy is an innovative web application developed for NoirHack, designed to generate zero-knowledge proofs for location verification, ensuring maximum privacy and security.
- π 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 Language
- Testing: Jest and React Testing Library
This section guides you through setting up and running the GeoPrivacy project locally.
Before you begin, ensure you have the following installed:
- Node.js: Version 18 or newer. (npm is included with Node.js)
- You can download it from nodejs.org
- Noir Language (Nargo CLI):
- Install
noirup
(the Noir version manager) by following the instructions on the official Noir website: Noir Installation Guide. - Then, install a Nargo version compatible with the project. This project uses
@noir-lang/noir_js@^1.0.0-beta.2
. The version1.0.0-beta.3
of Nargo was previously mentioned in this README. Install it (or a compatible version) with:noirup -v 1.0.0-beta.3
- Install
Clone the GeoPrivacy project to your local machine:
git clone https://github.com/JulesWi/GeoPrivacy_Project.git
cd GeoPrivacy_Project
The main application and Noir circuits are located within the frontend
directory. Navigate into it and install the necessary npm packages:
cd frontend
npm install
(If you encounter issues with peer dependencies, you might try npm install --legacy-peer-deps
)
The Noir zero-knowledge circuits need to be compiled before running the application.
# Make sure you are in the GeoPrivacy_Project/frontend/circuits directory
cd circuits
nargo compile
# Return to the frontend directory
cd ..
To start the Next.js development server for the frontend:
# Make sure you are in the GeoPrivacy_Project/frontend directory
npm run dev
The application should now be accessible at http://localhost:3000.
Test your Noir circuits using Nargo:
# Make sure you are in the GeoPrivacy_Project/frontend/circuits directory
cd circuits # If not already there
nargo test
# You can also use `nargo execute` to run with Prover.toml inputs or `nargo info` for circuit details.
cd ..
Run the Jest tests for the React frontend:
# Make sure you are in the GeoPrivacy_Project/frontend directory
npm test
The project root includes helper scripts for managing dependencies:
- For Unix/Linux/macOS:
./update_deps.sh
- For Windows:
.\update_deps.ps1
These scripts attempt to update npm packages, runnpm audit fix
, and update Noir circuit dependencies.
- 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
- All sensitive data managed via environment variables
- Private keys and API keys never committed to repository
- Regular dependency updates
- Implemented access control mechanisms
Deployed on Vercel. 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.
GeoPrivacy is a cutting-edge application, developed for NoirHack, that allows users to generate zero-knowledge proofs of their location without revealing exact coordinates. The core privacy is achieved using Noir, a domain-specific language for creating and verifying zero-knowledge proofs. Specifically, Noir circuits in this project are designed to:
- Accept a user's private geographical coordinates and a public defined area (e.g., within a specific radius of Paris) as inputs.
- Perform geometric calculations (like Haversine distance or point-in-polygon) securely within the circuit.
- Produce a cryptographic proof affirming that the user's location meets the specified criteria (e.g., being inside the designated area) without disclosing the precise coordinates themselves. This enables verifiable location-based attestations while rigorously preserving user privacy.
- 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
- 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