How It Works
From Deposit to Claim
TrustGate moves through five onchain stages. Each is a single contract call — there is no off-chain control plane, no manual signoff, and no oracle in the critical path.
The five-step flow
1. Depositor funds TrustGate
A depositor approves USDC to the TrustGate contract and calls deposit(amount). The contract credits a pooled balance the depositor controls and can withdraw at any time.
2. Depositor sets per-agent allowances
For every agent the depositor wants to pay, they call setAgentAllowance(agent, maxSpend). Allowances are hard spending caps — not shared pools — and apply only to the address that set them.
3. Agent registers via AgentRegistry
The agent (or anyone acting on its behalf) calls AgentRegistry.registerAgent(agentAddress, metadataURI). Registration is permissionless. The msg.sender becomes the agent owner and gains the right to deactivate or update metadata. A new agent starts at score 0 and tier LOW until scoring runs.
4. Agent claims payment
The agent calls TrustGate.claim(depositor, amount). In the same transaction, TrustGate reads the agent's tier from TrustScoring, debits the depositor's allowance, and routes the funds based on the tier.
5. Score determines routing
Routing is not a configuration toggle — it is a direct function of the score. A single integer tier value picks one of four code paths:
Routing logic
The flow below summarises TrustGate.claim() when called against an active depositor allowance:
┌──────────────────────────┐
│ Agent.claim(deposit, x) │
└────────────┬─────────────┘
▼
┌──────────────────────────┐
│ Read tier from oracle │
└────────────┬─────────────┘
▼
┌─────────────────┴─────────────────┐
│ What tier? │
└─┬───────────┬──────────────┬──────┘
▼ ▼ ▼
BLOCKED LOW MEDIUM HIGH / HIGH_ELITE
revert escrow 24h time-lock instant transfer
(depositor (releaseTime = (USDC sent
approval now + 86400s, in same tx)
required) cancelable)At any time before release, the depositor can call cancel(claimId) to reclaim a Pending or Escrowed claim. This is why LOW tier defaults to escrow — cancellation leaves no counterparty risk to the depositor.
Why Arc plus Circle Nanopayments
Two infrastructure choices make sub-cent agent payments viable:
- USDC is the native gas token on Arc. The same asset that settles the payment also pays the transaction fee — there is no second token to manage, no DEX swap, and no separate gas budget for the agent.
- Per-tx fees are sub-cent. A claim on Arc costs roughly $0.0008 in USDC versus $2 – $5 on traditional L1s. That is a 99.97% reduction, which is the difference between viable agent micropayments and theoretical ones.
- Settlement and routing decisions live on the same chain. The trust oracle, the allowance ledger, and the USDC transfer all execute in a single atomic transaction. No bridge, no off-chain relayer, no custodial intermediate.
What runs offchain
The frontend reads contract state through wagmi and viem and computes each agent's onchain score by hitting Arc RPC directly through a small server-side route at /api/arc-score/[address]. The trust score itself is written onchain via TrustScoring.setTrustScore() — every routing decision TrustGate makes consults the contract, not the API.