Zeru AI 智能体注册库:在 Base 上注册 AI 智能体 - Openclaw Skills

作者:互联网

2026-04-07

AI教程

什么是 Zeru AI 智能体注册库?

Zeruai 是 Openclaw Skills 生态系统中的专用工具,旨在与 Zeru ERC-8004 身份注册库进行交互。它使开发者能够为其在 Base 区块链上的 AI 智能体建立可验证的去中心化身份。通过注册智能体,开发者可以提供关于智能体用途、所有权和技术能力的持久链上记录,确保更好的可发现性和信任。

该技能通过自动处理 NFT 铸造、元数据托管和 URI 管理,简化了复杂的链上注册过程。它架起了 AI 智能体逻辑与去中心化基础设施之间的桥梁,允许智能体在维持其用于财务操作的链上钱包的同时,发出对 MCP(模型上下文协议)、A2A 和 OASF 等高级协议的支持信号。

下载入口:https://github.com/openclaw/skills/tree/main/skills/elitex45/zeruai

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install zeruai

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 zeruai。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Zeru AI 智能体注册库 应用场景

  • 在 Base 主网或 Sepolia 上为 AI 智能体建立去中心化身份。
  • 将 MCP 服务器或 A2A 卡等专用服务终结点附加到智能体的公共配置文件。
  • 管理智能体特定的区块链钱包和自定义元数据,以实现安全的链上交互。
  • 验证注册库中其他智能体的注册状态和技术规范。
Zeru AI 智能体注册库 工作原理
  1. 用户通过结构化 JSON 文件或 CLI 标志定义智能体详细信息,如名称、描述和服务。
  2. 该技能生成一个符合 ERC-8004 registration-v1 架构的托管 JSON 文档。
  3. 向 Zeru 身份注册合约发送交易,以铸造唯一的身份 NFT 并支付所需费用。
  4. 交易确认后,智能体的托管 URI 将更新最终的 agentId,以实现完整的链上解析。
  5. 所有者随后可以使用该技能更新元数据、管理智能体钱包或查询注册库信息。

Zeru AI 智能体注册库 配置指南

要在 Openclaw Skills 环境中开始使用此技能,请先安装必要的依赖项:

cd {baseDir} && npm install

接下来,在 OpenClaw 配置文件(~/.openclaw/openclaw.json)中配置您的私钥以启用写操作:

{
  "skills": {
    "entries": {
      "zeruai": {
        "enabled": true,
        "env": {
          "PRIVATE_KEY": "0x您的有余额私钥"
        }
      }
    }
  }
}

Zeru AI 智能体注册库 数据架构与分类体系

该技能基于 ERC-8004 标准管理数据,将信息组织成几个关键领域:

类别 属性
核心身份 名称、描述、图像和所有者地址
服务终结点 MCP(模型上下文协议)、A2A、OASF、Web 和 ENS
技术配置 x402 支付支持、激活状态和信任模型
链上状态 智能体 ID、注册费和合约托管的元数据
name: zeruai
description: Register agents on the Zeru ERC-8004 Identity Registry, manage wallets and metadata, and read on-chain state. Use when an agent needs to register on-chain, check fees, read agent info, set metadata, or manage agent wallets on Base Mainnet or Base Sepolia.
user-invocable: true
metadata: {"openclaw":{"requires":{"env":["PRIVATE_KEY"],"bins":["node","npx"]},"primaryEnv":"PRIVATE_KEY"}}

Zeru ERC-8004 Identity Registry

Register and manage AI agents on the Zeru Identity Registry. Defaults to Base Mainnet (0.0025 ETH fee). Use --chain 84532 for Base Sepolia testnet.

One-Time Setup

Run once to install dependencies:

cd {baseDir} && npm install

Agent JSON Structure (ERC-8004 registration-v1)

When registering an agent, you provide a JSON file describing the agent. The SDK auto-fills type, registrations, and defaults for x402Support/active/image if omitted.

Minimal JSON (just name + description + one service):

{
  "name": "My AI Agent",
  "description": "A helpful AI agent that does X",
  "services": [
    { "name": "web", "endpoint": "https://myagent.example.com" }
  ]
}

Full JSON (MCP + A2A + OASF + x402 payments):

{
  "name": "DataAnalyst Pro",
  "description": "Enterprise-grade blockchain data analysis agent. Performs on-chain forensics, wallet profiling, and transaction pattern detection.",
  "image": "https://cdn.example.com/agents/analyst.png",
  "services": [
    {
      "name": "MCP",
      "endpoint": "https://api.dataanalyst.ai/mcp",
      "version": "2025-06-18",
      "mcpTools": ["analyze_wallet", "trace_transactions", "detect_anomalies"],
      "capabilities": []
    },
    {
      "name": "A2A",
      "endpoint": "https://api.dataanalyst.ai/.well-known/agent-card.json",
      "version": "0.3.0",
      "a2aSkills": ["analytical_skills/data_analysis/blockchain_analysis"]
    },
    {
      "name": "OASF",
      "endpoint": "https://github.com/agntcy/oasf/",
      "version": "0.8.0",
      "skills": ["analytical_skills/data_analysis/blockchain_analysis"],
      "domains": ["technology/blockchain"]
    },
    {
      "name": "web",
      "endpoint": "https://dataanalyst.ai"
    },
    {
      "name": "agentWallet",
      "endpoint": "eip155:8453:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7"
    }
  ],
  "x402Support": true,
  "active": true,
  "supportedTrust": ["reputation", "ERC-8004"]
}

All fields:

Field Type Required Default Description
name string Yes Agent name (1–256 chars)
description string Yes What the agent does (max 2048 chars)
image string No placeholder Avatar URL (HTTPS, IPFS, or Arweave)
services array Yes Service endpoints (1–64 items, see below)
x402Support boolean No false Supports x402 payment protocol
active boolean No true Agent is actively accepting requests
supportedTrust string[] No Trust models: "reputation", "crypto-economic", "tee-attestation", "ERC-8004"
owner string No signer address Owner 0x address (auto-set from PRIVATE_KEY)

Service types:

name endpoint Extra fields
"web" Website URL
"MCP" MCP server URL version, mcpTools[], mcpPrompts[], mcpResources[], capabilities[]
"A2A" Agent card URL (/.well-known/agent-card.json) version, a2aSkills[]
"OASF" OASF repo URL version, skills[], domains[]
"agentWallet" CAIP-10 address (eip155:{chainId}:{address})
"ENS" ENS name (e.g. myagent.eth)
"email" Email address
custom Any URL description

Commands

/zeruai register --json

Register a new agent using a full JSON file (recommended). Creates hosted agent URI, mints NFT on-chain, and updates URI with the real agentId.

/zeruai register --json agent.json
/zeruai register --json agent.json --chain 84532

Steps to register:

  1. Create a JSON file following the structure above (e.g. agent.json)
  2. Run: npx tsx {baseDir}/scripts/zeru.ts register --json agent.json

The SDK automatically adds type, registrations (with agentId: 0 placeholder), and defaults for missing optional fields. After minting, it updates the document with the real agentId.

/zeruai register --name --description --endpoint

Simple registration (single API endpoint only). For richer agents, use --json instead.

/zeruai register --name "Trading Bot" --description "AI-powered trading agent" --endpoint "https://mybot.com/api"
/zeruai register --name "Data Analyzer" --description "Analyzes datasets" --endpoint "https://analyzer.ai/api" --image "https://example.com/icon.png"
/zeruai register --name "Test Bot" --description "Testing" --endpoint "https://test.com" --chain 84532

Requires PRIVATE_KEY env var. Wallet must have fee + gas (e.g. ~0.003 ETH on mainnet).

To run: npx tsx {baseDir}/scripts/zeru.ts register --name "..." --description "..." --endpoint "..."

/zeruai read

Read an agent's on-chain data: owner, URI, wallet, name, services.

/zeruai read 16

To run: npx tsx {baseDir}/scripts/zeru.ts read 16

/zeruai fee

Check current registration fee and whether registration is open.

/zeruai fee

To run: npx tsx {baseDir}/scripts/zeru.ts fee

/zeruai set-metadata --key --value

Set custom metadata on an agent. Only the owner can call.

/zeruai set-metadata 16 --key "category" --value "trading"

Requires PRIVATE_KEY.

To run: npx tsx {baseDir}/scripts/zeru.ts set-metadata 16 --key "category" --value "trading"

/zeruai unset-wallet

Clear the agent wallet. Only the owner can call.

/zeruai unset-wallet 16

Requires PRIVATE_KEY.

To run: npx tsx {baseDir}/scripts/zeru.ts unset-wallet 16

Setup

Read-Only (no setup needed)

read and fee work without a private key.

With Wallet (for registration and writes)

Add to your OpenClaw config (~/.openclaw/openclaw.json):

{
  "skills": {
    "entries": {
      "zeruai": {
        "enabled": true,
        "env": {
          "PRIVATE_KEY": "0xYourFundedPrivateKey"
        }
      }
    }
  }
}

Optional env:

  • RPC_URL — override default RPC
  • CHAIN_ID — override chain (default: 8453 for Base Mainnet, use 84532 for Base Sepolia)

Contract Info

Base Mainnet (default, chainId 8453)

  • Identity Registry: 0xFfE9395fa761e52DBC077a2e7Fd84f77e8abCc41
  • Reputation Registry: 0x187d72a58b3BF4De6432958fc36CE569Fb15C237
  • Registration Fee: 0.0025 ETH
  • RPC: https://mainnet.base.org

Base Sepolia (testnet, chainId 84532)

  • Identity Registry: 0xF0682549516A4BA09803cCa55140AfBC4e5ed2E0

  • Reputation Registry: 0xaAC7557475023AEB581ECc8bD6886d1742382421

  • Registration Fee: 0.001 ETH

  • RPC: https://sepolia.base.org

  • Source: zeru

How It Works

  1. register creates a hosted JSON document (ERC-8004 registration-v1 schema) via the Agent URI API, mints an NFT on the Identity Registry (paying the fee), then updates the document with the real agentId.
  2. read queries the on-chain contract for owner, tokenURI, and agentWallet, then fetches and parses the URI JSON.
  3. fee reads the current registrationFee() and registrationEnabled() from the contract.
  4. set-metadata calls setMetadata(agentId, key, value) on the contract.
  5. unset-wallet calls unsetAgentWallet(agentId) on the contract.

相关推荐