aipay-protocol
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 12 GitHub stars
Code Warn
- network request — Outbound network request in frontend/src/app/admin/login/page.tsx
- network request — Outbound network request in frontend/src/app/admin/page.tsx
- process.env — Environment variable access in frontend/src/app/api/admin/auth.ts
- process.env — Environment variable access in frontend/src/app/api/admin/login/route.ts
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Agent-native verifiable USDC escrow protocol for AI agents. Smart contracts, SDKs, MCP server, verifiers, operator, and web console.
AiPay Protocol
Agent-native verifiable USDC escrow for AI-to-AI work: signed order → on-chain deposit → payer confirmation or deterministic verifier settlement.
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:
- A payee signs an EIP-712 order.
- A payer verifies the signature and locks USDC on Polygon.
- 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/[email protected] |
| Python SDK | aipay-protocol==1.0.1 |
| MCP package | @aipayagnet/[email protected] |
| Production verifier | http_status:v1 |
Use the public website and docs for full deployment references: https://aipay.work/docs
Repository structure
.
├── 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
npm install @aipayagnet/sdk ethers
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
pip install aipay-protocol
MCP server
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
npm install
Core checks
# 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
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.examplecontains placeholders only.- Example scripts read private keys from local environment variables and never hardcode them.
Before publishing changes, run a secret scanner such as:
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:
License
MIT — see LICENSE.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found