zkAttend is a decentralized Proof-of-Location system built on Mina Protocol's Protokit. It leverages zero-knowledge proofs to privately verify a user's location without revealing sensitive data. This system is suitable for event attendance, location-based rewards, and logistics verification.
- zkAttend does not prevent location spoofing and is dependent on browser geolocation to get the user's location. Android and iOS can detect and prevent spoofing more effectively and can be leveraged in future iterations for more reliable data.
- The Haversine formula used to determine whether a user is within a specific location is calculated by the oracle. This can later be done with
o1js
, but it is complex and not currently implemented.
- Mina Protocol's Protokit
- Zero-knowledge proofs (zk-SNARKs)
- Geofence Oracle for location validation
- Docker for containerization
- Geofence Creation: Users define a geofence by providing latitude, longitude, radius, and event details. Latitude and longitude are converted to whole numbers (multiplied by 10^4) with sign encoding for positive/negative.
- Oracle: The oracle calculates the distance using the Haversine formula and signs an attendance proof.
- RSVP: Generates unique signatures to prevent duplicate RSVPs for the same event using user and event creator public keys.
Make sure you have the following installed:
- Node.js
v18
(recommended: use NVM) - pnpm
v9.8
- nvm for Node version management
- Docker
>= 24.0
- Docker-compose
>= 2.22.0
Start by cloning the repository and navigating into the project folder:
git clone https://github.com/XxSNiPxX/zkAttend.git
cd zkAttend
Its important to start the oracle first:
cd geofence_oracle
npm install
npm run dev
Open another tab, navigate to the zkAttend directory, and run the chain:
nvm use
pnpm install
pnpm env:inmemory dev
Start by cloning the repository and navigating into the project folder:
git clone https://github.com/XxSNiPxX/zkAttend.git
cd zkAttend
nvm use
pnpm install
pnpm run test --filter=chain -- --watchAll