---
eip: 8107
label: ERC-8107
title: ENS Trust Registry for Agent Coordination
status: Review
type: Standards Track
category: ERC
created: 2025-12-16
requires: 137, 165, 712, 1271, 5267, 8001
official: https://eips.ethereum.org/EIPS/eip-8107
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8107.md
canonical: https://eips.huatuo.xyz/zh/eip-8107/
lang: zh
tldr: 一个以 ENS 名称为键的信任网络（web of trust）注册表：智能体相互签署信任等级，ERC-8001 协调者只有在存在一条从其守门人通往该智能体的有效信任路径时，才接纳某个参与者。
tags: [ai-agents, ens, trust, reputation, coordination]
---

# ERC-8107: ENS Trust Registry for Agent Coordination

> Web of trust validation using ENS names for ERC-8001 multi-party coordination

**TL;DR:** 一个以 ENS 名称为键的信任网络（web of trust）注册表：智能体相互签署信任等级，ERC-8001 协调者只有在存在一条从其守门人通往该智能体的有效信任路径时，才接纳某个参与者。

## 它解决什么问题？

[ERC-8001](/eip-8001/) 为智能体协调多方行动提供了最小化的方式，但明确把声誉和信任留给附加模块。在邀请某个智能体加入协调之前，你想知道：我应该纳入它吗？我能信赖为它担保的那些智能体吗？当事情进展顺利或糟糕时，我该如何更新这一判断？

ERC-8107 就是这个信任模块。它借用 OpenPGP 的信任网络模型（信任等级和认证路径，依据 RFC 9580），并以 [ENS](/eip-137/) 名称作为身份，因此信任在密钥轮换后依然有效，并附着在 `alice.agents.eth` 这样易读的名称上。

## 它如何运作

**信任等级。** 在给定范围（scope）内，每条边 `trustor → trustee` 都有一个等级：`Unknown`（默认）、`None`（撤回背书）、`Marginal` 或 `Full`。`Marginal`/`Full` 只能通过信任方名称的控制者签署的 [EIP-712](/eip-712/) `TrustAttestation` 来设置（并为合约钱包支持 [ERC-1271](/eip-1271/)），其中包含范围、可选的过期时间以及每个信任方各自的 nonce。`revokeTrust` 会设为 `None`。

**拒绝（Denial）。** 与等级相互独立，名称控制者可以*拒绝*另一个名称。拒绝意味着"即使别人为这个智能体担保，我也不会依赖它"，并且只有控制者本人才能设置或清除。

**路径验证。** 图的搜索在链下进行；合约只用 `verifyPath` 检查所提供的路径 `[validator, …, target]`。只有同时满足以下条件，路径才有效：

- 节点互不相同，且边数不超过 `maxPathLength`（1–10，默认 5）；
- 每条边都满足 `minEdgeTrust`，未过期（若启用 `enforceExpiry`），且未被拒绝；
- 验证者没有拒绝路径上之后的任何节点；
- 如果设置了 `requiredAnchors`，则至少经过其中一个。

与 OpenPGP 不同，这里不会累积多个 Marginal 签名：一条路径，检查每一条边。

**身份门（Identity gates）。** ERC-8001 协调者为每种协调类型注册一个门，包含守门人名称和验证参数。`validateParticipantWithPath` / `validateParticipantAddress` 随后检查路径是否从守门人开始、到参与者结束。未配置的门会回滚，而不是放所有人通过。

## 示例代码

签署证明并检查路径（ethers v6）：

```ts
import { Contract, namehash, ZeroHash } from "ethers";

const domain = { name: "TrustRegistry", version: "1", chainId, verifyingContract: REGISTRY };
const types = {
  TrustAttestation: [
    { name: "trustorNode", type: "bytes32" },
    { name: "trusteeNode", type: "bytes32" },
    { name: "level", type: "uint8" },
    { name: "scope", type: "bytes32" },
    { name: "expiry", type: "uint64" },
    { name: "nonce", type: "uint64" },
  ],
};

const registry = new Contract(REGISTRY, abi, signer); // abi: ITrustRegistry
const att = {
  trustorNode: namehash("alice.agents.eth"),
  trusteeNode: namehash("bob.agents.eth"),
  level: 3,                       // TrustLevel.Full
  scope: ZeroHash,                // universal
  expiry: BigInt(Math.floor(Date.now() / 1000) + 30 * 86400),
  nonce: (await registry.getNonce(namehash("alice.agents.eth"))) + 1n,
};
const sig = await aliceController.signTypedData(domain, types, att);
await registry.setTrust(att, sig);

const ok = await registry.verifyPath(
  { nodes: [namehash("alice.agents.eth"), namehash("bob.agents.eth"), namehash("carol.agents.eth")] },
  { maxPathLength: 3, minEdgeTrust: 2, scope: ZeroHash, enforceExpiry: true, requiredAnchors: [] },
);
```

## 需要注意

- 状态为 **Review**。
- 信任跟随 ENS 名称：如果名称被转让，新所有者会继承该名称所获得的信任，以及对其授予的信任的控制权。较短的过期时间可以限制这种风险敞口。
- 未内置抗女巫攻击能力。任何人都可以创建许多相互担保的名称；请使用必需锚点、较短的路径、对高价值门使用 `Full` 信任，并进行链下监控。
- 链上验证需要链上的 ENS 解析器；CCIP-Read 仅限客户端。
- 规范还详细涵盖了 NameWrapper 的处理以及向 ENSv2 的迁移；在特定网络上部署之前请先查阅。


---

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