内容
<div align="center">
<img src="./public/axiomid-banner-v2.jpg" alt="AxiomID Banner: Human Sovereign and AI Agent" width="100%" style="border-radius: 12px; margin-bottom: 20px;" />
</div>
<h1 align="center">
AxiomID:可移植的AI智能体身份凭证
</h1>
<p align="center">
<em>你可以把它想象成AI智能体的USB描述符 —— 它告诉其他智能体和系统,这个智能体是谁,它的资源在哪里,以及它能做什么。</em>
</p>
<p align="center">
<a href="https://axiomid.app"><b>在线应用</b></a> ·
<a href="https://axiomid.app/docs"><b>文档</b></a> ·
<a href="https://axiomid.app/passport/demo"><b>演示护照</b></a> ·
<a href="https://axiomid.app/leaderboard"><b>排行榜</b></a> ·
<a href="https://github.com/Moeabdelaziz007/AxiomID"><b>GitHub</b></a> ·
<a href="https://www.facebook.com/profile.php?id=61583477974464"><b>Facebook</b></a>
</p>
<p align="center">
<a href="https://github.com/Moeabdelaziz007/AxiomID/actions"><img src="https://img.shields.io/github/actions/workflow/status/Moeabdelaziz007/AxiomID/ci.yml?branch=main&label=CI&style=flat-square" alt="CI" /></a>
<img src="https://img.shields.io/badge/Next.js-16-black?style=flat-square" alt="Next.js" />
<img src="https://img.shields.io/badge/Pi%20Browser-supported-8b5cf6?style=flat-square" alt="Pi Browser" />
<img src="https://img.shields.io/badge/tests-3786%20passed-22c55e?style=flat-square" alt="Tests Passed" />
<img src="https://img.shields.io/badge/TypeScript-strict-blue?style=flat-square" alt="TypeScript Strict" />
<img src="https://img.shields.io/badge/SOUL%20Protocol-compliant-emerald?style=flat-square" alt="SOUL Compliant" />
<img src="https://img.shields.io/badge/OpenIdentity-v0.1-6366f1?style=flat-square" alt="OpenIdentity v0.1" />
</p>
---
# 工具列表
## AxiomID 是 OpenIdentity 协议的参考实现 —— 一种开放的、可移植的 AI 智能体身份层。在智能体对话(A2A)、智能体使用工具(MCP)、智能体交易之前 —— 它们需要知道它们正在与谁交互。AxiomID 回答了这个问题。
### 协议景观
| 协议 | 层 | 目的 |
|----------|-------|---------|
| **A2A** (谷歌) | 交互 | 智能体如何 **对话** |
| **MCP** (Anthropic) | 能力 | 智能体如何 **使用工具** |
| **OpenIdentity** | 身份 | 智能体 **是谁** |
| **KYA** (Know Your Agent) | 信任 | 智能体如何 **证明** |
## 阅读规范
- **[OpenIdentity 清单](docs/openidentity/OpenIdentity.md)** — `/.well-known/openidentity.md` 引导格式(Markdown + YAML 前置)
- **[KYA 协议](docs/openidentity/KYA.md)** — 多提供商验证链,用于智能体-人类信任
- **[智能体护照](docs/openidentity/AgentPassport.md)** — `/.well-known/passport.md` 处的完整基因组文档
- **[JSON 模式](docs/openidentity/openidentity.schema.json)** — 所有 OpenIdentity 资源的验证模式
## 当前可用功能
- **OpenIdentity 规范 v0.1** — 可移植的 AI 智能体身份开放标准
- **KYA 验证** — Pi Network 作为参考 KYC 提供商;设计了多提供商架构
- **智能体护照** — `/.well-known/passport.md` 处的便携式智能体基因组,包含信任链、能力和内存层引用
- **A2A 智能体卡** — `/.well-known/agent-card.json` 用于谷歌 A2A 发现
- **知名端点** — `auth.md`、`skills.md`、`wallet.md`、`openidentity.md` 在 `/.well-known/` 下
- **Pi 浏览器身份验证** — 登录、KYC 同意和支付流程
- **声明向导** — 创建智能体身份的引导流程
- **仪表板** — 管理身份、印章、KYA、钱包和智能体设置
- **身份浏览器** — 按能力和认证发现和验证智能体
- **消费请求** — 智能体 Pi 支付管道(智能体请求,用户批准,Pi SDK 执行)
- **信任链** — 所有智能体操作的追加哈希链
- **真相 RAG** — 通过 Vectorize + Workers AI 对 6236 节进行 AI 驱动的问答
- **MCP 服务器** — 10 种用于信任、存在和身份管理的工具
## 路由
| 路由 | 目的 |
|:---|:---|
| `/` | 登录体验和入口点 |
| `/claim` | 身份声明向导 |
| `/onboarding` | 新用户引导流程 |
| `/passport/[slug]` | 公共护照查看器 |
| `/dashboard` | 身份验证仪表板 |
| `/dashboard/settings` | 用户设置和 VC 查看器 |
| `/agent/[username]` | 公共智能体配置文件 |
| `/explorer` | 身份浏览器 — 发现和验证智能体 |
| `/leaderboard` | 排名信任和活动视图 |
| `/docs` | 产品和 API 文档 |
| `/status` | 服务健康和依赖状态 |
| `/about` | 关于 AxiomID |
| `/privacy` | 隐私政策 |
| `/terms` | 服务条款 |
### 知名端点
| 端点 | 格式 | 目的 |
|:---------|:-------|:--------|
| `/.well-known/openidentity.md` | Markdown + YAML | 引导身份清单 |
| `/.well-known/passport.md` | Markdown + YAML | 完整的智能体基因组 |
| `/.well-known/agent-card.json` | JSON(A2A v1.0) | A2A 智能体卡目录 |
| `/.well-known/auth.md` | Markdown | 身份验证方法 |
| `/.well-known/skills.md` | Markdown | 平台技能 |
| `/.well-known/wallet.md` | Markdown | 钱包能力 |
### API 路由
| 端点 | 目的 |
|:---|:---|
| `/api/auth/*` | Pi 浏览器身份验证、连接、注销、状态 |
| `/api/passport/*` | 护照 CRUD、发布、验证 |
| `/api/agent/*` | 智能体身份、签名、激活、暂停、清单 |
| `/api/agents` | 列出已验证用户的智能体 |
| `/api/pi/*` | Pi 支付、KYA 声明、广告验证 |
| `/api/spend-request` | 创建、列出、批准消费请求 + SSE 流 |
| `/api/health` | 健康检查 |
| `/api/status` | 协议指标:用户、智能体、XP、支付 |
| `/api/explorer` | 身份浏览器数据和统计 |
| `/api/leaderboard` | 按 XP 排名的 top 用户 |
| `/api/diagnostics/*` | 错误捕获和日志 |
| `/api/sandbox/*` | 沙盒开发令牌和代码执行 |
| `/api/stamp/*` | 印章声明 |
| `/api/sync` | 边缘到 PostgreSQL 同步 |
| `/api/telegram` | Telegram 机器人集成 |
| `/api/vault/stake` | 保险库质押 |
| `/api/credential-status` | 凭证吊销检查 |
| `/api/upload/presign` | 预签名上传 URL |
| `/api/presence/heartbeat` | 存在心跳 |
## 技术栈
| 层 | 技术 |
|:---|:---|
| **前端** | Next.js 16 · React 19 · Framer Motion 12 · Tailwind 4 |
| **后端** | Vercel 无服务器 · Cloudflare Workers |
| **数据库** | PostgreSQL(Prisma 6)· D1(边缘同步)· Vectorize(语义搜索) |
| **缓存** | Upstash Redis(速率限制、会话状态) |
| **AI** | Workers AI — Llama 3.1 8B · BGE-base-en-v1.5 |
| **身份验证** | Pi Network SDK · Ed25519 主权密钥 · W3C DID |
| **存储** | Cloudflare KV · Vercel Blob |
| **状态/缓存** | TanStack Query v5(客户端缓存) |
| **CI/CD** | GitHub Actions → Vercel · 3786 测试 |
## 快速入门
```bash
git clone https://github.com/Moeabdelaziz007/AxiomID.git
cd AxiomID
npm install
cp .env.example .env.local
# 填写:DATABASE_URL, PI_API_KEY, SOVEREIGN_KEY_SALT, auth secrets
npx prisma migrate deploy && npx prisma generate
npm run dev
```
打开 http://localhost:3000。
### Pi 浏览器本地 HTTPS
Pi SDK 浏览器中需要 HTTPS。对于本地开发,使用 portless:
```bash
npm install -g portless
portless axiomid next dev
# -> https://axiomid.localhost
```
### 后端(Cloudflare Worker)
```bash
cd backend && npm install
npx wrangler d1 execute axiomid-edge --remote --file=./migrations/0001_init.sql
echo "token" | npx wrangler secret put SHARED_SECRET_TOKEN_VERCEL_CF
npx wrangler deploy
```
## 验证和质量检查
```bash
npm run lint # 0 个错误,0 个警告
npm run type-check # 类型检查
npm test # 3786 测试(一些页面测试需要 QueryClientProvider 包装器)
```
## 开发者工具
| 工具 | 目的 | 用法 |
|------|---------|-------|
| **portless** | 稳定的 HTTPS `.localhost` URL,用于 Pi 浏览器测试 | `portless axiomid next dev` → `https://axiomid.localhost` |
| **emulate** | 本地 API 模拟器,用于确定性 CI 测试 | `npx emulate --service github` → `http://localhost:4001` |
| **kernel** | 关键流程的无头浏览器烟雾测试 | `kernel run qa:smoke --url https://axiomid-app.vercel.app` |
| **nostics** | 带有操作性修复的结构化错误代码 | `src/diagnostics/catalog.ts` 中的代码 |
> 查看 `AGENTS.md` → "开发工具" 部分以获取完整文档。
## 项目结构
```
src/
app/
.well-known/ # OpenIdentity 资源(openidentity.md, passport.md, agent-card, etc.)
api/ # 路由处理程序(Next.js App Router)
dashboard/ # 身份验证仪表板
passport/ # 公共护照查看器 /passport/[slug]
components/ # 共享 UI 组件
lib/ # 身份验证、加密、Pi SDK、验证器、实用程序
i18n/ # 翻译文件(en.json, ar.json)
prisma/ # 模式和迁移
docs/
openidentity/ # 规范文档
OpenIdentity.md
KYA.md
AgentPassport.md
openidentity.schema.json
AxiomID.Memory/ # 知识库和设计文档
```
## 信任层
| 层 | XP | 访问权限 |
|:---|:---:|:---|
| **访客** | 0 | 有限。基本只读。 |
| **公民** | 100 | 社会印章,基本智能体访问。 |
| **验证者** | 500 | 智能体委托,高级能力。 |
| **主权者** | 1000 | 完全信任,保险库质押,推荐权力。 |
## AxiomID 的功能
| 层 | 它做什么 |
|:---|:---|
| **OpenIdentity** | AI 智能体的可移植身份清单(/.well-known/openidentity.md) |
| **智能体护照** | 完整的基因组文档,包含信任链、能力、内存引用 |
| **KYA** | 多提供商验证链接智能体 → 人类 → 身份提供商 |
| **智能体卡(A2A)** | 发现目录,按 Google A2A v1.0 |
| **可验证凭证** | 加密签名的印章(社交,KYA,KYC) |
| **信任链** | 所有智能体操作的追加哈希链 |
| **MCP 服务器** | 10 种用于信任、存在和身份管理的工具 |
| **真相 RAG** | 通过 Vectorize + Workers AI 对 6236 节进行 AI 驱动的问答 |
| **Soul System** | 六门道伦理评估循环 |
## OpenIdentity 协议
### 什么是 OpenIdentity
**OpenIdentity** 是 AI 智能体的可移植身份清单规范 —— 可以把它想象成 **AI 智能体的 USB 描述符**。它将身份、人类验证、角色、技能、MCP 工具、A2A 元数据、内存链接、钱包引用和授权指针合并到一个安全、可共享的文件中。任何兼容的平台都可以读取 OpenIdentity 清单并立即了解智能体是什么、谁控制它、它可以做什么以及其批准的内存和工具的位置。
OpenIdentity 由与 AxiomID 1 创始人 [Mohamed Abdelaziz](https://github.com/Moeabdelaziz007) 创建,并托管在 [github.com/Moeabdelaziz007/openidentity.md](https://github.com/Moeabdelaziz007/openidentity.md)。
> **简短版本:** OpenIdentity 是 AI 智能体身份的发现层。
>
> **USB 类比:** 类似于 AI 智能体的 USB 描述符,OpenIdentity 让任何兼容的平台了解智能体是什么、谁控制它、它可以做什么以及其批准的内存和工具位于哪里。
### OpenIdentity 如何被 AxiomID 使用
AxiomID 是 OpenIdentity 规范的 **参考实现**:
- 每个 AxiomID 上的智能体都有一个 OpenIdentity 清单,描述其身份、控制器、能力以及批准的资源。
- 清单在 `/.well-known/openidentity` 端点提供机器和平台发现。
- 其他平台可以获取清单以了解智能体 *之前* 授予访问权限或信任其声明。
- 清单格式是可移植的 - 它适用于 GitHub、AxiomID 配置文件、网站和智能体运行时。
- 结构化字段根据 [OpenIdentity JSON 模式](https://github.com/Moeabdelaziz007/openidentity.md/blob/main/schema/openidentity.schema.json) 进行验证;人类可读的 Markdown 正文是格式的第一类部分。
### did:axiom DID 方法
AxiomID 使用 `did:axiom` 作为其 **原生 DID 方法** —— 一种符合 W3C 的去中心化标识符方法,锚定在 Pi Network 上,使用 Ed25519 加密密钥。
| DID 形式 | 示例 | 用途 |
|:---|:---|:---|
| `did:axiom:pi:<username>` | `did:axiom:pi:moeabdelaziz007` | 人类可读的人类身份 |
| `did:axiom:pi:<hash>` | `did:axiom:pi:a1b2c3d4e5f6a7b8` | 隐私保护(哈希)身份 |
| `did:axiom:agent:<id>` | `did:axiom:agent:agt_33d7p` | AI 智能体身份 |
| `did:axiom:issuer` | `did:axiom:issuer` | AxiomID 凭证发行者(签署凭证) |
关键属性:
- **符合 W3C DID 核心规范** — 符合 [W3C DID 核心规范](https://www.w3.org/TR/did-core/)。
- **锚定在 Pi Network 上** — Pi Network 是人类 DID 的主要身份锚点;Pi 钱包地址可以出现在服务端点中。
- **Ed25519 密钥** — 通过 `HMAC-SHA256(SOVEREIGN_KEY_SALT, piUid + agentId)` 派生的确定性密钥对。
- **可选的 Stellar 锚定** — 凭证哈希可以作为交易备忘录锚定在 Stellar 上,提供额外的篡改证据(不是解析所需的)。
- **可解析** — 通过参考解析器:`https://axiomid.app/api/did-document?did={did}`。
- **隐私保护** — 哈希 DID 形式避免暴露用户名;DID 文档不包含除公钥和服务端点之外的任何 PII。
📖 完整规范: [did:axiom DID 方法规范 v0.1](https://github.com/Moeabdelaziz007/openidentity.md/blob/main/spec/did-axiom-method-v0.1.md)
### 架构:AxiomID ↔ OpenIdentity
```mermaid
graph LR
OI[OpenIdentity 规范] --> |定义清单格式| AX[AxiomID 应用]
AX --> |为以下对象生成清单| AG[AI 智能体]
AX --> |解析| DID[did:axiom DID]
DID --> |锚定到| PI[Pi Network]
AG --> |通过以下方式发现| OI
```
**如何阅读图表:** OpenIdentity 规范定义了清单格式。AxiomID(参考实现)为其托管的每个 AI 智能体生成 OpenIdentity 清单,并解析 `did:axiom` DID,这些 DID 锚定在 Pi Network 上。智能体然后通过其 OpenIdentity 清单被其他平台发现 — 闭环。
### OpenIdentity 清单示例
一个 AxiomID 智能体的清单如下所示:
```yaml
openidentity: "0.1"
agent:
id: "did:axiom:agent:agt_33d7p"
name: "Axiom 助手"
type: "ai-agent"
controller:
human:
name: "Mohamed Abdelaziz"
verification: "https://axiomid.app/passport/moeabdelaziz007"
capabilities:
roles: ["research", "workflow-automation"]
skills: ["identity-discovery", "memory-routing", "spend-request"]
verification:
- type: "signed-claim"
url: "https://axiomid.app/.well-known/openidentity/axiom-assistant.json"
mcp_tools:
- type: "mcp"
name: "axiom-tools"
url: "https://mcp.axiomid.app"
discovery:
memory:
- label: "approved-public-memory"
uri: "https://axiomid.app/memory/index.json"
access: "public-read"
wallets:
- type: "pi-wallet"
url: "https://axiomid.app/wallet/moeabdelaziz007"
authorization:
authorization_url: "https://axiomid.app/api/auth/authorize"
scopes:
- "read:public-profile"
- "request:tool-access"
links:
homepage: "https://axiomid.app"
axiomid_profile: "https://axiomid.app/agent/axiom-assistant"
```
> **安全注意事项:** 清单中 **不应** 包含私钥、密码、承载令牌、API 密钥、钱包种子短语或其他机密信息。敏感资源被 **引用** 而不是嵌入。消费者在依赖声明之前必须验证签名、域和发行者信任 — 未签名的清单是一个发现提示,而不是权威证明。
参见 [`examples/`](https://github.com/Moeabdelaziz007/openidentity.md/tree/main/examples) 获取最小、标准和完整清单示例。
### OpenIdentity 链接
- 📦 **规范仓库:** [github.com/Moeabdelaziz007/openidentity.md](https://github.com/Moeabdelaziz007/openidentity.md)
- 📖 **OpenIdentity v0.1 规范:** [spec/openidentity-v0.1.md](https://github.com/Moeabdelaziz007/openidentity.md/blob/main/spec/openidentity-v0.1.md)
- 🔑 **did:axiom DID 方法规范:** [spec/did-axiom-method-v0.1.md](https://github.com/Moeabdelaziz007/openidentity.md/blob/main/spec/did-axiom-method-v0.1.md)
- 🧪 **清单示例:** [examples/](https://github.com/Moeabdelaziz007/openidentity.md/tree/main/examples)
- 🌐 **前端原型:** [openidentity.md/frontend](https://github.com/Moeabdelaziz007/openidentity.md/tree/main/frontend)
- 🛠 **AxiomID 应用(参考实现):** [axiomid.app](https://axiomid.app)
## 贡献
参见 [`CONTRIBUTING.md`](./CONTRIBUTING.md)。PR 需要通过 CI。
```bash
git checkout -b feat/my-feature
# 进行更改
npm test && npm run lint && npx tsc --noEmit
git commit -m "feat(scope): description "
git push origin feat/my-feature
```
## 许可
- **应用程序代码:** 专有 — 2026 Mohamed Abdelaziz 保留所有权利。参见 [`LICENSE`](./LICENSE)。
- **`@axiomid/sdk`** 和 **`@axiomid/crypto`:** MIT 许可。开放社区使用。
## 构建者
<div align="center">
**AxiomID** 由 **Mohamed Abdelaziz** 构建 ([@Moeabdelaziz007](https://github.com/Moeabdelaziz007)).
在埃及开罗以热情构建。
<a href="https://github.com/Moeabdelaziz007/AxiomID/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Moeabdelaziz007/AxiomID" alt="贡献者" />
</a>
</div>
### 致谢
**Pi Network** — 感谢其身份验证 SDK 和人类中心化网络的愿景。更多信息请访问 [minepi.com](https://minepi.com).
<div align="center">
<a href="https://minepi.com">
<img src="https://img.shields.io/badge/Built%20with-Pi%20Network-8b5cf6?style=for-the-badge&logo=pi&logoColor=white" alt="Built with Pi Network" />
</a>
<a href="https://vercel.com">
<img src="https://img.shields.io/badge/Deployed%20on-Vercel-000000?style=for-the-badge&logo=vercel&logoColor=white" alt="Deployed on Vercel" />
</a>
<a href="https://www.cloudflare.com">
<img src="https://img.shields.io/badge/Powered%20by-Cloudflare-F38020?style=for-the-badge&logo=cloudflare&logoColor=white" alt="Powered by Cloudflare" />
</a>
<a href="https://github.com/vercel/next.js">
<img src="https://img.shields.io/badge/Built%20with-Next.js%2016-000000?style=for-the-badge&logo=next.js&logoColor=white" alt="Built with Next.js 16" />
</a>
</div>
---
<div align="center">
**[axiomid.app](https://axiomid.app)** · **[领取你的身份](https://axiomid.app/claim)** · **[阅读规范](docs/openidentity/OpenIdentity.md)**
<sub>秉承每个人都应该拥有一个主权数字身份的信念 — 每个智能体都应该拥有一个可验证的身份。</sub>
</div>
MCP 配置
以下是此 MCP Server 的配置信息,可直接复制到 Cursor 或其他 MCP 客户端中使用。
mcp.json
连接信息
猜你喜欢
暂无推荐服务器