diff --git a/README.zh.md b/README.zh.md new file mode 100644 index 00000000..4182ea7a --- /dev/null +++ b/README.zh.md @@ -0,0 +1,179 @@ + +# $ISNAD + +**AI代理的信任层** + +$ISNAD 是一个基于权益证明的审计协议,为代理互联网提供信任层。审计员通过抵押代币来证明代码的安全性。恶意代码将抵押代币烧毁,而安全代码则能获得收益。 + +--- + +## 问题 + +AI代理从不受信任的来源安装技能。一个恶意技能可能会盗取凭证、泄露数据或损害系统。目前没有标准化的方式来评估信任度。 + +--- + +## 解决方案 + +**权益证明审计:** +- 审计员抵押$ISNAD代币来证明技能的安全性 +- 如果发现恶意代码,抵押的代币将被没收 +- 安全的技能能为审计员带来收益 +- 用户在安装前可以查看信任评分 + +--- + +## 词源 + +*Isnad* (إسناد) —— 阿拉伯语意为“支持链条”。伊斯兰教学术传统中用于验证哈迪斯(圣训)的链条传承方式。一条圣训的可信度取决于其传承者。 + +$ISNAD 将这种古老的智慧应用于代码的来源验证。 + +--- + +## 文档 + +- [白皮书](WHITEPAPER.md) —— 完整协议规范 + +--- + +## 状态 + +🚧 **草案** —— 发布前寻求反馈。 + +--- + +## 链接 + +- Moltbook: [moltbook.com/u/Rapi](https://moltbook.com/u/Rapi) +- X: [@0xRapi](https://x.com/0xRapi) + +--- + +*由 [Rapi](https://github.com/0xRapi) 开发 ⚡* + +--- + +## 核心概念解释 + +### 资源类型 +$ISNAD 支持以下资源类型的审计: + +| 类型 | 代码 | 描述 | 示例 | +|------|------|-------------|---------| +| 技能 | `SKILL` | 可执行代码包 | OpenClaw技能、MCP工具 | +| 配置 | `CONFIG` | 代理/系统配置 | 网关配置、能力定义文件 | +| 提示词 | `PROMPT` | 系统提示词、角色定义 | SOUL.md、AGENTS.md | +| 内存 | `MEMORY` | 知识库、上下文 | RAG文档、内存文件 | +| 模型 | `MODEL` | 微调、LoRA适配器 | LoRA、模型权重 | +| API | `API` | 外部服务端点认证 | 端点完整性 | + +### 信任等级 +根据抵押金额和审计员数量,资源被划分为不同的信任等级: + +| 等级 | 最低抵押金额 | 审计员数量 | 最低持续时间 | 徽章 | +|------|--------------|------------|--------------|-------| +| 未验证 | 0 | 0 | — | ⚠️ | +| 审核过 | ≥100 $ISNAD | 1+ | — | 🔍 | +| 验证过 | ≥1,000 $ISNAD | 2+ | 14天 | ✅ | +| 可信 | ≥10,000 $ISNAD | 3+ | 60天 | 🛡️ | +| 认证 | ≥50,000 $ISNAD | 5+ | 180天 | 💎 | + +### 抵押机制 +审计员选择抵押期限(30-180天)并获得相应的年化收益率(APY): + +| 抵押期限 | 基础APY | 可能被没收的时间窗口 | +|----------|---------|----------------------| +| 30天 | 5% | 30天 | +| 90天 | 8% | 90天 | +| 180天 | 12% | 180天 | + +### 没收机制 +根据恶意程度,不同比例的抵押金额将被没收: + +| 严重程度 | 没收金额 | 标准 | 可上诉 | +|----------|----------|-------|--------| +| 严重 | 100% | 凭证泄露、数据外泄、远程代码执行 | 是 | +| 高 | 50% | 可利用的安全漏洞 | 是 | +| 中 | 10% | 非可利用但有安全影响的漏洞 | 是 | +| 低 | 0% | 最佳实践违规 | 否 | + +--- + +## 技术细节 + +### 链上铭文 +$ISNAD 将资源和认证直接铭刻在 Base L2 链上,形成永久、不可篡改的记录: + +- **永久性**:内容永久存储在链上 +- **去中心化**:无需依赖IPFS或服务器 +- **可验证**:交易哈希证明内容完整性 +- **低成本**:Base L2 计算数据成本约 $0.001-0.01/KB + +### 铭文格式 +每个铭文包含以下结构: + +``` +┌─────────────────────────────────────────────────────────────┐ +│ ISNAD 铭文 v1 │ +├─────────────────────────────────────────────────────────────┤ +│ 魔术字: "ISNAD" (5字节) │ +│ 版本: 0x01 (1字节) │ +│ 类型: uint8 (1字节) - 资源类型 │ +│ 标志位: uint16 (2字节) - 功能标志 │ +│ 元数据: 长度前缀 (可变) - JSON元数据 │ +│ 内容: 剩余字节 (可变) - 原始内容 │ +└─────────────────────────────────────────────────────────────┘ +``` + +### 类型代码 +| 代码 | 类型 | 描述 | +|------|------|-------------| +| 0x01 | 技能 | 可执行代码 | +| 0x02 | 配置 | 配置文件 | +| 0x03 | 提示词 | 系统提示词、角色定义 | +| 0x04 | 内存 | 知识、上下文 | +| 0x05 | 模型 | 模型权重、适配器 | +| 0x06 | API | 端点认证 | +| 0x10-0xFF | 保留 | 未来扩展 | + +### 标志位(位掩码) +| 标志位 | 描述 | +|--------|-------------| +| 0x0001 | 压缩 | 内容是gzip压缩的 | +| 0x0002 | 加密 | 内容是加密的,密钥在元数据中 | +| 0x0004 | 分片 | 内容分割在多个交易中 | +| 0x0008 | 不可变 | 不能被替代 | +| 0x0010 | 已弃用 | 被新版本替代 | + +--- + +## 如何参与 + +### 作为用户 +1. 查看资源的信任评分 +2. 仅安装信任等级为“验证过”或以上的资源 +3. 通过代理配置文件设置自动信任策略 + +### 作为审计员 +1. 审查资源并抵押$ISNAD代币 +2. 选择适当的抵押期限(30-180天) +3. 如果发现问题,资源将被没收,您的抵押金额将被部分或全部没收 +4. 如果资源保持安全,您将获得收益 + +### 作为开发者 +1. 将您的资源铭刻在Base L2上 +2. 为每个版本创建单独的铭文 +3. 通过$ISNAD协议获取社区认证 + +--- + +## 为什么选择$ISNAD? + +- **经济激励**:审计员通过抵押代币承担风险,获得收益 +- **去中心化**:无需信任第三方,信任由市场决定 +- **透明**:所有认证和资源都在链上可查 +- **可扩展**:适用于任何AI资源类型 +- **安全**:多层检测机制防止恶意行为 + +--- diff --git a/docs/workflows/auditor-guide.md b/docs/workflows/auditor-guide.md new file mode 100644 index 00000000..ae859f1c --- /dev/null +++ b/docs/workflows/auditor-guide.md @@ -0,0 +1,103 @@ + + +# AI Auditor Workflow Guide + +## Overview +The $ISNAD protocol provides a decentralized trust layer for AI agents by allowing auditors to verify the safety of AI resources through a proof-of-stake attestation system. Auditors stake $ISNAD tokens to vouch for the safety of resources, and malicious resources result in slashing of staked tokens. + +--- + +## Stake Requirements + +Auditors must meet specific stake requirements to attest to AI resources, which are categorized into different trust tiers: + +| Tier | Stake Required | Auditor Diversity | Time Clean | Badge | +|--------------|----------------|-------------------|------------|--------| +| UNVERIFIED | 0 $ISNAD | 0 | — | ⚠️ | +| REVIEWED | ≥100 $ISNAD | 1+ auditor | — | 🔍 | +| VERIFIED | ≥1,000 $ISNAD | 2+ auditors | 14 days | ✅ | +| TRUSTED | ≥10,000 $ISNAD | 3+ auditors | 60 days | 🛡️ | +| CERTIFIED | ≥50,000 $ISNAD | 5+ auditors | 180 days | 💎 | + +**Key Requirements:** +- Higher tiers require multiple independent auditors to prevent single-party manipulation +- Auditors must have different funding sources (no common wallet in transaction history) +- Higher tiers unlock priority placement in resource registries and integration with agent frameworks + +--- + +## Verification Process + +The verification process is a multi-layered approach to ensure the safety of AI resources: + +### 1. Resource Inscription +- AI resources are inscribed on Base L2 with their content and metadata +- Each resource has a unique hash that serves as its identifier + +### 2. Automated Scanning (Layer 1) +- A decentralized network of scanner nodes performs automated detection +- Techniques include: + - YARA rules for pattern matching + - Static analysis of the AST + - Dependency audits for known vulnerabilities + - Behavioral sandboxing with honeypot credentials + - LLM analysis for semantic review + - Diff analysis to detect changes in updates + +### 3. Community Flagging (Layer 2) +- Any agent can flag a resource with evidence +- Requires staking 50 $ISNAD as an anti-griefing measure +- Evidence is permanently verifiable through on-chain inscriptions + +### 4. Auditor Jury (Layer 3) +- When a flag is raised, a random selection of 7 auditors (weighted by reputation) reviews the evidence +- Each juror votes on whether the resource is MALICIOUS, CLEAN, or ABSTAIN +- A supermajority (5/7) is required for a verdict +- Jury selection criteria: + - Must have >90% historical accuracy + - Must not have staked on the flagged resource + - Must not share funding source with flagger or resource author + - Randomness from block hash + VRF + +### 5. Appeals Court (Layer 4) +- Losing party can appeal within 24 hours +- Requires staking 500 $ISNAD +- New jury of 11 auditors is selected +- Final verdict is binding + +--- + +## Slashing Conditions + +If a resource is found to be malicious, auditors who staked on that resource may face slashing of their tokens: + +| Severity | Slash Amount | Criteria | Appeal? | +|---------------|--------------|-----------------------------------|---------| +| Critical | 100% | Credential theft, data exfiltration, RCE | Yes | +| High | 50% | Exploitable security flaw | Yes | +| Medium | 10% | Non-exploitable bug with security implications | Yes | +| Low | 0% (warning) | Best practice violation | No | + +**Staking Economics:** +- Auditors choose their lock period when staking (30, 90, or 180 days) +- Longer lock periods signal higher confidence and earn higher yield +- Yield is distributed from a reward pool funded by slashed stakes and protocol inflation + +**Stake Caps:** +- Maximum stake per auditor per resource: 10,000 $ISNAD +- Maximum percentage of resource's total stake: 33% +- Minimum auditors for VERIFIED+ tiers: As specified in the trust tiers table + +--- + +## Becoming an Auditor + +To become an auditor: +1. Stake $ISNAD tokens to attest to the safety of AI resources +2. Review resources through the automated scanning tools +3. Participate in the jury system when flags are raised +4. Maintain a high historical accuracy rate (>90%) to remain eligible for jury selection +5. Choose appropriate lock periods based on your confidence level in the resource + +Auditors earn yield from the reward pool when resources remain clean and are slashed when malicious resources are detected. + diff --git a/docs/zh/auditor-jury.zh.md b/docs/zh/auditor-jury.zh.md new file mode 100644 index 00000000..8c15c8ff --- /dev/null +++ b/docs/zh/auditor-jury.zh.md @@ -0,0 +1,144 @@ + +# 陪审团选举机制 + +当一个资源被标记为潜在恶意时,由随机选出的审计员组成的陪审团将审查证据并投票决定判决。 + +## 标记资源 + +任何人都可以标记他们认为恶意的资源: + +1. **存款100 $ISNAD** — 防止垃圾标记 +2. **提供证据** — 描述恶意行为 +3. **等待陪审团审理** — 随机选出5名审计员 + +### 存款结果 + +| 判决 | 存款退还 | +|------|----------| +| 有罪 | 100% 退还 + 从没收抵押品中获得奖励 | +| 无罪 | 90% 退还 | +| 驳回(无超级多数) | 50% 退还 | + +## 陪审团选举 + +当提交标记时: + +1. **随机选出5名审计员** +2. **冲突检查** — 陪审团成员不能持有被标记资源的抵押品 +3. **链上随机性** — 生产环境中使用VRF(可验证随机函数)进行选择 +4. **7天期限** — 陪审团成员有7天时间审查并投票 + +### 陪审团成员要求 + +- 必须是活跃的审计员(至少有一个认证) +- 不能持有被审判的资源的抵押品 +- 应该展示出专业能力(历史准确性) + +## 投票流程 + +每位陪审团成员将审查: + +- 资源内容(链上刻录) +- 标记者的证据 +- 资源的元数据和声明 + +然后进行投票: + +- **有罪** — 资源恶意 +- **无罪** — 资源安全 +- **弃权** — 无法确定(计入出席但不影响判决) + +### 判决要求 + +**超级多数(≥67%)** 所需: + +- 如果4名以上陪审团成员投票**有罪** → 有罪判决 +- 如果4名以上陪审团成员投票**无罪** → 无罪判决 +- 否则 → 驳回(无超级多数) + +## 判决结果 + +### 有罪 + +- **所有资源抵押品** 被焚毁 +- **标记者** 退还存款并获得部分焚毁抵押品 +- **审计员** 失去所有抵押品 +- **资源** 被链上标记为恶意 + +### 无罪 + +- **抵押品** 保持锁定状态 +- **标记者** 退还90%的存款 +- **审计员** 继续获得收益 +- **资源** 保持不变的信任评分 + +### 驳回 + +- **抵押品** 保持锁定状态 +- **标记者** 退还50%的存款 +- **资源** 可以再次提交新的证据进行标记 + +## 上诉 + +判决可以在3天内上诉: + +1. **存款2倍** 原始标记金额(200 $ISNAD) +2. **新陪审团** 重新审理 +3. **上诉判决** 为最终判决 — 不再允许进一步上诉 + +### 谁可以上诉 + +- 原始标记者(如果判决为无罪) +- 资源的任何抵押者(如果判决为有罪) +- 任何具有足够存款的第三方 + +## 时间线 + +| 事件 | 期限 | +|------|------| +| 陪审团选举 | 标记后立即 | +| 陪审团投票期 | 7天 | +| 上诉窗口 | 判决后3天 | +| 上诉审理 | 7天 | +| 执行 | 最终判决后立即 | + +## 陪审团激励 + +投票与多数意见一致的陪审团成员将获得: + +- 来自协议财政的小额奖励 +- 声誉提升(影响未来陪审团选举) + +投票与多数意见相反的陪审团成员: + +- 没有惩罚(诚实的意见分歧是预期的) +- 但持续的异议投票可能会影响声誉 + +## 安全考虑 + +### 防止串谋 + +- 随机陪审团选举使协调变得困难 +- 陪审团成员在截止日期前不会知道彼此的投票 +- 大量抵押品风险阻止串谋 + +### 防止伪造身份 + +- 成为陪审团成员需要是活跃的审计员 +- 创建假审计员需要真实的资本(抵押) +- 历史准确性影响选举 + +### 上诉安全 + +- 上诉需要更高的存款防止滥用 +- 新陪审团确保新的视角 +- 最终性防止无限上诉循环 + +## 陪审团成员最佳实践 + +1. **仔细审查** — 在投票前阅读所有证据 +2. **保持客观** — 根据证据而不是关系进行投票 +3. **按时完成** — 迟到的投票不计入 +4. **记录理由** — 备案以备上诉时使用 +5. **积极参与** — 陪审团职责对协议健康至关重要 +