Demo

We are going to create a verified identity on-chain, and use it to swap USDC to BTC (on devnet).

  1. Visit identity.civic.finance and connect your sollet.io wallet.

    You will see an USDC/BTC liquidity pool.

    This pool has been created using the Identity-gated Token-Swap program.

    When creating the pool, the creator specified an Identity Validator (IdV) public key.

  2. Airdrop some devnet USDC into your wallet

  3. Click the Swap button and attempt to swap USDC for BTC

    The liquidity pool on-chain program rejects your transaction, because you do not have an identity signed by the identity validator.

  4. Let’s create an identity. There are two options. The first, using the demo IdV.

    This simulates a user sending information directly to an identity validator, who checks it, and stores a hash of the information on-chain.

    Note: In this demo, the IdV key is stored on the front-end, and the hash is a simple unsalted SHA-256. In a production system, the user would choose from a set of acceptable IdVs, and establish a session with them, and the attestation would happen on the IdV back-end. Alternatively, the user could reuse a pre-attested identity (see Civic below).

  5. The other alternative, is to use Civic Secure Identity.

    Scan the QR code with the Civic Wallet. Civic returns a reusable, verified credential to the client app, which can then be stored on-chain as above.

    Note: In this demo, the Civic credential is attested onto Solana on the front-end, as with step 4. In a production system, the Civic IdV would attest on its back-end, as it currently does on other blockchains.

  6. Attempt a swap with the new identity

    Now that the identity is created, the swap can go through. The Token-Swap program identifies that the identity has an attestation registered by the chosen IdV, and allows the transaction.