Sandbox Demos

Stablecoin Card Settlement

A full-fidelity sandbox for testing native USDC settlement in card issuing and acquiring programs. Replace T+2 wire transfers with real-time on-chain settlement on Base—without changing the consumer card experience.

Real-time USDC
Settlement
ISO 8583 Simulation
Network
Base Testnet
Chain

Live Settlement Simulation

Compare traditional T+2 vs USDC real-time settlement

Traditional Settlement
T+2 Days
~48-72 hours
USDC Settlement
Real-time
~15 seconds on Base
1
AuthorizationISO 8583: 0100/0110
~2 seconds
~2 seconds
2
CaptureISO 8583: 0200/0210
End of day
Immediate
3
Clearing FileISO 8583: 0500
Next morning
Real-time
4
Issuer Settlement
T+1 (wire)
~15 seconds (USDC)
5
Acquirer Settlement
T+2 (wire)
~15 seconds (USDC)
6
Merchant Payout
T+2 to T+3
Same day (USDC)

Settlement Comparison: Traditional vs Stablecoin

AspectTraditional (T+2)USDC SettlementImprovement
Settlement TimeT+2 business daysNear real-time (~15 seconds)99.9% faster
Operating Hours5 days/week (banking hours)24/7/365Always available
Cross-Border Fees2-4% + FX spread<0.1% gas fees95%+ savings
ReconciliationManual, batch-basedAutomated, real-timeZero exceptions
Capital EfficiencyFloat locked for 2+ daysInstant liquidityWorking capital freed
Issuer Settlement (Card Spend)
  • Cardholder spends at merchant via card network
  • Authorization via ISO 8583 0100/0110 messages
  • Issuer settles obligation to network in USDC on Base
  • Real-time confirmation vs T+2 wire transfer
Acquirer Settlement (Merchant Payout)
  • Network settles with acquirer in USDC
  • Acquirer routes USDC to merchant wallet
  • Merchant receives funds same-day (not T+2)
  • Optional: Auto-convert to fiat via off-ramp
Network Message Simulation
  • Full ISO 8583 message flow simulation
  • Authorization, clearing, and settlement phases
  • Batch file generation (0500 messages)
  • Exception handling and reversal flows

ISO 8583 Message Types (Simulated)

0100
Authorization Request
Cardholder initiates purchase
0110
Authorization Response
Issuer approves/declines
0200
Financial Request
Capture transaction for clearing
0210
Financial Response
Acknowledge capture
0400
Reversal Request
Void or partial reversal
0420
Acquirer Reversal
Timeout or system failure reversal
0500
Batch Settlement
End-of-day clearing file
0800
Network Management
Sign-on, key exchange, echo

Sandbox Architecture

Card Network Simulator

Simulates Visa/Mastercard network behavior including authorization routing, clearing file generation, and settlement calculations.

ISO 8583 ParserMessage RouterClearing Engine

USDC Settlement Engine

Handles on-chain USDC transfers on Base testnet for both issuer and acquirer settlement flows.

Base TestnetCircle USDCViem/Wagmi

Reconciliation Service

Real-time matching of ISO 8583 clearing messages with on-chain USDC transfers.

Event SourcingAlloyDBPub/Sub

Merchant Payout API

REST API for acquirers to trigger instant USDC payouts to merchant wallets.

Cloud RunWebhooksIdempotency

Implementation Examples

ISO 8583 Authorization Handler
// settlement/iso8583-handler.ts
import { parseISO8583, buildResponse } from '@/lib/iso8583';
import { settleInUSDC } from '@/lib/usdc-settlement';

export async function handleAuthorizationRequest(message: Buffer) {
  const parsed = parseISO8583(message);

  // Extract key fields from bitmap
  const { pan, amount, currency, mcc, terminalId } = parsed;

  // Route to issuer for approval
  const authResponse = await routeToIssuer({
    cardNumber: maskPAN(pan),
    amount: parseAmount(amount),
    merchantCategory: mcc
  });

  if (authResponse.approved) {
    // Queue for USDC settlement (replaces T+2 wire)
    await queueSettlement({
      type: 'ISSUER_OBLIGATION',
      amount: authResponse.settleAmount,
      chain: 'base',
      token: 'USDC'
    });
  }

  // Build ISO 8583 0110 response
  return buildResponse('0110', {
    responseCode: authResponse.approved ? '00' : '05',
    authCode: authResponse.authCode
  });
}
USDC Settlement Engine
// settlement/usdc-engine.ts
import { createPublicClient, createWalletClient, http } from 'viem';
import { base } from 'viem/chains';
import { USDC_ABI, USDC_ADDRESS } from '@/lib/contracts';

export async function settleInUSDC(params: SettlementParams) {
  const { from, to, amount, reference } = params;

  // Create settlement transaction on Base
  const txHash = await walletClient.writeContract({
    address: USDC_ADDRESS,
    abi: USDC_ABI,
    functionName: 'transfer',
    args: [to, parseUnits(amount.toString(), 6)]
  });

  // Wait for confirmation (~2 seconds on Base)
  const receipt = await publicClient.waitForTransactionReceipt({
    hash: txHash,
    confirmations: 1
  });

  // Emit settlement event for reconciliation
  await emitSettlementEvent({
    txHash,
    reference,
    settledAt: new Date(),
    blockNumber: receipt.blockNumber,
    // Compare: Traditional would be T+2 (48+ hours)
    settlementTime: 'INSTANT'
  });

  return { txHash, status: 'SETTLED' };
}
Merchant Payout Flow
// settlement/merchant-payout.ts
export async function processMerchantPayout(batch: ClearingBatch) {
  const payouts: PayoutResult[] = [];

  for (const merchant of batch.merchants) {
    // Calculate net settlement after interchange & fees
    const netAmount = calculateNetSettlement(
      merchant.grossVolume,
      merchant.interchangeFees,
      merchant.acquirerFees
    );

    // Execute USDC transfer to merchant wallet
    const result = await settleInUSDC({
      from: ACQUIRER_SETTLEMENT_WALLET,
      to: merchant.walletAddress,
      amount: netAmount,
      reference: `PAYOUT-${batch.id}-${merchant.id}`
    });

    // Webhook notification to merchant
    await sendWebhook(merchant.webhookUrl, {
      event: 'payout.completed',
      amount: netAmount,
      currency: 'USDC',
      txHash: result.txHash,
      // Traditional: "Expected in 2-3 business days"
      // Stablecoin: Already in their wallet
      availableNow: true
    });

    payouts.push(result);
  }

  return payouts;
}
GCP Infrastructure
  • Cloud Run for settlement microservices
  • AlloyDB for transaction ledger with event sourcing
  • Pub/Sub for ISO 8583 message routing
  • BigQuery for settlement analytics & reporting
  • Secret Manager for issuer/acquirer credentials
Synthetic Data & Fixtures
  • Pre-generated ISO 8583 transaction batches
  • Mock issuer/acquirer identities with test wallets
  • Merchant profiles with settlement preferences
  • Base testnet USDC faucet integration
  • Clearing file samples (batch 0500 format)

Ready to modernize settlement?

Deploy the card settlement sandbox. Test ISO 8583 flows, execute USDC settlements on Base testnet, and benchmark real-time vs T+2 performance before going live.