๐Ÿ‘ฉโ€๐Ÿ’ป
Galactica Network Dev Documentation
  • ๐Ÿ“™Galactica Network Overview
  • ๐ŸงฌGalactica Concepts
    • โ›“๏ธBlockchain Base
    • ๐ŸงพZero-Knowledge KYC
      • Holder Commitment
      • DApp specific HumanID
      • Verification SBT
      • KYC Guardian
      • Galactica Investigation Module
      • Privacy Precautions
    • ๐ŸŒŸReputation
    • ๐Ÿ›‚Contingent Transactions
  • โš™๏ธGalactica Components
    • ๐ŸฆŠGalactica Snap for Metamask
    • ๐ŸŒณRoot Contracts
  • ๐Ÿ—๏ธBuilding a Galactica DApp
    • Example DApps
      • Compliant ERC20
      • Cypherbook
      • Compliant DEX
      • Sybil resistant airdrop
    • Front End
      • Guided Example
        • Connect to Galactica Snap
        • Prepare ZK proof generation
        • Generate and submit ZK proof
        • Handle Verification SBTs
      • Galactica Snap JSON-RPC API
    • Smart Contracts
    • Custom Zero Knowledge Disclosures
  • ๐Ÿ“Guardian Guide
    • Setup to become a Guardian
    • Create and issue ZK certificate
      • ๐ŸชชzkKYC (GIP-1)
      • Arbitrary ZK data certificate (GIP-2)
      • X/Twitter ZK certificate (GIP-3)
      • REY X/Twitter Score ZK certificate (GIP-4)
      • Decentralised Exchange (DEX) ZK certificate (GIP-5)
      • Centralised Exchange (CEX) ZK certificate (GIP-6)
      • Telegram ZK certificate (GIP-7)
  • โ›๏ธValidator Guide
    • ๐Ÿ”งInstallation
    • ๐Ÿ”—Become a Validator
    • ๐Ÿš€galacticad CLI Usage Cheat Sheet
    • ๐Ÿ”’Security Best Practices
  • ๐ŸงชTestNet: Reticulum
    • Release Notes
  • ๐ŸงชDevNet: Andromeda
    • Release Notes
  • ๐Ÿ“ŽChangelog
Powered by GitBook
On this page

Was this helpful?

  1. Building a Galactica DApp
  2. Front End
  3. Guided Example

Handle Verification SBTs

You can lookup on-chain if a user already holds a verification soul-bound token (SBT) from a previous ZKP he/she submitted. Verification SBTs are minted by smart contracts after successful verification and contains an expiration date and details about the addresses, contracts and institutions involved.

Verification SBTs can also include the user's dApp specific human ID. It is a unique identifier hash derived from a DApp address and personal details in the zkKYC (name, birthday, citizenship). It can be used for human centric voting and reputation across multiple wallets of the user. Because it also depends on the DApp address the user can prevent cross referencing it with other verification SBTs by using carefully separated wallets.

The verification SBT of a specific wallet and DApp combination can be obtained in this way:

const sbtContract = new ethers.Contract(
  sbtContractAddr,
  VerificationSbtABI.abi,
  provider,
);
const sbtInfo = await sbtContract.getVerificationSBTInfo(
  loggedUser,
  loggedDApp,
);

Alternatively, if you want to find all verification SBTs of a user or a DApp, you can search through the event log using the following filter:

// go through all logs adding a verification SBT for the user
const filter = {
  address: sbtContractAddr,
  topics: [
    ethers.utils.id('VerificationSBTMinted(address,address,bytes32)'),
    dAppAddr ? ethers.utils.hexZeroPad(dAppAddr, 32) : null,
    userAddr ? ethers.utils.hexZeroPad(userAddr, 32) : null,
    humanID ? ethers.utils.hexZeroPad(humanID, 32) : null,
  ],
};

const createStakeLogs = await sbtContract.queryFilter(
  filter as EventFilter,
  0,
  currentBlock,
);
PreviousGenerate and submit ZK proofNextGalactica Snap JSON-RPC API

Last updated 1 year ago

Was this helpful?

Because most RPC endpoints limit the range of blocks to find logs, we provided a search function that loops through the history and caches results to make following queries faster. You can find it .

๐Ÿ—๏ธ
here