-
-
Notifications
You must be signed in to change notification settings - Fork 2
Program Details (On‐Chain Reference)
This documentation describes the program that the solana-kyc-compliance-sdk interacts with. The SDK’s primary function is to simplify the creation of an instruction that modifies or creates these on-chain data structures.
All client transactions must target the following program address:
- Program ID: KYC_COMPLIANCE_PROGRAM_ID_ABC123456789...
- Language/Framework: Rust / Anchor
The core of the compliance enforcement is stored in a single type of Program Derived Address (PDA) account, owned by the Program ID above.
This account is the definitive on-chain proof of a user's compliance status. It is a PDA derived from the seed ['attestation', user_pubkey].
| Field Name | Type (Rust) | Description |
|---|---|---|
| discriminator | [u8; 8] | Anchor's standard account discriminator. |
| user | Pubkey | The wallet address of the user being attested to. |
| issuer | Pubkey | The authorized entity (the Issuer Wallet) that signed this attestation. |
| status_code | u8 | The canonical status code (e.g., 0=Unverified, 1=Verified Tier 1, 2=Verified Accredited). |
| jurisdiction | [u8; 2] | ISO 3166-1 alpha-2 country code (e.g., [85, 83] for "US"). |
| valid_until_timestamp | i64 | Unix timestamp after which this attestation is considered expired. |
| bump | u8 | The bump seed used to derive this PDA. |
| Canonical Status Codes (KYC_LEVEL) | ||
| The status_code field is critical. Your on-chain programs (like the Transfer Hook) should use these codes for validation. |
| Code | Label (SDK/Client) | Description |
|---|---|---|
| 0 | Unverified | Default state. User has not completed or failed KYC. |
| 1 | Verified_Tier1 | Standard verification (KYC/ID). Eligible for basic token operations. |
| 2 | Verified_Accredited | Enhanced verification (KYC, AML, PEP, Accredited Investor status). |
| 99 | Flagged_AML | User has failed an AML check and is permanently restricted. |
- Program Instructions The ComplianceSDK is designed to build a single, essential instruction. issue_attestation The instruction used to create or update a user's ComplianceAttestation account. This instruction must always be signed by the Issuer Wallet.
| Index | Account | Type | Description |
|---|---|---|---|
| 0 | [w] Attestation Account | PDA (['attestation', user]) | The account being created or updated. |
| 1 | [s] Issuer | Signer | The authorized keypair that verified the off-chain KYC check. |
| 2 | [ ] User | Public Key | The wallet receiving the attestation. |
| 3 | [ ] System Program | Program ID | Required for account creation (if the PDA doesn't exist). |
| Index | Argument | Type (Rust) | Description |
| --- | --- | --- | --- |
| 0 | status_code | u8 | The canonical code to write (e.g., 1 for Verified Tier 1). |
| 1 | jurisdiction | [u8; 2] | The user's country code. |
| 2 | valid_duration_seconds | u32 | How long, in seconds, the attestation is valid from the time of transaction processing. |
Example Instruction Data (Anchor IDL) If using Anchor, the instruction data serialization would follow this format: { "name": "issueAttestation", "accounts": [ ... ], "args": [ { "name": "statusCode", "type": "u8" }, { "name": "jurisdiction", "type": "u8" }, { "name": "validDurationSeconds", "type": "u32" } ] }
"actionButtons": { "commands": [ { "name": "$(key) Generate Dev Keypair", "color": "green", "command": "terminal.sendSequence", "args": { "text": "solana-keygen new --outfile ./temp-dev-keypair.json\n" } } ] }