🏝️
KYC Program
Blue Terra Engineering I. Introduction
Blue Terra is a decentralized protocol for the global democratization of stable and accessible property rights.
Toward this end, we believe in the power of sharing some of the secret sauce that makes Blue Terra possible so that others may build and expand on the core model.
This repo contains the source code for the Blue Terra Civic KYC nonce Solana program.
II. Requirements
III. Program IDL
{
"version": "0.1.0",
"name": "bt_kyc",
"instructions": [
{
"name": "claimLand",
"accounts": [
{
"name": "gatewayToken",
"isMut": false,
"isSigner": false
},
{
"name": "userWallet",
"isMut": true,
"isSigner": true
}
],
"args": [
{
"name": "gatekeeperNetwork",
"type": "publicKey"
}
]
}
]
}
IV. Program Overview
The following is a high level description of the Anchor Program used in our claim land and KYC process.
The program is a minimalist nonce written in Anchor Lang and provides Blue Terra a simple way to keep track of KYC verified wallets and civic tokens on-chain.
In particular, if a Blue Terra NFT holder has a valid KYC, through the posession of a valid civic gatewayToken
SPL token, then they will be able to interact with the kyc-program
to claim their land and activate the leases embedded within their NFTs.
The program contains one instruction, claimLand
. This instruction leverages the Civic Gateway decorator to detect the KYC status of a given walletAddress
and gatewayToken
.
On detection of a valid Civic KYC status, the program will log the walletAddress
and gatewayToken
of the user to the program standard output.
V. Building
To build this program run:
anchor build
On successful build you will have a target
directory in your top level.
VI. Deployment
To deploy the program follow the steps below:
Find the program's address by running:
solana address -k ./target/deploy/bt_kyc-keypair.json
Copy and paste this address into ./Anchor.toml
and ./programs/bt-kyc
Finally run the following:
anchor deploy
VII. Client Side Instrumentation
To interact with the program from a NodeJS client we recommend using:
- @project-serum/anchor to instrument program rpc requests from the client.
- @solana/web3.js for NodeJS Solana libraries.
- @civic/solana-gateway-react for Civic's KYC Libraries and React Providers.
- @solana/wallet-adapter for Solana React wallet adapter components.
A high level sketch of this interaction can be found below. Using the included React hooks from the packages above is often useful.