Skip to content

Latest commit

 

History

History
58 lines (34 loc) · 2.73 KB

README.md

File metadata and controls

58 lines (34 loc) · 2.73 KB

Polygon ID SBT Age Credential

This is a basic Hardhat project showcasing how to create a Soulbound Token using an Age Credential from Polygon ID!

Tutorial: Video coming soon

Presentation Slids: https://pitch.com/public/2ac4415d-fcf6-4ad2-ac7f-1427483b8ece

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 doc to issue yourself a KYC Age Credential attesting your date of birth.

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 ERC721VerifierAddress 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 SBT 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 are old enough to mint an SBT

More Resources

Additional Tutorials from Steph and Manny: https://github.com/oceans404/tutorial-examples/tree/main/on-chain-verification https://github.com/codingwithmanny/polygonid-on-chain-verification

Starter kit from Steph for using API in a frontend: https://github.com/oceans404/generate-frontend-polygon-id-issuer