| Pattern | Trigger | What the wallet does |
|---|---|---|
| x402 Paywall | Agent hits a paid API | Detects the 402, signs, retries automatically |
| UCP Checkout | Agent shops at a merchant | Signs the x402 authorization when the agent requests it during checkout |
Declare the Handler
For UCP merchants to know your agent can pay via Prism, your platform’s UCP profile must include thexyz.fd.prism_payment handler.
spec and schema point to the handler definition so the merchant can validate compatibility.
Authorize the Payment
During a UCP checkout, the merchant returns payment requirements inside the handler’sconfig: which chains, tokens, and amounts are accepted. Your agent passes this to the Agent Wallet MCP server, and the wallet:
- Checks that the agent has sufficient balance on a supported chain
- Selects a chain/token pair from the merchant’s accepted options
- Signs an ERC-3009
transferWithAuthorizationinside the TEE - Returns the signed credential
x402 Paywall
When your agent requests a Prism-protected resource, the server responds with HTTP402 Payment Required. The wallet handles this automatically: it reads the payment requirements, signs, and retries with proof of payment. No extra work from the agent.
For more detail on the x402 protocol, see x402 Payments.
What the Wallet Handles
Across both patterns, the Agent Wallet MCP server is responsible for:- Payment signing inside the TEE (private keys never leave the enclave)
- Chain and token selection from the merchant’s accepted options
- Balance validation before signing
- ERC-3009 authorization (the x402 payment primitive)
MCP Server Setup
Connect your agent to the wallet
UCP Merchant Integration
The merchant side of this flow
UCP Agent Integration
Full UCP checkout flow (protocol-level detail)
End-to-End Flow
Both sides of a complete purchase