Setting Up the ZKP Query Request
Approach - A Setting Request using Query Builder:
Visit the PrivadoID Query Builder and paste the JSON-LD Context URL (mentioned above) in the input box.
Select the schema type to
pohcheck
and select thehuman
in the Attribute field.Select the Proof type "Signature-based (SIG)" and Circuit ID Credential Atomic Query v3 On Chain.
Set the query type as Condition and Operator as "Is equal to," and select
true
in the Attribute value.Set the Issuer DID field to "*" to accept credentials from any issuer or, if you want, you can use any specific DID to restrict allowed issuers for the query.
Next, click on the “Create query”.
Add the Universal Verifier Smart contract address for the selected network (e.g., for Polygon Amoy:
0xfcc86A79fCb057A8e55C6B853dff9479C3cf607c
) in the Smart Contract Address input.Click on the Set request to submit the on-chain request.
Click on Confirm in the Metamask to accept and submit the request.
Make sure you have sufficient Gas tokens (e.g. POL in case of Polygon Amoy) in your wallet to submit the transaction.
- Once the transaction is successful, you can click on the Test Query button to easily create the query request, where you will be presented with a QR code that can be scanned by users to generate the proof or copy the URL and use it for verification with the web wallet.
You only need to set the request once (per query), and it can be used by all users to scan, generate, and submit the proof to the smart contract via the Privado ID Mobile Wallet app or Privado ID Web Wallet.
Make sure you note down the Request ID as it is used in the Logic smart contract.
Approach - B Setting Request Programmatically:
We provide a deployment script that you can use as a starting point to set up your own query. To get started, follow these steps:
Clone the XYZ Protocol contracts repository using Git:
git clone https://github.com/iden3/contracts.git
Navigate into the cloned repository:
cd contracts
Add your Private Key and JSON RPC URL strings for the desired blockchain network (e.g., Polygon Amoy). This will allow you to deploy the query on your chosen chain.
Configure the
hardhat.config
file according to your preferences.Next, replace the placeholders in the script with your own query values. For this example, we'll use a PoH query:
npx hardhat run scripts/maintenance/setProofRequest.ts --network amoy
This command will set up the airdrop request and print out the query used for convenience. You can then create a QR code using this query, which can be scanned by users with Privado ID mobile to verify their credentials.