This repo shows some examples of usage for Billions Attestations Registry.
-
Install dependencies
npm i -
Copy
.env.exampleto.envand replace the values with your specific configuration mainly forPRIVATE_KEYthat will be used to send transactions for authentication and attestations. -
Download privado ID circuits. We will need AuthV2 circuit to generate authV2 proof.
./dl_circuits.sh
-
Create review attestation for a specific identity
npm run create:review -- --stars 5 --comment "A new comment for the identity" --recipientDid did:iden3:billions:test:2W4c3K3BgksQCSdXCP5LJDDrexPL1gHUfaCHAACE4a -
Get review attestations for a specific identity
npm run identity:reviews -- --did did:iden3:billions:test:2W4c3K3BgksQCSdXCP5LJDDrexPL1gHUfaCHAACE4a -
Revoke an attestation that is not revoked
npm run revoke:attestation -- --id 0x89c074c18440bc0b1dd902683249f4fee916402262a1d51d90ad1cfe71d202fd -
Create ownership attesation for a specific identity
npm run create:ownership -- --recipientDid did:iden3:billions:test:2W4c3K3BgksQCSdXCP5LJDDrexPL1gHUfaCHAACE4a -
Check if an agent has ownership attestation
npm run check:ownership -- --did did:iden3:billions:test:2W4c3K3BgksQCSdXCP5LJDDrexPL1gHUfaCHAACE4a -
Create custom schema
npm run create:custom:schema -- --schemaDefinition "string surveyName,string question1,string question2,uint256 score" --revocable true -
Create custom attestation
npm run create:custom:attestation -- --schemaId "0x31ab00cee3d067ae5000edf4cbc2c951c340fc1121305c4d5e567e61e1815aae" --surveyName "survey1" --question1 "question1 details" --question2 "question2 details" --score "120" --recipientDid did:iden3:billions:test:2W4c3K3BgksQCSdXCP5LJDDrexPL1gHUfaCHAACE4a
If you need to create custom attestations based on your custom schema you can update createCustomAttestation.ts with your specific schema fields to register the attestation and to decode the information from the onchain attestation properly.
You can check attestations in different ways:
- Billions Testnet Block Explorer. In the Attestation Registry contract (https://billions-testnet-blockscout.eu-north-2.gateway.fm/address/0x40Ef525515E409F45659f2d8E9962f9aeA3ab68A?tab=txs)
- Billions Tesnet Attestations Explorer. https://attestations-explorer-testnet.billions.network
- Billions Testnet Attestations API. Calling the API and filtering by attestations fields.
curl https://attestations-api-testnet.billions.network/api/v1/attestations?schemaId=0xc5708478573c079ed58716909734f526d843151672414e7474fadc11e4cb041f&recipientDid=did:iden3:billions:test:2W4c3K3BgksQCSdXCP5LJDDrexPL1gHUfaCHAACE4a&page_number=1&page_size=100