Kovra: Cross-Border Payment Infrastructure Layer
Arsitektur Kovra dirancang sebagai abstraction layer untuk fintech & platforms - mirip "Stripe Treasury + Wise Engine" tapi fokus corridor EU/UK/ID + B2B batch.
Key Design: API-first, modular regional adapters, orthogonal compliance, standalone mode.
For detailed component specs, see 02_COMPONENTS.md.
For compliance architecture, see 03_COMPLIANCE.md.
For deployment details, see 04_DEPLOYMENT.md.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β KOVRA PLATFORM β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββ βββββββββββββββββββββ β
β β PAYMENT DOMAIN β β COMPLIANCE DOMAIN β β
β β β β β β
β β β’ Quote Service β β β’ KYC/AML β β
β β β’ Transfer Svc βββββββΊβ β’ Risk Scoring β β
β β β’ Wallet Service βEvent β β’ Audit Trail β β
β β β’ Batch Service βBus β β’ Screening β β
β βββββββββββββββββββββ βββββββββββββββββββββ β
β β β β
β β ββββββββββββββββ β β
β ββββββΊβ Kafka βββββββ β
β β (Events) β β
β ββββββββββββββββ β
β β
β Principle: Change one domain without affecting the other β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- No mandatory external APIs: Core platform works standalone
- Optional enhancements: External feeds (FX rates, sanctions) = cache + async updates
- Interface contracts: Services communicate via interfaces, not concrete implementations
| Component | Technology | Purpose |
|---|---|---|
| Backend | Go 1.25+ | API services, business logic |
| Main DB | PostgreSQL 18 | Tenants, transfers, audit |
| Ledger | TigerBeetle | Double-entry accounting, balance tracking |
| Cache | Redis 8.4 | Rate limiting, FX rate lock, session |
| Job Queue | River | Webhook delivery, scheduled jobs, retry logic |
| Event Streaming | Kafka | Transfer events, audit trail, notifications |
| Compliance | OxCaml 90% + Python 10% | KYC/AML core in OxCaml, ML bridge in Python (see 03_COMPLIANCE.md) |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β B2B CLIENTS β
β (E-commerce Platforms / Corporate Treasury Systems) β
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Tokopedia β β Bukalapak β β Corp ERP β β Treasury β β
β β Integration β β Integration β β (SAP/Odoo) β β Management β β
β ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ β
β ββββββββββββββββββ΄βββββββββββββββββ΄βββββββββββββββββ β
β β β
ββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API GATEWAY β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Rate Limit β β Auth (JWT/ β β Request β β Idempotency β β
β β (per tier) β β API Key) β β Validation β β Check β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CORE SERVICES β
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Quote β β Transfer β β Recipient β β Wallet β β
β β Service β β Service β β Service β β Service β β
β β β β β β β β β β
β β β’ FX rates β β β’ Orchestrateβ β β’ Validate β β β’ Balance β β
β β β’ Lock rate β β β’ State mgmt β β β’ Store bank β β β’ Hold/Releaseβ β
β β β’ Margin calcβ β β’ Retry logicβ β β’ IBAN check β β β’ Multi-curr β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β βββββββββββββββββββ΄ββββββββββββββββββ΄ββββββββββββββββββ β
β β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Batch β β Compliance β β Webhook β β
β β Service β β Service β β Service β β
β β β β β β β β
β β β’ Bulk ops β β β’ KYC/AML β β β’ Delivery β β
β β β’ Scheduling β β β’ Screening β β β’ Retry β β
β β β’ Validation β β β’ Audit β β β’ JWS sign β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
βββββββββββΌββββββββββββββββββΌββββββββββββββββββΌβββββββββββββββββββββββββββββββ
β β β
β ββββββββββββββ΄βββββββββββββ β
β β Kafka Topics β β
β β β’ transfer.events β β
β β β’ compliance.events β β
β β β’ audit.trail β β
β β β’ webhook.dlq β β
β βββββββββββββββββββββββββββ β
β β
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β REGIONAL ADAPTERS β
β β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β
β β EU Adapter β β UK Adapter β β ID Adapter β β
β β (SEPA/PSD2) β β (FPS/CHAPS) β β (BI-FAST/SNAP) β β
β β β β β β β β
β β β’ SEPA Instant β β β’ Faster Pay β β β’ BI-FAST β β
β β β’ SCT β β β’ CHAPS β β β’ RTGS β β
β β β’ ISO 20022 β β β’ ISO 20022 β β β’ SNAP Auth β β
β ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ β
β ββββββββββββββββββββββ΄βββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Kovra bukan bank atau neobank replacement. Kovra adalah infrastructure layer yang dipakai oleh fintech lain.
- β End-user exporters (langsung) - indirect via fintech partners
- β Bank konvensional (CIMB, BCA) - sales cycle panjang
- β Korporasi besar (Unilever, Astra) - treasury system existing
- β Fintech platforms (Xendit, Midtrans) - API integration cepat
- β Payment aggregators - Tambah corridor tanpa rebuild
- β Digital commerce - Batch payout + ERP integration
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FINTECH PARTNER β
β (Xendit, Midtrans, Bank Jago, etc.) β
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Mobile β β Web β β API β β
β β App β β Dashboard β β Endpoints β β
β ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ β
β βββββββββββββββββββ΄ββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββ β
β β KOVRA API (REST) β β
β β β’ Quotes β β
β β β’ Transfers β β
β β β’ Webhooks β β
β βββββββββββββ¬ββββββββββββ β
ββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββ
β β β
βΌ βΌ βΌ
ββββββββββββ ββββββββββββ ββββββββββββ
β Backend β βComplianceβ β Ledger β
β (Go) β β(OxCaml+Py) β β(TB) β
ββββββββββββ ββββββββββββ ββββββββββββ
Value: Fintech partner bisa fokus pada UX & customer acquisition, Kovra handle complex cross-border infrastructure.
| Service | Core Responsibility | Independence |
|---|---|---|
| Quote Service | FX rate fetch, margin calc, rate locking | Can swap FX providers without affecting others |
| Transfer Service | Orchestrate payment lifecycle, state management | No dependency on compliance internals |
| Recipient Service | Validate and store beneficiary details | Can add new rails without touching core |
| Wallet Service | Balance tracking, hold/release | Uses TigerBeetle, isolated from business logic |
| Batch Service | Bulk payment processing | Independent queue processing |
| Compliance Service | KYC/AML screening, risk scoring | Orthogonal domain - see 03_COMPLIANCE.md |
| Webhook Service | Event delivery to tenants | Can be replaced with different queue system |
B2B Client (Exporter)
β
βΌ
POST /quotes βββββββββββββββββββββββββββββ
β β
βΌ β
Quote Service βββFX ratesββββΊ Cache β
β β
ββββββββββββββββΊ Quote {rate, expiry}β
β
POST /transfers {quote_id, recipient} β
β β
βΌ β
Transfer Service β
β β
βββΊ Compliance Check (via event bus) β
β See [03_COMPLIANCE.md] β
β β
βββΊ Wallet Hold (TigerBeetle) β
β β
βββΊ Collect EUR (EU Adapter) β
β β
βββΊ FX Conversion β
β EUR β IDR (Two coordinated β
β TigerBeetle chains) β
β β
βββΊ Payout IDR (ID Adapter) β
β β
βββΊ Webhook: transfer.completed ββββββ
For detailed state machine and ledger design, see 02_COMPONENTS.md.
API Request
β
βββΊ API Key β Tenant ID lookup (Redis)
βββΊ Rate limit check (per tenant tier)
βββΊ Tenant context injection
βββΊ All queries filtered by tenant_id
βββΊ TigerBeetle accounts prefixed with tenant_id
Isolation Guarantees:
β’ Tenant A cannot query Tenant B data
β’ Tenant A cannot debit Tenant B wallet
β’ Webhook signatures are tenant-specific
| Policy | Starter | Growth | Enterprise |
|---|---|---|---|
| Rate Limit | 100 req/min | 500 req/min | 2,000 req/min |
| Daily Volume | $10,000 | $100,000 | $1,000,000+ |
| FX Margin | 150 bps | 80 bps | 30-50 bps |
Implementation: Separate tables (pricing_policies, limit_policies) linked to tenants. Tier = derived from policies, not identity.
LEDGER CODES (ISO 4217):
βββ 360 - IDR (Indonesian Rupiah)
βββ 840 - USD (US Dollar)
βββ 978 - EUR (Euro)
βββ 826 - GBP (British Pound)
βββ 752 - SEK (Swedish Krona)
βββ 208 - Danish Krone)
ACCOUNT TYPES:
βββ TENANT_WALLET (per tenant, per currency)
βββ FEE_REVENUE (platform fees)
βββ FX_POSITION (internal FX operations)
βββ PENDING_INBOUND (funds being collected)
βββ PENDING_OUTBOUND (funds being sent)
βββ REGIONAL_SETTLEMENT (per corridor)
ACCOUNT ID FORMAT:
[tenant_id: 64 bits] [account_type: 8 bits] [currency: 24 bits]
For detailed ledger design and transfer examples, see 02_COMPONENTS.md.
Benefits over direct calls:
β Services don't know about each other
β No cascading failures
β Easy to add new consumers
β Audit trail built-in
Topics:
β’ transfer.events - State changes, completions
β’ compliance.events - Screening results, alerts
β’ audit.trail - Immutable audit log
β’ webhook.dlq - Dead letter queue
// Payment Service doesn't know Compliance internals
type ComplianceChecker interface {
Check(ctx context.Context, transfer Transfer) (ComplianceStatus, error)
}
// Can be implemented by:
// - Real compliance service
// - Mock (testing)
// - No-op (emergency mode)
// - Cached (performance mode)| Region | Adapter | Rails | Key Specs |
|---|---|---|---|
| Indonesia | ID Adapter | BI-FAST (instant), RTGS (large) | SNAP Auth, ISO 20022 |
| EU | EU Adapter | SEPA Instant, SCT | FAPI 2.0, PSD2, ISO 20022 |
| UK | UK Adapter | Faster Payments, CHAPS | UK FAPI, ISO 20022 |
For detailed adapter specs, see INTEGRATION.md.
| Scenario | Detection | Action |
|---|---|---|
| Quote expired | State timeout (10min) | Reject, user creates new quote |
| Compliance fail | Screening service | Block + flag for review |
| Insufficient funds | Balance check | Reject immediately |
| Rail timeout | No ACK in 5min | Mark PENDING_RAIL, retry with backoff |
| Rail rejection | Negative ACK | Mark RAIL_REJECTED, refund |
For comprehensive failure handling, see 02_COMPONENTS.md.
# Kovra can run 100% offline
mode: standalone
features:
- sanctions_source: local_db # No OFAC API calls
- fx_rates_source: internal # No XE/Fixer required
- compliance_mode: rule_based # No ML model required
- audit_storage: local # No external log aggregation
# External APIs = optional enhancements
enhancements:
- sanctions_sync: async_daily # Update local DB
- fx_feeds: xe, fixer, bi_jisdor # Better rates
- ml_screening: optional # Better accuracy- Traditional: 18-24 bulan build cross-border infrastructure
- Kovra: 3-9 bulan POC β production
- API-first: Integration dalam minggu, bukan bulan
- Fokus: EU/UK β Indonesia (high-demand corridor)
- Rails: SEPA Instant, FPS, BI-FAST (real-time)
- FX: Internal calculation + external feeds (hybrid)
- Orthogonal: Compliance evolve tanpa touch payment flow
- Standalone: Works 100% tanpa external APIs
- Event-driven: Kafka untuk async processing
- Immutable ledger: TigerBeetle untuk audit trail
- Bulk payouts ke supplier global
- Netting untuk optimize FX
- ERP integration (SAP, Odoo)
| Player | Approach | Kovra Differentiation |
|---|---|---|
| Xendit | Build sendiri, corridor luas | Kovra: Deeper EU/UK/ID, faster integration |
| Wise | Direct to consumer | Kovra: B2B infrastructure, white-label |
| Traditional Banks | Legacy systems | Kovra: API-first, <50ms latency |
| Stripe | US-focused | Kovra: Indonesia/SEA focused |
| Metric | Target | Notes |
|---|---|---|
| TPS | 5,000 | k6 load test |
| P50 latency | < 15ms | API response |
| P95 latency | < 50ms | API response (faster than traditional 200-500ms) |
| Success rate | > 99.5% | Completed transfers |
| Compliance screening | < 500ms | Fast fail for payment flow |
| Time to Integration | < 4 minggu | Untuk fintech API-ready |
| Data | Location | Compliance |
|---|---|---|
| IDR transfers | Indonesia partition | OJK |
| EUR/SEK/DKK | EU partition | GDPR |
| GBP | UK partition | FCA |
Implementation: PostgreSQL LIST partitioning on compliance_region column.
00_OVERVIEW.md (you are here)
β
βββΊ 01_ARCHITECTURE.md (high-level)
β βββΊ 02_COMPONENTS.md (detailed implementation)
β
βββΊ 03_COMPLIANCE.md (KYC/AML domain)
β
βββΊ 04_DEPLOYMENT.md (infrastructure)
β
βββΊ INTEGRATION.md (external adapters)
β
βββΊ DATABASE.md (schema)
β
βββΊ SECURITY.md (auth, encryption)
Next: 02_COMPONENTS.md for detailed component specs
Compliance: 03_COMPLIANCE.md for KYC/AML architecture
Deploy: 04_DEPLOYMENT.md for infrastructure setup
Last Updated: 2026-02-15 (Positioning Update: Infrastructure Layer untuk Fintech)