๐Ÿ‘ฉโ€๐Ÿ’ป
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
  • ZkCertificate registry contract
  • Verification SBT contract
  • Reputation Root Contract
  • ZkCertificate Guardian Whitelist contract
  • Example zkKYC AgeProof contract
  • Example ZKP verifier contract
  • Example fraud investigation institution
  • Example DApp contract
  • Airdrop use case example with KYC, age check + fraud investigation
  • Wrapped GNET
  • Poseidon Library
  • Example zkKYC contract
  • RepeatableZKPTest contract
  • Devnet Guardian contract
  • HumanIDSaltRegistry

Was this helpful?

  1. Galactica Components

Root Contracts

PreviousGalactica Snap for MetamaskNextBuilding a Galactica DApp

Last updated 8 months ago

Was this helpful?

This page lists system level smart contracts and explains their role on Galactica.

The overview of addresses in the testnet can be found in .

ZkCertificate registry contract

The ZkCertificate registry contract holds the information about issued ZkCertificates. Each ZkCertificate is added as a hash to a Merkle tree and is revoked by setting this hash back to the default empty value.

The smart contract stores several merkle roots against which the membership proofs are verified. When a ZkCertificate is issued then the new merkle root is added to the set of valid roots. When a ZkCertificate is revoked then this set is emptied and only the newest one is deemed valid.

In order to avoid concurrency issue guardians need to register the ZkCertificate hash corresponding to their operation using the function registerToQueue(bytes32 zkCertificateHash). The operations in the queue are processed in the order they were registered. This function also assigns to the operation an expiration time until which the guardians need to perform the operation (and no other operation can be executed to avoid concurrency), otherwise it can be skipped. The expiration time is calculated as follows: if there is no other operation pending, then it is current block time plus 5 minutes, otherwise it is the expiration time of the last pending operation plus 5 minutes. Note that when an operation gets in turn (i.e. no other pending operation) in can also be executed immediately regardless of the expiration of the previous operation.

Verification SBT contract

The verification SBT contract stores successfully completed ZkCertificate verifications. A mapping indexed by the hash of user address and DApp, contains information about the SBT, such as the expiration date and encrypted notes for the Galactica Investigation Module. Each verification SBT also has a tokenID and information can also be found using this tokenID.

Reputation Root Contract

The reputation root contract is smart contract interface to Galactica's reputation module. Users and DApps can define Reputation functions and configure Contingent Transactions.

First version still in development.

ZkCertificate Guardian Whitelist contract

The ZkCertificate Guardian Whitelist contract manages which ZkCertificate Guardians are authorized to issue ZkCertificates.

It is meant as simple first solution to gather feedback. In the long term it will be replaced by a decentralized system based on reputation.

Example zkKYC AgeProof contract

This smart contract contains the on-chain verification of a ZKP proving that the holder has a valid zkKYC and that the age is >=18. It demonstrates what verification steps are required to check that a ZKP is consistent with the on-chain state. It integrates the Example ZKP verifier contract.

Example ZKP verifier contract

The ZKP verifier contract contains the logic to verify if ZKPs are valid in themselves given the zero-knowledge circuit it is based on. This contract is auto generated from the circom2 circuit.

Example fraud investigation institution

A simple contract stating an institution's public encryption keys.

Example DApp contract

The example DApp contract shows how to integrate zkKYC. The example mints a Verification SBT for user successfully proving that they are real and unique humans. The uniqueness of the user is based on the DApp specific HumanID.

Airdrop use case example with KYC, age check + fraud investigation

The example DApp contract shows how to integrate zkKYC. The example use case airdrops tokens to users proving that they are real and unique humans. The uniqueness of the user is based on the DApp specific HumanID. So every user can receive the airdrop of a token only once.

Wrapped GNET

Wrapping GNET as ERC20 token equivalent to WETH on Ethereum.

Poseidon Library

This is a library smart contract that provides the poseidon hash function to the zkKYC registry contract.

Example zkKYC contract

This smart contract contains the on-chain verification of a ZKP proving that the holder has a valid zkKYC. It demonstrates what verification steps are required to check that a ZKP is consistent with the on-chain state. It integrates the Example ZKP verifier contract generated from the associated ZK circuit.

RepeatableZKPTest contract

This smart contract can be used for testing the ZKP submission. It checks that the ZKP and the zkKYC used for it are valid. After successful validation, a verification SBT is issued in the Verification SBT contract.

Devnet Guardian contract

This contract issues zkKYCs on devnet for testing. It has the same interface as the #zkkyc-registry-contract and can be used by everyone. The sender of the transaction does not need to be on the #kyc-guardian-whitelist-contract.

HumanIDSaltRegistry

The HumanIDSaltRegistry limits each user to a single salt for a unique HumanID. You can find details in DApp specific HumanID.

โš™๏ธ
๐ŸŒณ
Implementation
Implementation
Implementation
Implementation
Implementation
Implementation
Implementation
Implementation
Implementation
Implementation
Implementation
Implementation
Implementation
Additional resources