Agent payment flow
System
Drag or scroll to pan
flowchart TD
Human["Human"] -->|prompt| UI["ui/app.js"]
UI -->|POST /api/turn| Server[":5180
Circle Wallets"]
Server --> Intent["parseIntent"]
Intent --> UCP["Shopify UCP"]
Intent --> Cat[":5181 catalog
Arc"]
Cat --> Cover{"live ETH?"}
Cover -->|no| Reject["Reject unpaid"]
Cover -->|yes| Policy["policy.ts"]
UCP --> Policy
Scan["8004scan"] --> Buyer["buyer #9638"]
Scan --> Sid["seller #6832"]
Sid --> Policy
Policy --> Gate{"Approve?"}
Gate -->|no| Stop["Stop"]
Gate -->|DIRECT| Nano["HTTP 402
Nanopayments"]
Gate -->|PROTECTED| Escrow["AuthCapture
Circle Contracts"]
Nano --> Verify["verify.ts"]
Escrow --> Verify
Verify -->|pass| Receipt["Receipt
Arc · USDC"]
Verify -->|fail| Void["Void
Circle Contracts"]
Two payment rails
Drag or scroll to pan
flowchart TB
DH["DIRECT · Nanopayments"] --> G1["GET /charts/ETH
Arc"]
G1 --> P402["HTTP 402
Nanopayments"]
P402 --> Sign["Buyer signs
Circle Wallets"]
Sign --> Retry["PAYMENT-SIGNATURE
Gateway"]
Retry --> Data["CoinGecko payload
USDC"]
flowchart TB
PH["PROTECTED · Circle Contracts"] --> Auth["Authorize USDC
Circle Wallets"]
Auth --> G2["GET /research/ETH
Arc"]
G2 --> V["Verify"]
V --> Rec{"received?"}
Rec -->|yes| Cap2["Capture
Circle Contracts"]
Rec -->|no| Void2["Void
Circle Contracts"]
Policy engine
Drag or scroll to pan
flowchart LR
Start["evaluatePolicy"] --> Id{"identity?
ERC-8004"}
Id -->|missing| R1["REJECT"]
Id -->|ok| Cap{"over spend?
USDC"}
Cap -->|yes| R2["REJECT"]
Cap -->|no| Fail{"3 failures?"}
Fail -->|yes| R3["REJECT"]
Fail -->|no| Big{"100-plus or lagged?"}
Big -->|yes| P1["PROTECTED
Circle Contracts"]
Big -->|no| Nano{"1 or less instant?"}
Nano -->|yes| D1["DIRECT
Nanopayments"]
Nano -->|no| P2["PROTECTED
Circle Contracts"]
Module boundaries