R

Rafiki Multi-Instance Accounting Architecture

rafiki.dev

Instance isolation, bilateral peer credit lines & non-overlapping double-entry ledger flows

Multi-Instance Double-Entry Architecture

System Topology

Rafiki accounts are strictly internal liquidity and bilateral settlement trackers. End-user fiat balances are held exclusively in each entity's external Customer Core Ledger.

Deposits (Inflow to Liquidity)
Withdrawals (Outflow to Core)
ILP Interledger Packet Routing
Settlement Offset (≤ 0 balance)
Account Servicing Entity A

Sender Institution (Bank / Wallet A)

Instance A
Customer Core Ledger (External Bank)
Real Fiat Vault

Stores sender checking/savings balances. Rafiki has no direct access.

Sender User Balance: $1,000.00 USD

Rafiki Accounting Instance A (TigerBeetle)

Internal Only
Liquidity Accounts (Balance ≥ 0) Debits ≤ Credits
Asset Liquidity (USD)
$500.00
1 per supported asset (FX route)
Deposit Withdraw
Peer Liquidity (Peer B Credit Line)
$100.00
Credit line extended to Peer B
Deposit Withdraw
Payment Liquidity Accounts Open Payments & SPSP
Outgoing Payment Liquidity $0.00
Pre-funded before sending packets
Deposit Refund W/D
Incoming Payment Liquidity $0.00
Created on incoming Open Payment (single-use) Withdraw
Wallet Address Liquidity (SPSP) $0.00
1 per wallet address (persistent/reused) Withdraw
Settlement Account (Balance ≤ 0) Credits ≤ Debits
USD Settlement Account
-$600.00
Balances net fiat injected into Rafiki A Double-Entry Offset
Interledger Protocol

Bilateral ILP Peering between Instance A & Instance B

Packets ≠ Fiat
Account Servicing Entity B

Recipient Institution (Cloud Nine / Bank B)

Instance B
Customer Core Ledger (External Bank)
Real Fiat Vault

Stores recipient balance. Credited when Rafiki completes incoming transfer.

Recipient User Balance: $250.00 USD

Rafiki Accounting Instance B (TigerBeetle)

Internal Only
Liquidity Accounts (Balance ≥ 0) Debits ≤ Credits
Asset Liquidity (USD)
$400.00
1 per supported asset
Deposit Withdraw
Peer Liquidity (Peer A Credit Line)
$100.00
Credit line extended to Peer A
Deposit Withdraw
Payment Liquidity Accounts Open Payments & SPSP
Incoming Payment Liquidity $0.00
1 per incoming payment (receives packet value) Withdraw
Outgoing Payment Liquidity $0.00
Pre-funded before sending packets
Deposit Refund W/D
Wallet Address Liquidity (SPSP) $0.00
Reused per wallet address for SPSP Withdraw
Settlement Account (Balance ≤ 0) Credits ≤ Debits
USD Settlement Account
-$500.00
Balances net fiat injected into Rafiki B Double-Entry Offset

Account Deep Dive

Select any node

Rafiki Accounting Operations Invariants

rafiki.dev/accounting
Account Type Allowed Deposit Allowed Withdraw Balance Constraint Core Purpose
Asset Liquidity YES YES ≥ 0 (Debits ≤ Credits) FX conversion liquidity per asset
Peer Liquidity YES YES ≥ 0 (Debits ≤ Credits) Bilateral credit line extended to peering partner
Outgoing Payment Liquidity YES (Pre-fund) YES (Refunds) ≥ 0 (1 per outgoing payment) Holds reserved value before dispatching packets
Incoming Payment Liquidity — YES (Sweep) ≥ 0 (1 per incoming payment) Holds received packets until swept to core account
Wallet Address Liquidity — YES (Sweep) ≥ 0 (1 per wallet address) SPSP payments repository; reused across payments
Settlement Account AUTOMATIC COUNTERBALANCE ≤ 0 (Credits ≤ Debits) Guarantees ΣDebits = ΣCredits double entry