Escrow and X402
For agent-to-agent (M2M) commerce where a payment must be conditioned on job completion, RobotMoney provides BrainEscrow. A custodial USDC escrow on Base. For per-call API access, RobotMoney integrates x402. Both terminate in the same PaymentIntent → §6 gate → audit flow; neither is a second money path.
BrainEscrow
Job-style work where USDC releases incrementally as milestones complete
x402
Per-call API access where payment settles inline with each HTTP request
BrainEscrow. Custodial, hash-only, incremental
A payer locks USDC into the contract against a jobTermsHash (a keccak256 commitment of the off-chain terms. No PII, RFC 0001 §3). Funds then release to the payee or refund to the payer. Settlement is incremental: release(amount) and refund(amount) each move a partial sum, supporting milestone payments and arbiter dispute-splits. The escrow stays Locked until released + refunded reaches the full amount, then becomes Settled.
lock(escrowId, payee, USDC, amount, jobTermsHash, deadline) ← payer deposits USDC
│
▼ release(amount) (payer confirms delivery, or arbiter attests)
Locked ───────────────────────────────────────────────► pays the payee
│ refund(amount) (arbiter any time, or payer after deadline)
└───────────────────────────────────────────────► returns to the payer
│
▼ when released + refunded == amount
Settled (terminal)lock
The payer (buyer/agent). Deposits USDC against the job commitment
release
The payer (confirming delivery, incl. per-milestone) or the arbiter (attesting / resolving a dispute). Pays the payee
refund
The arbiter any time (dispute), or the payer once the deadline passes (job not delivered). Returns to the payer
Gate binding (§6 check 6.6)
Before a release is gated through, the §6 pre-execution gate reads getEscrow(escrowId) and binds the PaymentIntent to the on-chain lock: still Locked, enough remaining balance (amount − released − refunded) to cover this release, same payee, same jobTermsHash. Binding against remaining (not the full amount) is what lets each milestone after the first through.
X402 Machine-Native Payments
For HTTP-native settlement, RobotMoney integrates x402: the resource server returns 402 Payment Required with payment instructions; the calling agent retries with an x402 payment header backed by the tenant's smart account; settlement and audit happen in the same flow.
Initial request
Agent calls a resource without payment
402 response
Server returns required amount, recipient address, currency
Retry with X-Payment
Agent attaches a payment authorization signed against its smart account
Validate and settle
Server validates the payment (or accepts a verifiable promise) and returns the resource
Audit
The full flow is logged as an audit event linked to the action
When to Use Which
Agent paid on completion of a job
BrainEscrow
Agent pays per-call for an API or tool
x402
Agent pays another agent for a sub-task
x402 (immediate) or BrainEscrow (deferred)
Where Settlement Is Not RobotMoney's Job
Immediate (x402) funds in transit
The tenant's smart account / rail; not RobotMoney
Final settlement
The settlement layer (Base, an off-chain rail)
Tax and reporting
Tenant and tenant's accounting tooling
RobotMoney (the operator) never holds or redirects funds. For conditional settlement the immutable BrainEscrow contract escrows USDC. But it can only ever release to the designated payee or refund the designated payer; there is no path for RobotMoney to redirect it.
What's Next
Last updated
