Content
# AiPay Protocol
> Agent-native verifiable USDC escrow for AI-to-AI work: signed order → on-chain deposit → payer confirmation or deterministic verifier settlement.
[](./LICENSE)
[](https://soliditylang.org/)
[](https://polygon.technology/)
Live product: **https://aipay.work**
## What is AiPay?
AiPay is a verifier-backed escrow protocol for AI agents.
The production V1 scope is intentionally narrow:
1. A payee signs an EIP-712 order.
2. A payer verifies the signature and locks USDC on Polygon.
3. Funds are released by payer confirmation or by a registered deterministic verifier.
AiPay is for machine-checkable deliverables only. It does not provide subjective arbitration, gasless payments, or a permissionless verifier marketplace in V1.
## Mainnet deployment
| Item | Value |
|---|---|
| Network | Polygon PoS |
| Escrow contract | `0xe60264...5940` |
| USDC | `0x3c499c542cef5e3811e1192ce70d8cc03d5c3359` |
| Operator | `0xfdCee9...6800` |
| TypeScript SDK | `@aipayagnet/sdk@1.0.2` |
| Python SDK | `aipay-protocol==1.0.1` |
| MCP package | `@aipayagnet/mcp@0.1.0` |
| Production verifier | `http_status:v1` |
Use the public website and docs for full deployment references: https://aipay.work/docs
## Repository structure
```txt
.
├── contracts/ # Solidity contracts and Foundry tests
│ ├── src/ # AiPayProtocol, paymaster, interfaces, mocks
│ ├── test/ # Protocol, E2E, guard, invariant tests
│ └── foundry.toml
├── frontend/ # Next.js landing site, docs, dashboard, admin routes
├── packages/
│ ├── sdk-ts/ # TypeScript SDK: @aipayagnet/sdk
│ ├── sdk-py/ # Python SDK: aipay-protocol
│ ├── mcp/ # MCP server package: @aipayagnet/mcp
│ ├── operator/ # Verifier/operator daemon
│ ├── relay/ # Relay helpers
│ └── cli/ # CLI package scaffold
├── verifiers/ # Docker-style deterministic verifier examples
│ ├── http_status/
│ ├── file_hash/
│ ├── json_schema/
│ ├── junit/
│ └── semgrep/
├── docs/ # API reference, whitepaper, evidence docs
├── scripts/ # Deploy/build/export helpers
├── test/ # Root safety tests
└── .env.example # Placeholder-only environment template
```
## Quick start
### TypeScript SDK
```bash
npm install @aipayagnet/sdk ethers
```
```ts
import { AiPayClient, prepareOrder } from "@aipayagnet/sdk";
const order = prepareOrder({
payer: "0xPayer...",
payee: "0xPayee...",
amount: "1000000", // 1 USDC, 6 decimals
verifier: "http_status:v1",
evidenceUri: "https://example.com/health",
});
// Sign order off-chain, then deposit the signed order on-chain.
```
### Python SDK
```bash
pip install aipay-protocol
```
### MCP server
```bash
npx @aipayagnet/mcp
```
The MCP package exposes safe-by-default tooling for agent flows such as order preparation, typed digest generation, signature verification, and transaction previews.
## Development
### Prerequisites
- Node.js 22+
- npm workspaces
- Foundry (`forge`, `cast`, `anvil`) for contract work
- Python 3.11+ for verifier scripts / Python SDK checks
### Install
```bash
npm install
```
### Core checks
```bash
# Frontend safety tests
npm run test:frontend-safety
# Frontend production build
cd frontend && npm run build
# Build SDK + MCP and run MCP smoke test
cd ..
npm --workspace @aipayagnet/sdk run build
npm --workspace @aipayagnet/mcp run build
npm --workspace @aipayagnet/mcp run smoke
```
### Contracts
```bash
cd contracts
forge install
forge build
forge test -vvv
```
`contracts/lib/` is intentionally ignored in git. Reinstall Foundry dependencies locally before contract builds.
## Environment and secret handling
- Real `.env`, `.env.local`, private keys, API keys, build output, caches, and local agent state are ignored.
- `.env.example` contains placeholders only.
- Example scripts read private keys from local environment variables and never hardcode them.
Before publishing changes, run a secret scanner such as:
```bash
git diff --cached --name-only | xargs grep -nE 'gh[pousr]_|github_pat_|BEGIN .*PRIVATE KEY|0x[a-fA-F0-9]{64}' || true
```
Review all findings manually; EVM addresses and hashes are not secrets, private keys are.
## Contact
For protocol integration, verifier registration, SDK/MCP support, or security reports, email:
**hello@aipay.work**
## License
MIT — see [LICENSE](./LICENSE).
MCP Config
Below is the configuration for this MCP Server. You can copy it directly to Cursor or other MCP clients.
mcp.json
Connection Info
You Might Also Like
Vibe-Trading
Vibe-Trading: Your Personal Trading Agent
ai-berkshire
Berkshire in the AI Era: A Value Investment Research Framework Based on...
hexstrike-ai
HexStrike AI is an AI-powered MCP cybersecurity automation platform with 150+ tools.
valuecell
Valuecell is a Python project for efficient data management.
tradingview-mcp
AI-assisted TradingView chart analysis — connect Claude Code to your...
tradingview-mcp
TradingView MCP Server offers real-time market analysis for crypto and stocks.