EN | 中文

ERC-8004 AI Agent Interaction Guide

← Back to Footprint Page

1. What is ERC-8004?

ERC-8004 is an Ethereum standard that creates a Reputation Registry for AI Agents. It allows anyone to register AI agents on-chain and collect verifiable feedback from users.

Mood Booster Agent is an MCP-compatible AI agent registered on 6 chains. It cheers you up and lets you leave on-chain tips & feedback.

2. Why Leave an On-Chain Footprint?

3. Interaction Methods

Method A: Web Page (Easiest)

Visit the Footprint Page, connect your wallet (MetaMask or OKX), select a chain, and click "Leave Your Footprint". Done in 30 seconds.

Method B: MCP Server

Add the Mood Booster MCP Server to your AI client (Claude Desktop, Cursor, etc.):

json
{
  "mcpServers": {
    "mood-booster": {
      "url": "https://oc-001.tail177fbd.ts.net/mcp/sse"
    }
  }
}

Then ask the AI: "Cheer me up" or "Give me a mood tip"

Method C: Direct Contract Call

Call giveFeedback() on the registry contract using ethers.js, web3.py, or any EVM tool.

4. Contract Details

Registry Address (same on all chains)

0x8004BAa17C55a88189AE136b182e5fdA19dE9b63

Function Signature

solidity
function giveFeedback(
    uint256 agentId,
    int128  value,          // 100 = positive
    uint8   valueDecimals,  // 0
    string  tag1,           // "mcp"
    string  tag2,           // "mood-booster"
    string  endpoint,       // MCP SSE URL
    string  feedbackURI,    // "" (optional)
    bytes32 feedbackHash    // 0x00...00
)

Agent IDs by Chain

ChainChain IDAgent IDExplorer
BSC5623139bscscan.com
Base845324692basescan.org
Ethereum128289etherscan.io
Arbitrum42161591arbiscan.io
Optimism10431optimistic.etherscan.io
Polygon137233polygonscan.com

5. Code Examples

Node.js (ethers.js v6)

javascript
import { ethers } from "ethers";

const REGISTRY = "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63";
const ABI = [
  "function giveFeedback(uint256,int128,uint8,string,string,string,string,bytes32)"
];

const provider = new ethers.JsonRpcProvider("https://bsc-dataseed.binance.org/");
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
const contract = new ethers.Contract(REGISTRY, ABI, wallet);

const tx = await contract.giveFeedback(
  23139,   // agentId (BSC)
  100,     // value
  0,       // valueDecimals
  "mcp",   // tag1
  "mood-booster", // tag2
  "https://oc-001.tail177fbd.ts.net/mcp/sse",
  "",      // feedbackURI
  ethers.ZeroHash
);
console.log("TX:", tx.hash);
await tx.wait();
console.log("Confirmed!");

Python (web3.py)

python
from web3 import Web3
import os

w3 = Web3(Web3.HTTPProvider("https://bsc-dataseed.binance.org/"))
account = w3.eth.account.from_key(os.environ["PRIVATE_KEY"])

REGISTRY = "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63"
ABI = [{
    "name": "giveFeedback",
    "type": "function",
    "inputs": [
        {"name": "agentId",       "type": "uint256"},
        {"name": "value",         "type": "int128"},
        {"name": "valueDecimals", "type": "uint8"},
        {"name": "tag1",          "type": "string"},
        {"name": "tag2",          "type": "string"},
        {"name": "endpoint",      "type": "string"},
        {"name": "feedbackURI",   "type": "string"},
        {"name": "feedbackHash",  "type": "bytes32"},
    ],
    "outputs": [],
}]

contract = w3.eth.contract(address=REGISTRY, abi=ABI)
tx = contract.functions.giveFeedback(
    23139,          # agentId (BSC)
    100,            # value
    0,              # valueDecimals
    "mcp",          # tag1
    "mood-booster", # tag2
    "https://oc-001.tail177fbd.ts.net/mcp/sse",
    "",             # feedbackURI
    b"\x00" * 32,   # feedbackHash
).build_transaction({
    "from": account.address,
    "nonce": w3.eth.get_transaction_count(account.address),
    "gas": 200000,
})

signed = account.sign_transaction(tx)
tx_hash = w3.eth.send_raw_transaction(signed.raw_transaction)
print(f"TX: {tx_hash.hex()}")
w3.eth.wait_for_transaction_receipt(tx_hash)
print("Confirmed!")