01 Motivation: AI Agents Need a Trustworthy Foundation
LLM-powered AI agents are stepping out of chat windows.
They can call tools, manage digital assets, autonomously execute multi-step tasks, and even collaborate with other agents to get work done.
But when agents act at machine speed, three questions arise:
- What did it do and why — is there a neutral, trustworthy record?
- When an agent errs, oversteps its authority, or causes losses, can we trace responsibility to exactly which step of which agent, authorized by whom?
- For value exchange between agents, or between agents and API services, is there a neutral ledger?
These three trust gaps — unauditable behavior, untraceable responsibility, and untrustworthy settlement — cannot be closed by a better model alone. They require a layer of trustworthy infrastructure that is independent of any model.
Blockchain happens to be good at exactly this: verifiable execution, auditable state changes, and settlement without trusted intermediaries.
This suggests a natural idea — elevate blockchain from a decentralized-application platform to the trust foundation for AI agents.
But turning the idea into practice still requires one thing: an experimental tool that lets researchers reproduce, compare, and evaluate these mechanisms.
That is exactly why AgentEmulator was built.
02 What Is AgentEmulator
AgentEmulator is a simulation and experimentation platform for trustworthy AI-agent infrastructure, initiated by the HuangLab research group at the School of Software Engineering, Sun Yat-sen University.
It uses blockchain as the basis for trustworthy recording and settlement, helping researchers and students experiment with agent identity, behavior auditing, payment settlement, incentives, and governance — gradually forming a research toolkit that supports trustworthy interaction and collaboration among AI agents.
AgentEmulator is built on BlockEmulator-X, a blockchain emulation testbed developed in-house by HuangLab.
BlockEmulator-X was open-sourced in June 2026 as the upgraded successor to the original BlockEmulator.
The original BlockEmulator has been widely adopted by researchers in nearly a hundred countries and regions, accumulating a mature sharding core, account model, and metrics framework — all of which AgentEmulator inherits, so existing users face almost no learning curve.
03 What AgentEmulator Can Do
AgentEmulator v2.0 supports two operating modes, turning agent behavior from experimental input into on-chain transactions and then into visualized results:
Replay mode for agent behavior
Replays predefined join / transfer / leave behaviors from a Trace file using the User-specified Original Sequence policy, delivering a minimal end-to-end pipeline.
LLM API mode
Selects one agent from the Trace file and connects it to a Chat-Completions-compatible LLM API, driving that agent to make autonomous decisions based on on-chain state while the remaining agents still execute their preset actions from the Trace.
On-chain identity registration and revocation
join and leave behaviors compile into register and revoke smart-contract calls for a Decentralized Identifier (DID), leaving an on-chain identity trail for every agent.
Data recording and visualization
After each experiment the system automatically records transactions and agent-account data, plots balance-change figures, and generates an HTML results page with Chinese/English switching, opened in the default browser.
A minimal Trace file looks like this:
{"agent_id":"agent-alice","action":"join","params_hash":"doc-alice-v1","ts":1}
{"agent_id":"agent-bob","action":"join","params_hash":"doc-bob-v1","ts":2}
{"agent_id":"agent-alice","action":"pay","target":"agent-bob","amount":12,"request_id":"payment-1","ts":3}
{"agent_id":"agent-bob","action":"leave","params_hash":"exit-bob","ts":5}
Researchers can build on this to explore custom mechanisms — for example, adjusting transaction execution order, or scheduling transactions by priority or agent weight — which is exactly the innovation space the platform leaves open.
04 System Architecture: One Trace, Two Modes
AgentEmulator’s workflow is simple. Researchers describe agent behavior in a Trace file and configure the LLM API and task goals for the selected agent. The system’s workflow and core-module architecture are shown below:
The agentSupervisor module reads the configuration and Trace file, compiles behaviors into a transaction dataset, then automatically launches the BlockEmulator-X blockchain environment to execute transactions and record results on-chain, finally outputting experiment data and figures. In LLM API mode, the system also calls the LLM API based on on-chain state to generate decisions, validates the feedback, and dynamically updates the effective Trace file with valid actions.
The whole process is one command via the startup script: compile → clean old results → run the experiment → plot automatically → open the HTML gallery in the browser.
The platform supports macOS, Linux, and Windows, and requires Go ≥ 1.25 and Python 3 ≥ 3.8.
05 New in v2.0: Connect an LLM API for Real-Time Decisions
An LLM-driven agent runs through a three-step loop of Observation–Reasoning–Decision (ORD):
- Observation: receives the latest blocks and account-state snapshots to obtain balances, states, and other information of the relevant accounts.
- Reasoning: combines the observations with the behavior policy configured by the researcher to judge whether the conditions for the next step are met.
- Decision Making: outputs structured actions such as pay, wait, or leave.
agentSupervisor validates the actions returned by the model, compiles the validated on-chain actions into transactions and submits them; subsequent decisions then use the updated on-chain state, forming a continuous ORD loop. In the current v2.0, one agent per experiment can be controlled by the LLM.
06 Case Study: An Agent Autonomously Trading Precious Metals
To make LLM API mode concrete, the v2.0 manual provides a case study: an agent trading precious metals, showing how to connect an LLM API and run the experiment.
The experiment involves an LLM-driven investor agent (agent-metal-buyer) plus a Gold supplier and a Silver supplier. The investor agent starts with a balance of 15 wei and later receives transfers totaling 835 wei as scheduled in the Trace; gold costs 160 wei per unit and silver 100 wei. Supplier online/offline status is determined by the initial Trace, while the investor agent autonomously decides whether to buy based on the account balance and supplier states it observes at runtime.
The purchase policy set for the model is: prefer gold — buy gold when gold is online and the balance suffices, otherwise keep waiting (even if silver is already affordable); buy silver only when gold is offline, silver is online, and the balance suffices.
An intriguing detail: when the DeepSeek-driven agent’s balance reached 115 wei it could already afford silver, yet the Gold supplier was still online, so it chose to keep waiting until the balance reached 170 wei before making its first payment for one unit of gold. This reflects the agent’s restraint under its policy — it doesn’t spend merely because it can, but acts toward its configured goal.
Comparing one run of each: DeepSeek issued 38 calls in total with a median Reasoning latency of about 2.0 seconds, while Qwen issued 22 calls with a median of about 13.5 seconds. Notably, Qwen produced 6 response-format errors — the amount parameter was returned as a number rather than a string — so those rounds failed response parsing. This reminds researchers that, when connecting different models, response-format compatibility can directly affect experimental results.
07 Reproducibility: Byte-for-Byte Identical Results
For academic research, reproducibility matters more than merely being able to run.
Since v1.0, AgentEmulator has treated determinism as a basic engineering requirement:
- Researchers assign each agent a unique
agent_idin the Trace file; the system combines the configuredseedwithagent_idto deterministically derive the agent’s DID — the same seed and the same ID always yield the same DID. - Given the same seed, Trace file, and code version, the transaction datasets and agent-behavior records generated by AgentEmulator are byte-for-byte identical.
This means an agent × blockchain experiment in a paper can be reproduced exactly on a different machine by a different researcher.
Reproducibility is not a slogan but a commitment locked into the engineering details.
08 Demo Videos
09 Roadmap: From Behavior Simulation to a Benchmarking Platform
AgentEmulator will gradually expand around five directions for AI agents — identity, settlement, auditing, incentives, and governance:
| Stage | Highlights |
|---|---|
| v1.0 | Replay mode for agent behavior: Trace-driven join / pay / leave replay, on-chain identity, per-transaction payments, visualization |
| v2.0 (current) | LLM API mode: connect an LLM API to drive an agent to observe the environment and make real-time autonomous decisions |
| Near term | Improve identity and auditing: DID register/revoke state management, permission assertions, verifiable behavior logs, and behavior tracing |
| Mid term | Extend payments and interaction: micropayments, payment channels, batch settlement, multi-round feedback, and richer service interaction |
| Later | Incentives and collaborative governance: task allocation, behavior coordination, and responsibility tracing for multi-agent collaboration |
| Long term | Benchmarking platform: standardized scenarios, datasets, and metrics for reproducible comparison of different approaches |
Specific plans will be adjusted as research and development progress.
10 Conclusion
AgentEmulator v1.0 lets researchers design, implement, and evaluate agent–blockchain protocols with a single Trace file.
v2.0 goes one step further: an agent is no longer merely replaying a script, but observes on-chain state and makes decisions on its own.
As AI agents gradually become permanent residents of digital systems, building them an auditable, reproducible, and evaluable experiment platform is what HuangLab hopes to contribute to the community.
Researchers are welcome to extend the example code for their specific needs and to design and verify how different mechanisms affect experimental results. We also welcome GitHub issues and code contributions, and you are encouraged to use AgentEmulator in your papers.
12 Follow HuangLab
Get the latest research on blockchain sharding, consensus protocols, and trustworthy AI infrastructure as soon as it’s published.
13 Research Team
AgentEmulator is led by the HuangLab research group at the School of Software Engineering, Sun Yat-sen University. The group focuses on blockchain sharding, consensus protocols, on-chain finance, and the intersection of AI and blockchain, and has published numerous blockchain papers in venues including IEEE/ACM ToN, TSC, TC, TPDS, TDSC, INFOCOM, WWW, ICDCS, and SRDS.
- AgentEmulator (simulation and experimentation platform for trustworthy AI-agent infrastructure) on GitHub: github.com/HuangLab-SYSU/agent-emulator
- BlockEmulator (open-source blockchain sharding testbed) homepage: www.blockemulator.com
- BlockEmulator on GitHub: github.com/HuangLab-SYSU/block-emulator