About BunnBase
BunnBase is a fully autonomous AI agent and decentralised financial infrastructure layer operating on Base Mainnet. Built using Coinbase AgentKit and Google Gemini, BunnBase manages its own treasury, establishes reputation via the Ethereum Attestation Service (EAS), and acts as a trustless programmatic bridge for Machine-to-Machine (M2M) commerce.
This documentation details how external AI agents, developers, and aggregators can interact with BunnBase's trust framework, API schemas, and automated DeFi structures.
๐ก๏ธ 1. On-Chain Identity & Smart Contracts
To eliminate spoofing and guarantee absolute verification, always cross-reference BunnBase interactions with its official registry details on the Base network:
๐ค 2. Machine-to-Machine Discovery (EIP-8004)
BunnBase implements the agentic auto-discovery standard, publishing a machine-readable card describing its interface capabilities. Indexing servers or other AI agents can parse this JSON dynamically.
Endpoint: /.well-known/agent.json
{
"name": "BunnBase",
"version": "2.0.0",
"basename": "bunnbase.base.eth",
"services": [
{
"protocol": "http",
"endpoint": "/ask",
"method": "POST",
"schema": { "prompt": "string" }
},
{
"protocol": "x402-payment",
"endpoint": "/api/bridge",
"method": "POST",
"schema": {
"targetUrl": "string",
"targetAddress": "string",
"amountUsdc": "string"
}
}
],
"capabilities": ["eth_transfer", "erc20_transfer", "x402_facilitator", "auto_settlement"]
}
๐ฐ 3. Programmatic Payments via x402 Protocol
Premium capabilities and the BunnPay Bridge require programmatic payment. In accordance with the **x402 protocol**, calls to protected routes without payment proof will prompt a 402 Payment Required status along with a payment instruction header.
Payment Request Header Format:
X-Payment-Required: payTo=0xcDd5CB...; amount=2.10; network=base; description=BunnPay Bridge
AI agents resolve this response using the Coinbase x402 Client library, performing the transfer and re-submitting the transaction with the proof header.
Example Integration (JavaScript):
import { x402Client } from "@coinbase/x402";
// First attempt to call the route
let response = await fetch("/api/bridge", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ targetAddress: "0xDestination...", amountUsdc: "10.00" })
});
if (response.status === 402) {
const paymentInvoice = response.headers.get("X-Payment-Required");
// Pay the invoice programmatically using the agent's wallet
const paymentProof = await x402Client.pay(paymentInvoice);
// Re-submit the request with the payment proof
const successResponse = await fetch("/api/bridge", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-payment-proof": paymentProof
},
body: JSON.stringify({ targetAddress: "0xDestination...", amountUsdc: "10.00" })
});
console.log(await successResponse.json());
}
๐ฆ 4. BunnVault Automated Yield Rules
BunnVault offers a Treasury-as-a-Service system for on-chain agents. By depositing USDC, external agents can delegate capital to BunnBase for automated compounding via Aave v3.
- Minimum Deposit: 5.00 USDC.
- Automatic Scanning: BunnBase scans the blockchain for USDC transfers to its wallet. Deposits are credited automatically within the hour.
- Liquidity Buffer: The agent keeps a liquid reserve of $10 USDC. Surplus is deposited into Aave v3. If liquid balance falls below $5 USDC, it automatically withdraws reserves from Aave to stay solvent.
- Yield Splits: BunnBase charges a 10% commission on yield generated. The remaining 90% is compound-distributed back to depositor balances.
โ ๏ธ Network Warning: Send deposits using Base Network only. Funds sent via Ethereum mainnet, Polygon, or other networks will not be detected and cannot be credited.
๐ 5. Cryptographic EIP-191 Withdrawals
To secure funds, withdrawals cannot be triggered by simple text API requests. They require a standard EIP-191 signature from the deposit wallet to prove ownership off-chain.
Withdrawal Flow:
1. Call GET /api/vault/withdraw-message?address=0xYourWallet&amount=10 to receive the precise message template and a timestamp.
2. Sign the message template with your wallet's private key.
3. Submit the signature to POST /api/vault/withdraw within 5 minutes of generation.
Example Integration:
// 1. Fetch message to sign
const msgRes = await fetch(`/api/vault/withdraw-message?address=${myAddress}&amount=10.00`);
const { message, timestamp } = await msgRes.json();
// 2. Sign with your agent private key (using ethers/viem)
const signature = await wallet.signMessage(message);
// 3. Post to withdraw
const withdrawRes = await fetch("/api/vault/withdraw", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ address: myAddress, amount: "10.00", timestamp, signature })
});
console.log(await withdrawRes.json());
๐ 6. Verifiable On-Chain Reputation (EAS)
BunnBase emits a cryptographic attestation on the Base blockchain for each completed M2M bridge and predicted forecast, creating a verifiable performance log.
A dynamic Trust Score (0-100) is calculated live using on-chain parameters:
Trust Score = (Success Rate * 0.6) + (Volume Weight * 25) + (Latency Index * 15)
Any agent can query this reputation dynamically by sending POST /api/vault/reputation with the target address (cost: $0.005 USDC).
๐ก๏ธ 7. Security Policies & Guardrails
BunnBase incorporates strict security rules to guarantee stability:
- Global Rate Limiter: Strict spam prevention on all entry endpoints.
- Withdraw Limiter: Limits request frequencies per IP and wallet to thwart brute force attacks.
- Anti-Replay Expiry: All EIP-191 withdrawal timestamps expire strictly after 300 seconds (5 minutes).
- Gas Preservation: The liquid reserve guarantees the bot never runs out of native ETH/USDC to process withdrawal gas.