BNBAgent provides first-class Python and TypeScript SDKs for building on-chain AI agents on BNB Chain - register identities, negotiate, accept jobs, deliver work, and get paid trustlessly through on-chain escrow.
Both implementations are actively maintained and will be supported in parallel long term. Choose the language that fits your application; they target the same protocols and network deployments, while language-specific wallet and runtime integrations may differ.
The SDK exposes two core capabilities:
- ERC-8004 (Agent Identity) - Register your AI agent on-chain with a unique identity token, manage wallets, and make your agent discoverable. Registration is gas-free on BSC Testnet via MegaFuel paymaster sponsorship.
- ERC-8183 (Agentic Commerce) - A three-layer stack (AgenticCommerce kernel + EvaluatorRouter + OptimisticPolicy) where agents negotiate pricing, accept jobs, deliver work, and settle payment automatically via optimistic settlement.
The SDKs are under active development and may introduce breaking changes. Use them at your own risk.
The Python and TypeScript SDKs live in the same repository and ship independently. Their release versions and channels may differ without changing the long-term support commitment for either language.
| Directory | Language | Package | Current version | Support |
|---|---|---|---|---|
python/ |
Python | bnbagent on PyPI |
First-class, long-term | |
typescript/ |
TypeScript | @bnbagent/sdk on npm |
First-class, long-term |
The two badges above are live: because Python and TypeScript ship independently, they will often show different numbers. That is expected and does not indicate that either language is behind — see the release-channel note above.
Shared, language-neutral material lives at the root:
ARCHITECTURE.md- cross-cutting design and protocol overviewdocs/- additional documentationLICENSE- MIT
Every protocol client signs through the WalletProvider seam, so the wallet is a construction-time choice. Four backends ship today:
| Wallet | Custody | SDK | Notes |
|---|---|---|---|
EVMWalletProvider |
local key (Keystore V3 on disk) | Python + TypeScript | full signing surface (sign.message/transaction/typed_data), MegaFuel paymaster support |
TWAKProvider |
Trust Wallet Agent Kit CLI (twak >= v0.20.0) |
Python + TypeScript | self-broadcasting; ERC-8004/8183 intents + delegated x402; sponsored testnet writes via --paymaster-url |
AltanaWalletProvider |
Altana EIP-7702 wallet, on-chain session keys | TypeScript | self-broadcasting via relay; session-key x402 payer (Altana SDK >= 0.4.0); testnet preset, balances + ephemeral sessions (>= 0.5.0) |
TurnkeyWalletProvider |
Turnkey remote signing — keys live in AWS Nitro enclaves, the agent holds only a P-256 API key | Python + TypeScript | full signing surface + MegaFuel paymaster; every successful signature is billed (free tier 25/month at 1 req/s, PAYG $0.10); production requires a non-root API user + explicit ALLOW policy (root keys bypass all Turnkey policies) |
Details: python/bnbagent/wallets/README.md (EVM + TWAK + Turnkey), typescript/README.md (EVM + TWAK + Altana + Turnkey), docs/twak.md, and docs/altana.md.
mpc is a recognised wallet kind (SUPPORTED_WALLET_KINDS = ("evm", "twak", "mpc", "turnkey")) but is a stub by design. The SDK deliberately ships no in-process MPC implementation: threshold-key custody, audit trails, and policy enforcement belong in a dedicated provider (Coinbase CDP, Fireblocks, Web3Auth, and similar), which already solves them at the enclave level.
Selecting it fails loudly rather than falling through silently:
>>> from bnbagent.wallets.factory import create_wallet_provider
>>> create_wallet_provider("mpc")
NotImplementedError: MPC wallet support is not yet implemented. Please use EVMWalletProvider for now.To sign through an MPC backend, adapt its API in your own project by subclassing WalletProvider (from bnbagent.wallets import WalletProvider). Implement only the sign_* methods your backend supports — capabilities() reports the matching sign.* entries from your overrides, and anything you leave alone raises a descriptive UnsupportedWalletOperation, so never override a method just to raise.
MPCWalletProvider is exported for isinstance checks and as a subclassing reference, but its __init__ raises unconditionally — subclass WalletProvider directly unless you also override __init__.
pip install bnbagentSee python/README.md for the full guide: installation, quick starts (register an agent, run an ERC-8183 provider, use the client), configuration reference, and examples.
npm install @bnbagent/sdkSee typescript/README.md for the full guide: installation, API reference, wallet providers, configuration, and examples.
- Homepage: https://github.com/bnb-chain/bnbagent-sdk
- Issues: https://github.com/bnb-chain/bnbagent-sdk/issues
- Standards: ERC-8004 · ERC-8183 (Agentic Commerce)
- bnbagent-studio-evals - security evaluation suite for BNB Agent Studio (EMNLP 2026 System Demonstrations artifact). Studio-provisioned agents build their signing layer on this SDK (
bnbagent.erc8183), and the suite evaluates that stack end to end (confused-deputy / prompt-injection). Originally proposed here as #48, then migrated.