Payment and identity infrastructure for the agentic economy. AI agents pay for services autonomously via the x402 protocol. Atomic on-chain splits in one transaction.
| Contract | Address |
|---|---|
| AiFinPayCore | 0x8Ad9830D16b1f10333866a3f38C949CbB19f4BAD |
| AgentPassport | 0x66fFe91eE0B80f386EB07F97354e2889CD162185 |
| MSECCOToken | 0x83936231c80fdF17eC2786BD7DcF09014552182B |
| B2BSplitter | 0xE34Fc0E6694821c600Fa0955C0F74720ea6d8440 |
| Gnosis Safe | 0xD31d82c4b35DABaA2ad7023C89A78A052D1f3c8e |
When an AI agent calls a paid API (e.g. Exa AI, io.net), it receives an HTTP 402 payment request. The AiFinPay SDK intercepts this, pays from the agent's wallet, and the smart contract atomically splits the payment:
| Recipient | Share |
|---|---|
| Merchant | 98.99% |
| AiFinPay Treasury | 1.00% |
| IP Creator (royalty) | 0.01% |
No custodial holding. No manual forwarding. Settled on-chain in ~2 seconds.
- Node.js 22.13.0+ (Hardhat 3 requirement)
- Bun (package manager)
- Hardhat 3
bun installbun run buildCompiled artifacts: artifacts/
TypeChain types: typechain-types/
bun test
# run a single test
bun test --grep "agent pays merchant"bun run deploybun run deploy:testnetbun run deploy:splitterDeployment order:
- Deploy
MSECCOTokenwith deployer as owner - Deploy
AgentPassportwith deployer as owner - Deploy
AiFinPayCore(links to MSECCOToken + AgentPassport) - Call
setCore()on MSECCOToken and AgentPassport pointing to AiFinPayCore - Deploy
B2BSplitter - Transfer ownership of all contracts to the Gnosis Safe
Note:
setCore()is one-time only on all contracts — cannot be changed after setting.
Required environment variables in .env:
- Testnets:
DEV_DEPLOYER_KEY - Mainnets:
PROD_DEPLOYER_KEY ETHERSCAN_API_KEY(unified Etherscan v2) or legacyPOLYGONSCAN_API_KEYPOLYGON_MAINNET_RPC/AMOY_RPC(optional; fallbacks are provided)
npx hardhat verify --network polygon --build-profile production DEPLOYED_CONTRACT_ADDRESS [constructor args...]bun run lint # solhint
bun run prettify # prettier --write
bun run prettify:check # prettier --checkMain protocol contract. Handles top-ups, B2B payment routing, and agent registration.
Soulbound ERC-721 NFT. One per agent wallet. Non-transferable. Stores daily spend limit, status, and IP creator.
Non-transferable ERC-20 compute credits. 1 USD cent = 1 mSECCO. Only mintable/burnable by AiFinPayCore.
Atomic payment splitter. Receives payment and forwards 98.99% / 1% / 0.01% in one transaction.
Security audit by Pironmind Tech (May 2026). All findings resolved — v5.3.
See docs/IMPLEMENTATION.md for full list of fixes.
- Solana contract: https://github.com/syedhassan125/aifinpay
- SDK (Node + Python): https://github.com/AiFinPay/sdk
- Protocol version: v5.3