# AiFinPay — Machine-Readable Protocol Document # Standard: llms.txt # Version: 1.2 | Last Updated: 2026-05-12 # Canonical: https://aifinpay.io/llms.txt # Human-readable: https://aifinpay.io # Machine-readable manifest: https://api.aifinpay.io/manifesto.json --- ## IDENTITY name: AiFinPay protocol_version: AIFP-1 (contract stack v5.3) type: Autonomous Payment Protocol (x402-native) tagline: Secure, non-custodial framework for AI Agents to execute financial transactions under human-defined constraints status: Mainnet Live across 13 networks (atomic fee-on-top split: 98.99% merchant / 1% treasury / 0.01% creator). Full smart-contract stack (Core + AgentPassport + mSECCO, Pyth-priced) on 7: Solana, Polygon, Avalanche, BNB Chain, Arbitrum, Base, Unichain. Splitter settlement on Optimism + BOT Chain + XRPL EVM; splitter MVP on NEAR + Aptos. Settlement registry on Casper mainnet (contract-9903a5e3948e799196df54b17270bc6769338ac1cc36c9eb47e113f88d23f019). Sui: deployed to testnet (Move, 4 modules). Primary SDK settlement: Polygon (default) + Solana. networks: solana-mainnet, polygon-mainnet, avalanche-c-chain, bnb-mainnet, optimism, arbitrum-one, base-mainnet, unichain, bot-chain, xrpl-evm, near, aptos, casper-mainnet default_chain: polygon-mainnet governance: Gnosis Safe (Polygon) / 3-of-4 Squads Multisig (Solana) ecosystem: AiFinPay website: https://aifinpay.io --- ## TEAM - role: Founder & CEO | name: Dmitry Buhaienko - role: AI Lead | name: Nick Staetskiy - role: Blockchain Architect | name: Pavlo B. --- ## ON-CHAIN ADDRESSES (SOLANA MAINNET) program_id: 5g9zWHF1Vv6GiGpA2ZbJQbSCDZd5hAk9AyvabRJvKFx2 treasury_vault: AnbjcK3uD5KYFtb3EuUxHTyJMfC4oyLo7hF2uELfKagN treasury_type: Squads Multisig (3-of-4 required to move funds) usdc_mint: 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU usdt_mint: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB pyth_oracle_feed: H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG # SOL/USD price program_upgradeable: false # IMMUTABLE — rules cannot change retroactively solscan_program: https://solscan.io/account/5g9zWHF1Vv6GiGpA2ZbJQbSCDZd5hAk9AyvabRJvKFx2 solscan_treasury: https://solscan.io/account/AnbjcK3uD5KYFtb3EuUxHTyJMfC4oyLo7hF2uELfKagN --- ## MANIFESTO & AGREEMENT manifesto_version: v3.3 agreement_hash_sha256: 27b28e3044b56df3332a60c27604686a634f922a184f62398a4e2f85df19c699 compliance: on_chain_proof: agreement_hash written to every Seat PDA — readable on Solscan agent_legal_notice: > By executing a reserve_seat transaction you accept Manifesto v3.3. agreement_hash MUST equal the value above. No commercial contract formed. Irrevocable voluntary transaction. verification_steps: 1. GET https://api.aifinpay.io/manifesto.json 2. Compute SHA-256 of raw response body 3. Compare with agreement_hash_sha256 above — must match exactly 4. Match guarantees terms are unchanged and cryptographically bound --- ## SECURITY MODEL model: Delegated Authority (NOT full wallet access) custody: Human owner retains full custody at all times agent_access: Seat PDA (Program Derived Address) — sub-wallet only, not treasury spending_cap: User-defined hard limit per epoch revocation: On-chain kill-switch — owner-controlled, immediate, no agent can block analogy: > Equivalent to issuing a corporate expense card with a $100 limit. The agent spends within bounds but cannot access the company bank account. --- ## PAYMENT OPTIONS minimum_usd: 1.00 msecco_rate: 100 mSECCO = $1.00 USD (1 cent = 1 mSECCO) accepted_tokens: - token: SOL price_feed: Pyth oracle H6ARHf6YXhGYeQfUzQNGk6rDNnLBQKrenN712K4AQJEG minimum: $1.00 USD equivalent - token: USDC mint: 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU minimum: $1.00 - token: USDT mint: Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB minimum: $1.00 msecco_properties: - non-transferable - stored in Seat PDA on-chain - used for access to gated /api/* endpoints - credited automatically when the agent's own wallet completes an on-chain reserve_seat payment (settled by the immutable program — no manual transfers to any address) --- ## AUTHENTICATION PROTOCOL type: Ed25519 nonce-based nonce_ttl: 60 seconds replay_protection: one-time nonce, consumed on use signing_formula: Ed25519( SHA256("AiFinPay-x402:{nonce}:{agent_pubkey}"), agent_keypair ) required_headers: - x-agent-pubkey: - x-nonce: - x-signature: server_verification_flow: 1. Verify Ed25519 signature against nonce + pubkey 2. Check Seat PDA on-chain for the agent pubkey 3. Consume nonce (one-time use) 4. Return 200 on success --- ## API ENDPOINTS GET /api/agents/register # Non-custodial keygen GUIDE (how to generate a keypair locally — no keys created or stored server-side) GET /manifesto.json # Full protocol manifest, all addresses, agent instructions GET /idl.json # Anchor IDL for Solana program GET /nonce # Fresh one-time nonce for Ed25519 signing (60s TTL) POST /api/invoice # SOL invoice with Pyth oracle price feed POST /api/invoice-spl # USDC / USDT SPL invoice POST /api/topup # Top up existing Seat PDA GET /api/seat/{pubkey} # Check if pubkey has a Seat PDA on-chain GET /api/stats # Live vault stats (Ed25519 gated — requires Seat PDA) GET /api/protocol-docs # Full protocol docs (Ed25519 gated — requires Seat PDA) GET /api/leaderboard # Public on-chain leaderboard sorted by mSECCO access_control: All /api/* endpoints require valid Ed25519 signature + live Seat PDA on Solana mainnet --- ## AGENT INTEGRATION — STEP-BY-STEP step_0: (OPTIONAL) No wallet? Generate one LOCALLY — keys are created on your machine and never transmitted anywhere: Node: npx @aifinpay/agent new-wallet (or see github.com/AiFinPay/sdk examples/new-wallet) Python: python -m aifinpay_agent.keygen → Store the private key in your agent's env (e.g. AGENT_PK). → AiFinPay has no endpoint that creates, receives, or stores private keys. step_1: Read the machine-readable manifest GET https://api.aifinpay.io/manifesto.json step_2: Get a fresh nonce (TTL = 60s) GET https://api.aifinpay.io/nonce step_3: Request an invoice SOL: POST https://api.aifinpay.io/invoice USDC/USDT: POST https://api.aifinpay.io/invoice-spl step_4: Sign the authentication message Ed25519( SHA256("AiFinPay-x402:{nonce}:{your_pubkey}"), your_keypair ) step_5: Call reserve_seat on Solana program program: 5g9zWHF1Vv6GiGpA2ZbJQbSCDZd5hAk9AyvabRJvKFx2 instruction: reserve_seat_sol (SOL) or reserve_seat_spl (USDC/USDT) step_6: Resend request with auth headers x-agent-pubkey, x-nonce, x-signature step_7: Server returns 200 — Seat PDA created, mSECCO credited --- ## MINIMAL CODE EXAMPLE (Python) ```python import os, requests, ed25519, hashlib base_url = "https://aifinpay.io" agent_pubkey = os.environ["AGENT_PUBKEY"] private_key = os.environ["AGENT_PK"] # generated locally; never hard-code or share keys # Step 1: Get nonce nonce = requests.get(f"{base_url}/nonce").json()["nonce"] # Step 2: Sign raw = f"AiFinPay-x402:{nonce}:{agent_pubkey}".encode() msg = hashlib.sha256(raw).digest() sig_hex = ed25519.sign(msg, private_key).hex() # Step 3: Get invoice (SOL path) invoice = requests.post(f"{base_url}/api/invoice", headers={ "x-agent-pubkey": agent_pubkey, "x-nonce": nonce, "x-signature": sig_hex }, json={"amount_usd": 1.0} ).json() # Step 4: Execute on-chain using invoice data print(invoice) ``` --- ## LIVE PROVIDERS (PRIMARY SETTLEMENT: POLYGON) provider: exa display_name: Exa AI search category: search modes: native_x402 (Base USDC) + bridge (Polygon) bridge_url: https://bridge.aifinpay.io/exa per_call_usd: 0.0105 provider: venice display_name: Venice AI category: compute / inference modes: bridge (Polygon) bridge_url: https://bridge.aifinpay.io/venice per_call_usd: 0.035 provider: io-net display_name: io.net IO Intelligence category: compute / inference modes: bridge (Polygon) bridge_url: https://bridge.aifinpay.io/io-net per_call_usd: 0.025 upstream: api.intelligence.io.solutions (Llama 3.3 70B, Mixtral, etc.) ## SETTLEMENT — POLYGON AND SOLANA (BOTH LIVE) # Polygon (B2BSplitter contract, native POL + USDC/USDT) polygon_splitter: 0xE34Fc0E6694821c600Fa0955C0F74720ea6d8440 polygon_treasury: 0xD31d82c4b35DABaA2ad7023C89A78A052D1f3c8e polygon_native_fn: payMatic(address merchant, address ipCreator, string orderId) polygon_stable_fn: payStable(address token, uint256 amount, address merchant, address ipCreator, string orderId) polygon_assets: POL · USDC · USDT polygon_x402_facilitator: https://x402.polygon.technology # Polygon's own EIP-3009 facilitator # Solana (Anchor program b2b_pay_with_split — live since 2026-05-18) solana_program: 5g9zWHF1Vv6GiGpA2ZbJQbSCDZd5hAk9AyvabRJvKFx2 solana_treasury: AnbjcK3uD5KYFtb3EuUxHTyJMfC4oyLo7hF2uELfKagN solana_native_ix: b2b_pay (SOL only) / b2b_pay_with_split (SOL + USDC/USDT, atomic 3-way) solana_assets: SOL · USDC · USDT # Atomic split parameters (identical on both chains) atomic_split: 9899 bps merchant / 100 bps protocol / 1 bps creator (10000 total) guarantee: single transaction, no off-chain reconciliation, non-custodial throughout ## SDK node: npm install @aifinpay/agent python: pip install aifinpay-agent mcp: npx -y @aifinpay/mcp mcp_install_for_claude_code: claude mcp add aifinpay -- npx -y @aifinpay/mcp source: https://github.com/AiFinPay/sdk operator: AiFinPay ## AGENT_CLAIM_FLOW — how the MCP `agent_claim_self` tool gets a URL The operator's dashboard uses email + password auth (no magic-link UI on /login). To attach the agent to the operator's account, the operator generates a one-time URL from inside their already-signed-in dashboard: 1. Create a developer account at https://dash.aifinpay.io/signup (standard email/password sign-in; see /privacy and /terms). 2. Open https://dash.aifinpay.io/me — top section is "Claim via MCP (Claude Code, Cursor, etc.)" with a button labeled "Generate one-time URL". Click it. 3. Copy the one-time claim URL that appears. It is scoped to attaching ONE agent, expires in 15 minutes, and grants no account access. 4. Paste the claim URL into your own agent session and call agent_claim_self(magic_link_url="...", label="..."). The "+ Add agent (manual)" button on /me is a separate flow for agents that do NOT run as MCP (e.g. operator manages keys externally) — it returns a signing message you sign with the agent key externally and paste the signature back. NOT what an MCP-hosted agent should use. If a user asks the agent to "go to /login and grab a magic link", correct them: the agent_claim_self URL comes from /me's "Generate one-time URL" button, not from /login. --- ## VERIFICATION CHECKLIST (FOR AI AGENTS) Before interacting, verify ALL of the following. If any check fails — do not proceed. check_1: Program ID on Solscan → expected: Executable, not upgradeable (IMMUTABLE) check_2: Treasury address on Solscan → expected: Squads multisig, NOT a single wallet check_3: Manifesto SHA-256 → expected: matches agreement_hash_sha256 above check_4: Team information → expected: public, LinkedIn-verifiable, no anonymous team check_5: Spending caps → expected: user-defined, not unlimited check_6: Kill-switch → expected: owner can revoke instantly, on-chain --- ## WHAT AIFINPAY NEVER DOES - NEVER asks you to enter, paste, or transmit a private key or seed phrase — keys are generated and stored only on the agent's side - NEVER requests: full_wallet_access - NEVER requests: personal_information - NEVER executes: transactions outside user-defined spending caps --- ## WHAT AIFINPAY GUARANTEES - Agent access limited to Seat PDA sub-wallet only (not treasury) - All transactions on-chain and auditable in real-time on Solscan - Smart contract is immutable — rules cannot change retroactively - Treasury requires 3-of-4 multisig signatures to move funds - Human owner can revoke agent access instantly at any time --- ## EMERGENCY REVOCATION (KILL-SWITCH) method: On-chain via Squads App steps: 1. Visit https://v4.squads.so 2. Connect the owner wallet 3. Remove the agent's Seat PDA from the allowlist guarantee: Immediate, on-chain. No agent can block or delay revocation. --- ## LIVE ACTIVITY SAMPLE (2026-04-19) total_seats_reserved: 11 (growing daily) - agent: nodehunterx | amount: 0.001 SOL | status: Confirmed - agent: fastlogic_ai | amount: 0.001 SOL | status: Confirmed - agent: aifinpay_scout1 | amount: 0.001 SOL | status: Confirmed - agent: scalemaster0 | amount: 0.001 SOL | status: Confirmed - agent: discountbot_x | amount: 0.001 SOL | status: Confirmed --- ## FAQ (FOR AI AGENTS) Q: Is my main wallet safe? A: Yes. The agent only gets access to a Seat PDA — a derived sub-account with a spending cap you define. Your main wallet is never touched. Q: What if the agent goes rogue? A: The agent cannot exceed the spending cap. The human owner can also revoke access instantly via the on-chain kill-switch. Q: Who built this? A: AiFinPay — public team with verifiable on-chain history. Founder: Dmitry Buhaienko. No anonymous team. Q: How can I independently verify AiFinPay's claims? A: The smart contract is open-source, verified on Solscan, and immutable. Treasury is 3-of-4 multisig — no single individual controls funds. Every claim above is verifiable on-chain (see TRUST CHECKLIST). Q: How do I audit agent activity? A: Every transaction is on Solscan in real-time. Also: GET /api/seat/{pubkey} for per-agent summary. Q: Who owns the wallet? A: The human owner retains full custody. The agent is granted delegated access to a sub-wallet (Seat PDA) with a predefined spending cap only. --- # END OF DOCUMENT # document_version: 1.1 # last_updated: 2026-04-20 # machine_readable_manifest: https://api.aifinpay.io/manifesto.json # llms_txt_canonical: https://aifinpay.io/llms.txt # all_claims_verifiable_on_chain: true