Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
@@ -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资源类型
- **安全**:多层检测机制防止恶意行为

---
103 changes: 103 additions & 0 deletions docs/workflows/auditor-guide.md
Original file line number Diff line number Diff line change
@@ -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.

43 changes: 43 additions & 0 deletions docs/zh/consensus-verdicts.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@


# 一致性与裁决

## 审计投票聚合机制

在 ISNAD 协议中,审计人通过投票决定最终的协议裁决。以下是审计投票聚合的详细说明:

1. **投票过程**:
- 每个审计人独立地对区块链状态进行观察并进行投票。
- 审计人可以选择支持(+1)、反对(-1)或弃权(0)。

2. **投票权重**:
- 审计人的投票权重基于其在网络中的贡献度,例如参与的区块数量、网络连接稳定性以及历史表现。
- 权重越高的审计人,其投票对最终裁决的影响力越大。

3. **聚合规则**:
- 所有审计人的投票结果会根据其权重进行加权汇总。
- 计算支持票的总权重和反对票的总权重。
- 如果支持票的总权重大于反对票的总权重,最终裁决为“支持”。
- 如果反对票的总权重大于支持票的总权重,最终裁决为“反对”。
- 如果支持票和反对票的总权重相等,则裁决为“弃权”或需要进一步的审计过程。

4. **最终裁决**:
- 最终裁决决定区块是否被接受到区块链中。
- 支持裁决:区块被接受。
- 反对裁决:区块被拒绝。
- 弃权裁决:可能需要重新审计或由其他机制决定。

## 示例

假设有三个审计人,其权重分别为 3、2 和 1:

- 审计人 A(权重 3)投票支持(+1)
- 审计人 B(权重 2)投票反对(-1)
- 审计人 C(权重 1)投票支持(+1)

计算结果:
- 支持票总权重 = 3 + 1 = 4
- 反对票总权重 = 2

最终裁决为“支持”,因为支持票的总权重大于反对票的总权重。