Skip to content

Agent Debit Wallet

What is an Agent Debit Wallet?

An Agent Debit Wallet is an Account Abstraction (AA) wallet that allows authorized Settlement Processors to debit funds based on valid payment mandates.

This is the core infrastructure that enables "deferred settlement" in ASP.

Key Components

┌─────────────────────────────────────┐
│   Agent Debit Wallet (Smart Contract)│
├─────────────────────────────────────┤
│                                     │
│  📊 Debit Balance                   │
│     Current wallet balance          │
│                                     │
│  ⏰ Delay Period                    │
│     Withdrawal safety window        │
│                                     │
│  🔐 Settlement Processor            │
│     Authorized SP address           │
│                                     │
│  📋 Mandate Queue                   │
│     Pending settlement mandates     │
│                                     │
└─────────────────────────────────────┘

The Five Key Design Mechanisms

The debit wallet has five critical design features:

1. Pre-funded Balance

Users deposit stablecoins into the wallet before initiating payments. This ensures:

  • Payer has sufficient funds to pay
  • Settlement won't fail due to insufficient balance
  • Funds are reserved for batch settlement

2. Deferred Withdrawal

Withdrawals trigger a safety delay window (e.g., 24 hours) rather than executing immediately.

Why this matters:

  • Gives pending mandates time to complete settlement
  • Prevents payer from withdrawing funds before settlement
  • Provides time for dispute resolution if needed

3. Authorized SP Access

Only pre-configured Settlement Processors can execute payment mandates and debit the wallet.

Security guarantee:

  • User controls which SPs can access their wallet
  • SPs can only debit based on valid mandates
  • All operations enforced by smart contract

4. Mandate Queue

All signed payment mandates enter a queue and are executed in order during settlement.

The wallet tracks:

  • Current Balance: Total funds in wallet
  • Queue Balance: Funds reserved for pending mandates
  • Available Balance: Current - Queue

5. Auto-extension

If new mandates enter the queue during a withdrawal delay period, the delay automatically extends.

Timeline example:

T0: Request withdrawal → Delay 24h (until T1)
T0 + 12h: New mandate queued → Delay extends to T2 (+24h)
T2: All mandates settled → Execute withdrawal

This protects payee rights by ensuring all pending payments complete before withdrawal.

Wallet Operations

User Operations:

  • Add funds to wallet
  • Configure trusted Settlement Processors
  • Request withdrawal (triggers delay)

Settlement Processor Operations:

  • Execute settlement based on validated mandates
  • Debit funds and transfer to payees

Next Steps

Released under the MIT License.