Sign Protocol Attestations
Human Tech issues a Sign Protocol attestation for every SBT it sends. The following is an example of how to query and validate Human Tech attestations.
Query
See the Sign Protocol docs for how to construct queries.
This query gets the first page of attestations issued by Human Tech.
Query parameters used:
schemaId- Filters for the HolonymV3 Sign Protocol schema.attestor- Filters for Human Tech’s attestor address,0xB1f50c6C34C72346b1229e5C80587D0D659556Fd.
curl 'https://mainnet-rpc.sign.global/api/index/attestations?schemaId=onchain_evm_10_0x1&attester=0xB1f50c6C34C72346b1229e5C80587D0D659556Fd'The response includes attestation details such as attestation ID, timestamp, attester address, chain information, and encoded attestation data.
If you are querying for a specific recipient, filter by the recipient.
Validate
For a Human ID V3 SBT, verification should include the circuit ID, action ID, and issuer used to generate the ZKP:
- Circuit ID should match the target circuit
- Action ID should be the default action ID for Human ID Sybil resistance proofs
- Issuer should match the target Human Tech issuer
See here for circuit IDs, action ID, and issuers.
// We are using Ethers v5
const { ethers } = require("ethers");
// Extract attestation data.
const data = "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000004230783732396436363065316330326534653431393734356536313764363433663839376135333836373363636631303531653039336262666135386230613132306200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000068080e7f000000000000000000000000ededf460a77928f59c27f37f73d4853fd8a0798400000000000000000000000000000000000000000000000000000000075bcd151cb8413a579d6138d257450bb5209579bde35c885f7a4405e3767a5a5d2ea6df03fae82f38bf01d9799d57fdda64fad4ac44e4c2c2f16c5bf8e1873d0a3e1993";
const decoded = ethers.utils.defaultAbiCoder.decode(["string", "uint256[]"], data);
const circuitId = decoded[0];
const publicValues = decoded[1];
const actionId = publicValues[2];
const issuer = publicValues[4];
// Make sure circuitId matches KYC circuit ID
if (circuitId != "0x729d660e1c02e4e419745e617d643f897a538673ccf1051e093bbfa58b0a120b") {
throw new Error("Invalid circuit ID");
}
// Validate action ID
if (actionId.toString() != "123456789") {
throw new Error("Invalid action ID");
}
// Make sure issuer is the KYC Human Tech issuer
if (issuer.toHexString() != "0x03fae82f38bf01d9799d57fdda64fad4ac44e4c2c2f16c5bf8e1873d0a3e1993") {
throw new Error("Invalid issuer")
}Last updated on