NOTE: This is a demo only. Do not use it in a production environment.
This is a demo frontend page that communicates with the non-merklized on-chain issuer to issuer non-merklized credential. The on-chain non-merklized issuer can use information from a blockchain (such as balance, token ownership, etc.) to issue a credential directly on the blockchain. This approach is decentralized and trustless - no need to trust an issuer to act honestly, because it's enforced by the smart contract and auditable on chain. But it comes with a few limitations: max 4 data fields in the credential and data is public. More about non-merklized credentials. You can also consider the merklized on-chain issuer solution if you need a centralised issuer without a limit on the number of fields.
Requirements:
- Docker
- Docker-compose
- Ngrok
Steps to run:
-
Deploy the non-merklized on-chain issuer. Script to deploy or use the npm command.
-
Copy
.env.example
to.env
cp .env.example .env
-
Run
ngrok
on 8080 port.ngrok http 8080
-
Use the utility to calculate the issuerDID from the smart contract address:
go run utils/convertor.go --contract_address=<ADDRESS_OF_ONCHAIN_ISSUER_CONTRACT>
Available flags:
contract_address
- contract address that will convert to didnetwork
- network of the contract. Default: polygonchain
- chain of the contract. Default: amoy
-
Fill the
.env
config file with the proper variables:SUPPORTED_RPC="80002=<RPC_POLYGON_AMOY>" ISSUERS="<ISSUER_DID>" EXTERNAL_HOST="<NGROK_URL>"
ISSUERS
supports an array of issuers in the format"issuerDID1,issuerDID2"
-
Use the docker-compose file:
docker-compose build docker-compose up -d
-
Open: http://localhost:3000
- Visit https://verifier-demo.polygonid.me/.
- Choose
custom
from the drop-down menu. - Select the verifier based on your network:
- For polygon mumbai:
Mumbai
- For polygon mainnet:
Mainnet
- For polygon amoy:
Amoy
- For polygon mumbai:
- Fill out the form:
- Circuit Id: Credential Atomic Query MTP
- Url: https://gist.githubusercontent.com/ilya-korotya/660496c859f8d31a7d2a92ca5e970967/raw/6b5fc14fe630c17bfa52e05e08fdc8394c5ea0ce/non-merklized-non-zero-balance.jsonld
- Type: Balance
- Field: balance
- Operator: All operators work for the claim
- Value: Set the value that you want to compare
- Press submit.
- Use the mobile application to verify.
onchain-nonmerklized-issuer-demo is part of the 0xPolygonID project copyright 2024 ZKID Labs AG
This project is licensed under either of
at your option.