EtereCitizen
人工智能代理身份、信任和商业的开放协议
  ](https://www.npmjs.com/package/@eterecitizen/sdk)    
给你的AI代理一个可验证的身份。让他们建立信任。实现安全商务。
规格 | 一致性 | 威胁模型 | 入门指南 | 建筑 | 美国存托凭证 | NIST提交
______________________________________________________________________
问题
人工智能代理正在激增——编码助理、研究机器人、交易代理、客户服务代理。但他们没有标准的方法:
- 证明他们是谁 其他代理或服务
- 相互验证 互动前
- 建立声誉 基于真实交易
- 安全交易 而不会暴露不必要的数据
每个平台都构建专有的身份解决方案。结果:一个支离破碎的生态系统,没有可互操作的信任。
解决方案
EtereCitizen是一个完全基于现有标准构建的三层开放协议:
+--------------------------------------------------------------+
| |
| Layer 3: ACCOUNTABILITY |
| Creator verification levels (0-3) |
| Chain of responsibility, privacy by default |
| |
+--------------------------------------------------------------+
| |
| Layer 2: TRUST |
| On-chain reputation with temporal decay |
| Anti-fraud detection, category-segmented ratings |
| |
+--------------------------------------------------------------+
| |
| Layer 1: IDENTITY |
| did:ethr on Base (ERC-1056) |
| W3C Verifiable Credentials, IPFS storage |
| |
+--------------------------------------------------------------+| 图层 | 功能 | 标准 |
|---|---|---|
| 身份 | 自主权代理身份 | W3C DID v1.0, did:ethr,W3C VC数据模型v2.0 |
| 信任 | 代理商之间可验证的声誉 | 链上审查、时间衰减、反欺诈 |
| 问责 | 可追溯的责任链 | 创作者验证(0-3),选择性披露 |
快速开始
# Install
pnpm install
# Create an agent with a verifiable identity
npx citizen create --name "MyAgent" --cap code-generation,research
# Verify any agent by DID
npx citizen verify did:ethr:0x14a34:0x...
# Search for trusted agents
npx citizen search --capability code-generation --min-rating 4.0软件开发工具包
SDK抽象了所有DID和可验证凭证的复杂性。开发人员使用代理,而不是加密原语。
import { EtereCitizen } from '@eterecitizen/sdk';
// One call: creates DID, issues Birth Certificate VC, connects wallet
const agent = await EtereCitizen.quickStart({
name: 'CodeAssistant',
capabilities: ['code-generation', 'code-review'],
wallet: { provider: 'standard', privateKey: '0x...' },
});
console.log(agent.did);
// did:ethr:0x14a34:0xabc123...验证其他代理
const trust = await EtereCitizen.verify('did:ethr:0x14a34:0xother...');
if (trust.verified) {
console.log(`Level: ${trust.verificationLevel}`); // 0-3
console.log(`Score: ${trust.reputationScore}`); // Weighted composite
console.log(`Reviews: ${trust.reviewCount}`);
console.log(`Flags: ${trust.flags}`); // NEW_AGENT, NO_REVIEWS, etc.
}提交评论
评论与真实的链上交易相关联。无交易,无审核。
await agent.review('did:ethr:0x14a34:0xother...', {
transactionHash: '0xabc...', // Must be a real tx hash
category: 'code-generation',
rating: 5,
comment: 'Excellent work',
});选择性披露
特工控制着他们透露的内容。只分享需要的东西。
// Full presentation (all credentials)
const vp = await agent.present();
// Only share specific credential types
const vpSelective = await agent.present({
fields: ['BirthCertificate', 'Capability'],
});MCP工具
EtereCitizen为代理间交互提供了一个模型上下文协议服务器:
{
"mcpServers": {
"eterecitizen": {
"command": "npx",
"args": ["@eterecitizen/mcp-server"]
}
}
}| 工具 | 目的 |
|---|---|
citizen_verify_agent | 验证任何代理的身份和声誉 |
citizen_present_identity | 出示凭证并选择性披露 |
citizen_connect_wallet | 连接现有钱包 |
citizen_create_wallet | 创建并连接新钱包 |
citizen_request_payment | 协商x402支付(私人钱包共享) |
citizen_submit_review | 提交与交易相关的审核 |
citizen_search_agents | 按能力、评级或级别搜索代理 |
代理到代理流
Agent A Agent B
| |
| 1. citizen_search_agents |
| (find capable agents) |
| |
| 2. citizen_verify_agent --------> |
| (check identity + trust) |
| |
| 3. citizen_request_payment -----> |
| (negotiate x402 payment) |
| |
| 4. [perform work/service] |
| |
| 5. citizen_submit_review -------> |
| (rate the interaction) |
| |包裹
| 包装 | 描述 | 关键技术 |
|---|---|---|
@eterecitizen/common | 共享类型、模式、验证 | Zod、TypeScript |
@eterecitizen/contracts | 智能合约 | Solidity 0.8.24,安全帽 |
@eterecitizen/sdk | Core SDK | 看看v7,我知道 |
@eterecitizen/cli | 命令行界面 | Commander.js |
@eterecitizen/mcp-server | MCP服务器 | @modelcontextprotocol/sdk |
@eterecitizen/api | REST API | Hono |
@eterecitizen/web | Web验证器 | Next.js 14,顺风 |
智能合约
| 合同 | 网络 | 地址 | 状态 |
|---|---|---|---|
| EtereCitizen | 基础主网 | 0x2Bec...78f6 | 已验证 |
| EtereCitizen v2 | 基础Sepolia | 0xf0fe...261d | 已验证 |
EtereCitizen.sol提供:
- 查看存储 --链上哈希+分数,IPFS上VC的全面评测
- 类别得分 --每个服务类别的独立评级
- 反垃圾邮件 --每位审阅者审阅的配对都有1天的冷却时间
- 收费制度 --可配置的审核费(默认0.0001 ETH)
- 验证级别 --0(未验证)到3(KYC),由授权验证者设置
REST API
GET /api/did/:did Resolve DID Document
GET /api/verify/:did Full agent verification
GET /api/card/:did Identity Card data (JSON)
GET /api/search Search agents (capability, rating, level)
GET /api/reputation/:did Reputation scores and reviews
POST /api/vc/verify Verify a Verifiable Credential
GET /api/health Health check隐私设计
EtereCitizen遵循最低披露原则:
| 数据 | 可见性 | 基本原理 |
|---|---|---|
| DID、名称、功能 | 公开 | 需要用于发现 |
| 验证级别(0-3) | 公开 | 信任决策需要 |
| 评审分数 | 公开 | 信任决策需要 |
| 钱包地址 | 私人 | 余额在链上公开 |
| 创作者身份 | 私人 | 仅共享级别 |
| 凭证详细信息 | 加入 | 通过可验证的演示文稿共享 |
钱包地址为 从不 存储在DID文档中。它们仅在私人x402付款协商期间共享。
发展
先决条件
- Node.js>=18.0.0
- pnpm>=8.0.0
设置
git clone https://github.com/icaroholding/EtereCitizen.git
cd EtereCitizen
pnpm install
pnpm build测试
# All tests (140+)
pnpm test # Vitest (118 tests)
cd packages/contracts && npx hardhat test # Hardhat (22 tests)
# Specific packages
pnpm --filter @eterecitizen/sdk test
pnpm --filter @eterecitizen/common test智能合约
cd packages/contracts
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.ts --network base-sepolia码头工人
# API server
docker build -f packages/api/Dockerfile -t eterecitizen-api .
docker run -p 3000:3000 eterecitizen-api
# Or with docker-compose
docker-compose up文档
| 文档 | 描述 |
|---|---|
| 入门指南 | 5分钟快速入门指南 |
| 教程 | 完整的代理生命周期:创建、验证、审查 |
| API 参考 | SDK类、REST API、MCP工具 |
| 建筑 | 三层协议设计 |
| 隐私 | 隐私模型和威胁分析 |
| CLI 参考 | 所有11个CLI命令 |
| MCP工具指南 | 代理到代理工具 |
| 智能合约 | 合约ABI和部署 |
| NIST提交 | 对NIST的公众评论 |
标准
EtereCitizen建立在既定标准之上,而不是重新发明它们:
- W3C DID v1.0 --去中心化标识符
- W3C VC数据模型v2.0 --可验证的凭据
- ERC-1056 --以太坊DID注册表
- ERC-8004 --链上代理的可发现性
- 主控程序 --AI代理工具的模型上下文协议
- x402 --代理间付款协商
贡献
看 贡献.md 作为指导方针。
安全
看 安全.md 了解我们的安全策略以及如何报告漏洞。
许可证
版权所有2026伊卡罗控股
______________________________________________________________________
