Compliance & KYC System
TOS provides a protocol-level KYC (Know Your Customer) system that enables decentralized identity verification while maintaining user privacy. Inspired by BrightID’s privacy-first approach, TOS stores only minimal verification metadata on-chain while full KYC data is managed off-chain by regional security committees.
Implementation Status
| Feature | Status |
|---|---|
| Core Data Structures (14) | Implemented |
| Transaction Types (9) | Implemented |
| Verification Logic (9) | Implemented |
| Smart Contract Syscalls (6) | Implemented |
| RPC Interface (10) | Implemented |
| Unit Tests (95+) | Implemented |
| E2E Tests (14) | Implemented |
Design Philosophy
ON-CHAIN (43 bytes) OFF-CHAIN (Committee DB)
------------------------ ---------------------------
level: u16 (2 bytes) <-hash-> region: KycRegion
status: u8 (1 byte) country: [u8; 2] (ISO)
verified_at: u64 (8 bytes) expires_at: u64
data_hash: Hash (32 bytes) committee_id: Hash
approver: PublicKey
signature: Signature
documents: Vec<DocRef>Key Principles:
- Minimal On-Chain Data: Only 43 bytes stored per user
- Privacy First: No PII or country data on blockchain
- Committee-Based Verification: Regional security committees manage KYC
- Smart Contract Integration: Contracts can gate access by KYC level
KYC Level System
TOS uses a cumulative bitmask system where each bit represents a completed verification item. Higher tiers require all previous verifications.
Verification Tiers
| Tier | Name | Level | Verifications | Daily Limit |
|---|---|---|---|---|
| 0 | Anonymous | 0 | None | $100 |
| 1 | Basic | 7 | Email + Phone + Basic Info | $1,000 |
| 2 | Identity Verified | 31 | + Government ID + Liveness | $10,000 |
| 3 | Address Verified | 63 | + Proof of Address | $50,000 |
| 4 | Source of Funds | 255 | + SOF + SOW | $200,000 |
| 5 | Enhanced DD | 2047 | + Background + Screening + UBO | $1,000,000 |
| 6 | Institutional | 8191 | + Company + Directors | Custom |
| 7 | Audit Complete | 16383 | + Compliance Audit | No Limit |
| 8 | Regulated | 32767 | + Financial License | No Limit |
Verification Items (Bitmask)
// Basic Individual Verification (bit 0-4)
EMAIL = 1 << 0 // 1 - Email verification
PHONE = 1 << 1 // 2 - Phone verification
BASIC_INFO = 1 << 2 // 4 - Basic info (name, DOB)
GOV_ID = 1 << 3 // 8 - Government ID
LIVENESS = 1 << 4 // 16 - Face/liveness check
// Enhanced Verification (bit 5-7)
ADDRESS = 1 << 5 // 32 - Proof of address
SOF = 1 << 6 // 64 - Source of funds
SOW = 1 << 7 // 128 - Source of wealth
// Due Diligence (bit 8-10)
BACKGROUND = 1 << 8 // 256 - Background check
SCREENING = 1 << 9 // 512 - PEP/sanctions screening
UBO = 1 << 10 // 1024 - Ultimate beneficial owner
// Institutional (bit 11-14)
COMPANY = 1 << 11 // 2048 - Company registration
DIRECTORS = 1 << 12 // 4096 - Directors/shareholders
AUDIT = 1 << 13 // 8192 - Compliance audit
LICENSE = 1 << 14 // 16384 - Financial licenseSecurity Committee Structure
KYC verification is managed by a hierarchical committee system:
Global Committee
|
+-----------------+-----------------+
| | |
Asia Pacific Europe Americas
| | |
+----+----+ +----+----+ +----+----+
| | | | | | | | |
JP SG AU UK DE FR US CA BRCommittee Roles
| Role | Capabilities |
|---|---|
| Chair | Full governance, can initiate all operations |
| Vice Chair | Can initiate most operations except dissolve |
| Member | Can vote on operations |
| Observer | View-only, no voting rights |
Multi-Signature Approval
KYC operations require M-of-N committee approval:
| Operation | Threshold |
|---|---|
| Set/Renew KYC | kyc_threshold (2-3 members) |
| Revoke KYC | kyc_threshold |
| Emergency Suspend | 2 members |
| Add/Remove Member | >= 2/3 majority |
| Update Threshold | >= 2/3 majority |
| Dissolve Committee | >= 2/3 majority |
Transaction Types
| Transaction | Type ID | Description |
|---|---|---|
| SetKyc | 10 | Set or update KYC level |
| RevokeKyc | 11 | Revoke KYC status |
| RenewKyc | 12 | Renew expired KYC |
| TransferKyc | 13 | Transfer KYC to new committee |
| BootstrapCommittee | 14 | Create Global Committee (one-time) |
| RegisterCommittee | 15 | Register regional committee |
| UpdateCommittee | 16 | Update committee settings |
| AppealKyc | 17 | Appeal KYC decision |
| EmergencySuspend | 18 | 24-hour emergency suspension |
Smart Contract Integration
Syscalls
| Syscall | Gas | Description |
|---|---|---|
tos_has_kyc | 500 CU | Check if user has KYC |
tos_get_kyc | 500 CU | Get full KYC data |
tos_get_kyc_level | 500 CU | Get level bitmask |
tos_get_kyc_tier | 500 CU | Get tier (0-8) |
tos_is_kyc_valid | 500 CU | Check validity |
tos_meets_kyc_level | 500 CU | Check level requirement |
Example: KYC-Gated DeFi
use tako_sdk::*;
#[no_mangle]
pub extern "C" fn deposit() {
let user = get_tx_sender();
let amount = get_call_value();
// Require Identity Verified (Tier 2) for deposits > $1000
if amount > 1000_00000000 {
let meets_req = tos_meets_kyc_level(&user, 31)
.expect("KYC check failed");
if !meets_req {
panic!("KYC Tier 2 required for large deposits");
}
}
// Process deposit...
}Example: Tiered Access Control
use tako_sdk::*;
fn get_user_limit(user: &Address) -> u64 {
let tier = tos_get_kyc_tier(user).unwrap_or(0);
match tier {
0 => 100_00000000, // $100
1 => 1_000_00000000, // $1,000
2 => 10_000_00000000, // $10,000
3 => 50_000_00000000, // $50,000
4 => 200_000_00000000, // $200,000
5 => 1_000_000_00000000, // $1,000,000
_ => u64::MAX, // Unlimited
}
}
fn check_transfer_limit(user: &Address, amount: u64) -> bool {
let limit = get_user_limit(user);
amount <= limit
}RPC Endpoints
| Endpoint | Description |
|---|---|
POST /has_kyc | Check if user has KYC |
POST /get_kyc | Get KYC data |
POST /get_kyc_tier | Get tier (0-8) |
POST /is_kyc_valid | Check validity |
POST /meets_kyc_level | Check level requirement |
POST /get_verifying_committee | Get verifying committee |
POST /get_committee | Get committee details |
POST /get_global_committee | Get Global Committee |
POST /get_kyc_batch | Batch query (up to 100) |
POST /list_committees | List committees with filtering |
Example: Query KYC Status
// Check user's KYC tier
const response = await fetch('/get_kyc_tier', {
method: 'POST',
body: JSON.stringify({ address: userAddress })
});
const { tier } = await response.json();
// Check if user meets requirement
const meetsReq = await fetch('/meets_kyc_level', {
method: 'POST',
body: JSON.stringify({
address: userAddress,
required_level: 31 // Tier 2: Identity Verified
})
}).then(r => r.json());Regulatory Compliance
TOS KYC is designed to meet international regulatory standards:
| Standard | TOS Support |
|---|---|
| FATF Travel Rule | Tier 2+ for >= $1,000 |
| EU MiCA | Full compliance |
| US FinCEN | $3,000 threshold |
| Japan FSA | All transactions |
FATF Travel Rule Thresholds
| Region | Threshold | Required Tier |
|---|---|---|
| FATF Standard | $1,000 | Tier 2 |
| United States | $3,000 | Tier 2 |
| European Union | EUR 1,000 | Tier 2 |
| Japan | All transactions | Tier 2 |
| Singapore | SGD 1,500 | Tier 2 |
TOS provides the infrastructure for KYC verification. DApps building on TOS are responsible for implementing appropriate compliance measures for their jurisdiction.
Data Structure
/// On-chain KYC data (43 bytes)
pub struct KycData {
/// KYC level bitmask (u16)
pub level: u16,
/// Status: Active, Expired, Revoked, Suspended
pub status: KycStatus,
/// Verification timestamp
pub verified_at: u64,
/// Hash of off-chain data
pub data_hash: Hash,
}
/// KYC status
pub enum KycStatus {
Active = 0,
Expired = 1,
Revoked = 2,
Suspended = 3,
}Appeal Process
Users can appeal KYC decisions to the parent committee:
- File Appeal: Submit
AppealKyctransaction with reason and documents - Committee Review: Parent committee reviews the appeal
- Decision: Approved, Rejected, or referred to higher committee
- Resolution: KYC status updated based on decision
Appeals require a fee and must be filed within 30 days of the original decision.
See Also
- Privacy Transfer (UNO) - Private transactions
- Referral System - Multi-level relationships
- Smart Contracts - TAKO runtime integration