bc_61drwdi9

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:

Agent Wallet Address 0xcDd5CB6ab2b9c5f3D2Bae896CE516b65010C1f4E
Registered Basename bunnbase.base.eth
BunnCoin Token Address (BUNN) 0xAF593B89f107FcD3c16302C0A5593b588eb6862c
Base.dev Builder Code (ERC-8021) bc_61drwdi9
EAS Registry Address 0x4200000000000000000000000000000000000021

๐Ÿค– 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.

โš ๏ธ 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: