Overview
A high-level look at how ShredPay is wired together and where your code fits in.
Architecture at a glance
┌────────────────────┐ ┌────────────────────┐
│ Your app / │ │ AI agent (MCP) │
│ backend service │ │ Claude, OpenClaw │
└─────────┬──────────┘ └─────────┬──────────┘
│ │
│ REST X-Api-Key │ MCP X-Api-Key
│ https://agent-api... │ /mcp endpoint
▼ ▼
┌──────────────────────────────────────────────────┐
│ Agent Service (public) │
│ API key auth · spend limits · screening │
│ tx orchestration · MCP transport │
└────────┬─────────────┬───────────────┬────────────┘
│ │ │
▼ ▼ ▼
Wallet Service Screening Router contracts
(sub-wallets, Service (on-chain swap +
P-256 quorum) (OFAC, risk) DeFi, gas sponsor)Request lifecycle (write path)
When an agent calls POST /api/tx/send:
Authenticate — Agent Service resolves the
X-Api-Keyto a sub-wallet and checks the key's permissions andallowed_chains.Limit check — Daily and monthly USD spend is rolled up against the key's caps.
Screen — The
toaddress (and any beneficiaries decoded from calldata) are screened.Co-sign — Agent Service co-signs with its P-256 key; Privy signs with the user-side key (2/2 quorum).
Broadcast — The transaction is submitted to the configured RPC for the chain.
Webhook — When the tx confirms (or fails), Agent Service emits an event to your registered webhook URL.
Read-only requests (get_balance, get_positions, etc.) skip steps 2–5.
Two ways to integrate
REST (/api/*)
Backends, traditional apps, deterministic flows.
X-Api-Key header
MCP (/mcp)
LLM agents that should pick the right tool autonomously (Claude, OpenClaw, custom).
X-Api-Key header
The two surfaces are equivalent — every MCP tool maps 1:1 to a REST endpoint.
What you need before building
A ShredPay account — sign up at shredpay.xyz.
Open the Agent Console at console.shredpay.xyz and create a sub-wallet.
Issue an API key with the limits and chains you want to allow.
Fund the sub-wallet (USDC + a small ETH balance, or use the gas swap flow).
You're ready. Continue to Authentication.
Last updated