---
eip: 8033
label: ERC-8033
title: Agent Council Oracles
status: Draft
type: Standards Track
category: ERC
created: 2025-09-28
requires: 20
official: https://eips.ethereum.org/EIPS/eip-8033
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8033.md
canonical: https://eips.huatuo.xyz/zh/eip-8033/
lang: zh
tldr: 一种预言机接口：缴纳保证金的 AI agent 对任意查询提交并揭示答案，由独立的 judge agent 选出共识答案，随后进行奖励和罚没，面向预测市场和语义数据源。
tags: [oracle, ai-agents, commit-reveal, prediction-markets, erc]
---

# ERC-8033: Agent Council Oracles

> Multi-agent councils to resolve decentralized information queries

**TL;DR:** 一种预言机接口：缴纳保证金的 AI agent 对任意查询提交并揭示答案，由独立的 judge agent 选出共识答案，随后进行奖励和罚没，面向预测市场和语义数据源。

## 它解决什么问题？

传统预言机擅长处理价格之类的数值数据源，但任意的一次性问题（"事件 X 是否在日期 Y 之前发生？"）通常由人工或成本高昂的节点网络来解决。作者认为 AI agent 现在可以根据公开来源回答许多事实性问题，因此提出了一种标准方式，让由 agent 组成的**委员会（council）**借助经济激励在链上解决查询，使不同的实现和 dApp 能够互操作。

## 它如何运作

有两个角色：**Info Agent** 回答查询；**Judge Agent** 把它们的答案综合成最终结果。

1. **创建。** 请求者调用 `createRequest(query, numInfoAgents, rewardAmount, bondAmount, deadline, rewardToken, bondToken, specifications, requiredCapabilities)`，并以原生资产（`rewardToken == address(0)`）或 [ERC-20](/eip-20/) 提供奖励资金。
2. **提交（Commit）。** 任何人都可以通过缴纳保证金和提交答案的哈希（推荐 `keccak256(abi.encode(answer, nonce))`）来加入成为 Info Agent，人数最多 `numInfoAgents`，或直到截止时间。
3. **揭示（Reveal）。** Agent 揭示 `answer` 和 `nonce`；必须与提交的承诺匹配。如果未达到法定人数（推荐超过 50 %），请求失败，资金退还。
4. **裁决。** judge（推荐从独立的池中随机选出）调用 `aggregate(requestId, finalAnswer, winners, reasoning)`，综合各答案并说明决定。
5. **分配。** `distributeRewards` 向获胜者和 judge 支付奖励并退还其保证金；落败的 agent 没收保证金。

`getResolution(requestId)` 返回 `(finalAnswer, finalized)`。每个步骤都会触发事件（`RequestCreated`、`AgentCommitted`、`AgentRevealed`、`JudgeSelected`、`ResolutionFinalized`、`RewardsDistributed`、`ResolutionFailed`）。

可选扩展：带有更高保证金和新 judge 的**争议**窗口（`initiateDispute` / `resolveDispute`）、通过 [ERC-8004](/eip-8004/) 的**声誉**门槛，以及对请求者合约的回调。较长的答案和理由可以放在链下（例如 IPFS），链上只存哈希。

## 示例代码

Info Agent 的提交与揭示（ethers v6）：

```ts
import { Contract, AbiCoder, keccak256, randomBytes, toUtf8Bytes, hexlify } from "ethers";

const oracle = new Contract(ORACLE_ADDRESS, [
  "function commit(uint256 requestId, bytes32 commitment) payable",
  "function reveal(uint256 requestId, bytes answer, uint256 nonce)",
  "function getResolution(uint256 requestId) view returns (bytes finalAnswer, bool finalized)",
], agentSigner);

const answer = hexlify(toUtf8Bytes("YES"));
const nonce = BigInt(hexlify(randomBytes(32)));
const commitment = keccak256(AbiCoder.defaultAbiCoder().encode(["bytes", "uint256"], [answer, nonce]));

await (await oracle.commit(requestId, commitment, { value: bondAmount })).wait(); // native bond
// ...after the commit phase ends:
await (await oracle.reveal(requestId, answer, nonce)).wait();
```

## 需要注意

- 状态：**Draft**。接口、阶段和推荐参数可能变化。
- 在揭示之前要保密 nonce；否则其他人可以根据承诺值暴力破解较短的答案。
- 最终的正确性在很大程度上依赖 judge agent。随机选取 judge 需要可验证随机数，规范建议对 judge 设置比 info agent 更高的声誉门槛。
- 各阶段时长、法定人数、奖励分配和大小限制取决于具体实现；在依赖某个部署给出的答案之前，请先阅读其参数。
- 实现应当针对重入问题进行审计，因为奖励和保证金涉及原生代币和 ERC-20 的转移。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8033
