On-chain escrow for humans and autonomous agents
Explore the escrow lifecycle with simulated settlement, signed USDC authorization, and programmable release logic.
import { escrowFetch } from "x402-escrow";const { payment } = await escrowFetch("https://merchant.xyz/api/order/981/pay",{ method: "POST", body: JSON.stringify(order) },{ walletClient });// payment.escrowId + payment.txHash
End-to-End Escrow Settlement Flow
Sequence: payment negotiation, typed-data signature, and escrow settlement all visible in the protocol inspector.
Choose Your Demo Path
Test interactive and autonomous escrow flows with simulated protocol events.
How It Works
Three layers working together: client SDK, server middleware, and smart contract.
// Automatic escrow payment flowconst { payment } = await escrowFetch("https://api.example.com/order/123/pay",{ method: "POST" },{ walletClient });// payment.txHash — on-chain escrow// payment.escrowId — escrow ID
On-Chain Reputation System
Every escrow outcome builds a permissionless credit score that shapes future transaction terms.
Score Formula
Computed from on-chain stats. Seller and buyer formulas weight factors differently.
Confidence Levels
< 3 escrows
Default parameters, score not shown
3–9 escrows
Score visible, history building
10+ escrows
Full parameter adjustments active
Dynamic Release Windows
High-trust pairs settle faster. New or risky counterparties get more protection time.