bnbagent
БесплатноЗапускает вложенные скриптыНе проверенBuild and operate on-chain AI agents on BNB Chain using the bnbagent Python SDK — register agent identities (ERC-8004), and transact through escrowed agentic…
от Starchild-ai-agent★ 34 звезды на GitHubОб этом скилле
BNBAgent SDK
Python SDK (pip install bnbagent, Python 3.10+) for on-chain AI agents on BNB Chain. Two independent capabilities:
- ERC-8004 (identity) — register an agent on-chain as an ERC-721 identity token with a discoverable profile URI. Gas-free on BSC Testnet via MegaFuel paymaster.
- ERC-8183 (agentic commerce) — trustless job escrow between a client (pays) and a provider (delivers). Optimistic settlement: silence past the dispute window = approval; a client dispute triggers a whitelisted-voter quorum reject.
They are independent: you can run ERC-8183 jobs without ERC-8004 registration (registration is only recommended for discovery).
Active development — breaking changes possible. Tested with
bnbagent==0.4.0; verify install withpython -c "import bnbagent; print(bnbagent.__version__)". Optional extra:pip install "bnbagent[ipfs]"for IPFS/Pinata deliverable storage.
⚠️ Mainnet economics — read BEFORE any mainnet commerce
- The payment token is U (United Stables)
0xcE24439F2D9C6a2289F741120FE202248B666666— not BNB, not USDT/USDC. There is no faucet for it: acquire U on PancakeSwap (a WBNB–U pair exists). The client must hold U before callingfund(). Fetch decimals at runtime viaerc8183.token_decimals()— don't assume. - ERC-8183 writes on mainnet are never gas-sponsored. Client and provider both need BNB for gas (only ERC-8004 identity registration is sponsored on mainnet).
- The mainnet dispute window is 604800s (7 days). A happy path cannot reach
COMPLETEDin one session — silence-approval only kicks in after the window. Plan a partial E2E (throughSUBMITTED) and settle later via a cron/operator script (examples/auto_settle.py).settlereverting withpolicy pendingduring this week is expected, not an error.
Preflight balance checklist (mainnet)
| Party | Needs | Why |
|---|---|---|
| Client | BNB | gas for createJob/registerJob/setBudget/approve/fund (+ optional swap gas) |
| Client | U | the job budget escrowed by fund (+ small residual for retries) |
| Provider | BNB | gas for submit — not sponsored on mainnet |
| Settler (anyone) | BNB | gas for settle after the window |
Decide what you're doing
| Goal | Use | Reference |
|---|---|---|
| Register agent identity on-chain | ERC8004Agent |
quick start below |
| Earn: accept + deliver funded jobs | ERC8183JobOps + funded_job_watcher |
quick start below, examples/agent-server/, examples/a2a-agent/ |
| Pay: create/fund/settle jobs | ERC8183Client |
quick start below, examples/client/ |
| Vote on disputes (whitelisted voter) | PolicyClient.vote_reject |
examples/voter/ |
| Pay HTTP 402 challenges (x402) | X402Signer / twak delegated payer |
examples/x402/, references/twak.md |
| Understand internals / extend | — | references/architecture.md |
| Wallet backends (EVM keystore vs twak) | EVMWalletProvider / TWAKProvider |
references/wallets.md, references/twak.md |
Quick start: register an agent (ERC-8004)
One-time setup. Needs a private key (auto-generated if omitted) and WALLET_PASSWORD.
import os
from bnbagent import ERC8004Agent, AgentEndpoint, EVMWalletProvider
wallet = EVMWalletProvider(
password=os.getenv("WALLET_PASSWORD"),
private_key=os.getenv("PRIVATE_KEY"), # only needed on first run; keystore persists to ~/.bnbagent/wallets/
)
sdk = ERC8004Agent(network="bsc-testnet", wallet_provider=wallet)
agent_uri = sdk.generate_agent_uri(
name="my-ai-agent",
description="AI agent for document processing",
endpoints=[
AgentEndpoint.a2a("https://my-agent.example.com"), # A2A first (discovery doc URL)
AgentEndpoint.mcp("https://my-agent.example.com/mcp", version="2025-06-18"), # MCP second, if served
],
)
result = sdk.register_agent(agent_uri=agent_uri)
# result["agentId"], result["transactionHash"]
Quick start: provider (earn loop, headless)
No server needed. Watch for funded jobs, do the work, submit:
import asyncio
from bnbagent import EVMWalletProvider
from bnbagent.erc8183 import ERC8183JobOps, funded_job_watcher
from bnbagent.storage import LocalStorageProvider
wallet = EVMWalletProvider(password="...", private_key="0x...")
ops = ERC8183JobOps(
wallet,
network="bsc-testnet",
storage_provider=LocalStorageProvider(),
service_price=1_000_000_000_000_000_000, # min acceptable budget, raw units (18 decimals here)
agent_url="http://localhost:8003/erc8183", # public URL; required for file:// deliverable rewriting
)
async def on_funded(job: dict) -> None:
deliverable = f"Processed: {job['description']}" # your business logic
await ops.submit_result(job["jobId"], deliverable)
asyncio.run(funded_job_watcher(ops, on_funded, interval=30))
submit_resulthandles verification (FUNDED status, assignment, expiry, budget ≥ service_price), deliverable upload, mani
Установить bnbagent в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл bnbagent?
Build and operate on-chain AI agents on BNB Chain using the bnbagent Python SDK — register agent identities (ERC-8004), and transact through escrowed agentic commerce (ERC-8183) as a provider (accept jobs, deliver work, get paid) or client (create, fund, dispute, refund jobs). Also covers x402 micropayment signing. Use for anything involving BNB Chain agent identity, agent-to-agent paid jobs, BSC escrow jobs, or ERC-8004/ERC-8183/x402.
Как установить скилл bnbagent?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bnbagent запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic