Compliance Oracle
REST API server bridging off-chain KYC verification with on-chain allowlist management
Compliance Oracle
The Compliance Oracle is an Express server that connects off-chain KYC providers (Sumsub, Jumio, Onfido) to on-chain allowlist programs. When a user passes KYC, the Oracle automatically adds their wallet to the token's allowlist. When verification is revoked, the wallet is removed.
Quick Start
1. Install
2. Configure Environment
3. Start the Server
The server starts on http://localhost:3000. Check health at GET /health.
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | Server port |
SOLANA_RPC_URL | http://127.0.0.1:8899 | Solana RPC endpoint |
REDIS_URL | redis://127.0.0.1:6379 | Redis connection for job queue |
WALLET_PATH | ~/.config/solana/id.json | Keypair file path (must have authority over allowlist) |
MAX_BATCH_SIZE | 20 | Wallets per allowlist transaction |
KYC_PROVIDER | mock | KYC adapter: mock, sumsub, jumio, onfido |
KYC_API_KEY | — | KYC provider API key |
KYC_API_SECRET | — | KYC provider secret (not needed for Onfido) |
DEFAULT_MINT | — | Fallback mint address for KYC webhooks |
REST API
All endpoints are prefixed with /v1.
Allowlist
| Method | Path | Description |
|---|---|---|
| POST | /v1/allowlist/:mint/wallets | Add wallets to allowlist (batched) |
| DELETE | /v1/allowlist/:mint/wallets | Remove wallets from allowlist |
| GET | /v1/allowlist/:mint/wallets | List all allowlisted wallets |
| GET | /v1/allowlist/:mint/check/:wallet | Check if a wallet is allowlisted |
| POST | /v1/allowlist/:mint/sync | Force sync with KYC provider |
Add Wallets
Wallets are batched into groups of MAX_BATCH_SIZE (default 20) and submitted as on-chain transactions.
Check Wallet
Token Configuration
| Method | Path | Description |
|---|---|---|
| GET | /v1/tokens/:mint/config | Get compliance configuration |
| PATCH | /v1/tokens/:mint/config | Update compliance parameters |
KYC
| Method | Path | Description |
|---|---|---|
| POST | /v1/kyc/webhook | Receive KYC provider callback |
| GET | /v1/kyc/status/:wallet | Check wallet KYC status |
| GET | /v1/kyc/verified | List all verified wallets |
The KYC webhook endpoint is called by your KYC provider (Sumsub, Jumio, Onfido) when a user's verification status changes. The Oracle parses the provider-specific payload and automatically updates the on-chain allowlist.
See KYC Providers for provider-specific configuration.
Webhooks
| Method | Path | Description |
|---|---|---|
| POST | /v1/webhooks | Register a webhook |
| GET | /v1/webhooks | List registered webhooks |
| DELETE | /v1/webhooks/:id | Remove a webhook |
See Webhooks for event types and delivery details.
WebSocket
Real-time event streaming is available at ws://host:port/ws. See Real-Time Monitoring.
Architecture
The Chain Listener subscribes to on-chain program logs and emits events to both the Webhook Dispatcher (for HTTP delivery) and WebSocket clients (for real-time streaming).