Skip to content

Repository files navigation

Billions Attestations Registry example

This repo shows some examples of usage for Billions Attestations Registry.

Setup

  1. Install dependencies

    npm i
    
  2. Copy .env.example to .env and replace the values with your specific configuration mainly for PRIVATE_KEY that will be used to send transactions for authentication and attestations.

  3. Download privado ID circuits. We will need AuthV2 circuit to generate authV2 proof.

    ./dl_circuits.sh
    

Examples

  1. 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
    
  2. Get review attestations for a specific identity

    npm run identity:reviews -- --did did:iden3:billions:test:2W4c3K3BgksQCSdXCP5LJDDrexPL1gHUfaCHAACE4a
    
  3. Revoke an attestation that is not revoked

    npm run revoke:attestation -- --id 0x89c074c18440bc0b1dd902683249f4fee916402262a1d51d90ad1cfe71d202fd
    
  4. Create ownership attesation for a specific identity

    npm run create:ownership  -- --recipientDid did:iden3:billions:test:2W4c3K3BgksQCSdXCP5LJDDrexPL1gHUfaCHAACE4a
    
  5. Check if an agent has ownership attestation

    npm run check:ownership -- --did did:iden3:billions:test:2W4c3K3BgksQCSdXCP5LJDDrexPL1gHUfaCHAACE4a
    
  6. Create custom schema

    npm run create:custom:schema -- --schemaDefinition "string surveyName,string question1,string question2,uint256 score" --revocable true
    
  7. 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.

Check attestations

You can check attestations in different ways:

About

Billions Attestations examples

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages