NOTE: This is a demo only. Do not use it in a production environment.
This is a demo service that demonstrates the issuance of verified credentials directly to Polygon ID Wallet using the merklized on-chain issuer. The service utilizes on-chain anchoring through Merkle trees to ensure credential verifiability.
-
Credential Issuance:
- The service prepares the credential data
- Generates a QR code containing the credential offer
- Users receive the credential directly in their Polygon ID Wallet
- The credential's Merkle root is anchored on-chain
-
Proof Generation:
- Users can generate Merkle Tree Proofs (MTP) from their wallet
- These proofs can be used to generate Zero-Knowledge proofs
- The ZK proofs enable on-chain verification using an on-chain verifier
- Connect Wallet: Users connect their MetaMask wallet
- Authentication: Users authenticate with their Google account
- Credential Review: Users review their credential information
- QR Code: Users scan a QR code with their Polygon ID wallet
- Acceptance: Users receive and store the credential directly in their Polygon ID wallet
- Docker
- Docker-compose
- Ngrok
- Go (for utility tools)
- Node.js and npm (for contract deployment)
-
Deploy the Contract
# Clone the contracts repository git clone https://github.com/0xPolygonID/contracts.git cd contracts # Install dependencies and deploy npm install npm run deploy:identity:mumbai
-
Configure Environment
# Copy environment template cp .env.example .env # Start ngrok tunnel ngrok http 8080
-
Calculate Issuer DID
go run utils/convertor.go --contract_address=<ADDRESS_OF_ONCHAIN_ISSUER_CONTRACT>
Options:
--contract_address
: Contract address to convert to DID--network
: Network name (default: polygon)--chain
: Chain name (default: amoy)
-
Configure Environment Variables
# Edit .env file with your values SUPPORTED_RPC="80002=<RPC_POLYGON_AMOY>" ISSUERS_PRIVATE_KEY="<ISSUER_DID>=<PRIVATE_KEY_OF_THE_CONTRACT_DEPLOYER>" EXTERNAL_HOST="<NGROK_URL>"
-
Build and Run
docker-compose build docker-compose up -d
-
Access the application at: http://localhost:3000
To verify credentials using the Query Builder:
-
Visit Query Builder
-
Configure the following:
- Schema:
ipfs://QmbbTKPTJy5zpS2aWBRps1duU8V3zC84jthpWDXE9mLHBX
- Attribute: Select
balance
- Proof Type:
Merkle Tree Proof (MTP)
- Circuit ID:
Credential Atomic Query MTP v2
- Query Type: Choose appropriate type
- Operator: Select if using Conditional query
- Value: Provide if using Conditional query
- Schema:
-
Generate and scan the QR code with your Polygon ID wallet
├── client/ # Frontend React application
├── server/ # Backend service
├── contracts/ # Smart contract interfaces
└── utils/ # Utility scripts and tools
- On-chain credential anchoring
- Google OAuth integration
- MetaMask wallet connection
- QR code credential issuance
- MTP proof generation
verified-credential-issuance-demo is part of the 0xPolygonID project copyright 2024 ZKID Labs AG
This project is licensed under either of:
at your option.