Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

integrations-Polygon/ProofOfPersonhood_PolygonID

Repository files navigation

Implement an ERC20 zk airdrop in 20 minutes with Polygon ID

Tutorial: https://0xpolygonid.github.io/tutorials/verifier/on-chain-verification/overview/

This tutorial uses Hardhat as a development environment and Polygon Mumbai testnet as the network.

Polygon ID Wallet setup

  1. Download the Polygon ID mobile app on the Google Play or Apple app store

  2. Open the app and set a pin for security

  3. Follow the Issue a Polygon ID claim YT video to issue yourself a Proof Of Personhood attesting if you are a VerifiedPerson or not.

Instructions to compile and deploy the smart contract

  1. Create a .env file in the root of this repo. Copy in .env.sample to add keys touch .env

  2. Install dependencies npm i

  3. Compile smart contracts npx hardhat compile

  4. Deploy smart contracts npx hardhat run --network mumbai scripts/deploy.js

  1. Update the ERC20VerifierAddress variable in scripts/set-request.js with your deployed contract address

  2. Run set-request to send the zk request to the smart contract npx hardhat run --network mumbai scripts/set-request.js

Claim airdrop from a frontend

  1. Design a proof request (see my example in qrValueProofRequestExample.json) and more info in the docs: Query Based Requests

    • Update the contract_address field to your deployed contract address
  2. Create a frontend with a QR code to the proof request. Codesandbox example A user should be able to scan the QR code from the Polygon ID app and trustlessly prove that they a person to claim the ERC20 airdrop without revealing their actual personhood.

Resources to understand what claim schema to use according to the project requirmenet

  1. ZK Query Language (includes query and schemas for different claims)

  2. On-chain ZK Verification

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published