- Add SessionEventRepository interface for append-only event storage - Implement PostgreSQL session_event_repo with immutable event log - Add database migration for session_events table with indexes - Record events for keygen and sign session creation - Record events for signing-config APIs (set, update, clear) - Wire up sessionEventRepo in main.go and account handler - Update API documentation with event sourcing design 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| 01-architecture.md | ||
| 02-api-reference.md | ||
| 03-development-guide.md | ||
| 04-testing-guide.md | ||
| 05-deployment-guide.md | ||
| 06-tss-protocol.md | ||
| IMPLEMENTATION_SUMMARY.txt | ||
| MPC_FINAL_VERIFICATION_REPORT.txt | ||
| MPC_SYSTEM_VERIFICATION.md | ||
| README.md | ||
| api-flows.md | ||
README.md
MPC 分布式签名系统文档
文档目录
| 文档 | 说明 | 适用读者 |
|---|---|---|
| 01-architecture.md | 系统架构设计 | 架构师、技术负责人 |
| 02-api-reference.md | API 接口文档 | 后端开发、前端开发、集成工程师 |
| 03-development-guide.md | 开发指南 | 后端开发 |
| 04-testing-guide.md | 测试指南 | 测试工程师、开发人员 |
| 05-deployment-guide.md | 部署指南 | 运维工程师、DevOps |
| 06-tss-protocol.md | TSS 协议详解 | 密码学工程师、安全研究员 |
快速开始
1. 环境要求
- Go 1.21+
- Docker 20.10+
- Docker Compose 2.0+
2. 本地运行
# 克隆项目
git clone https://github.com/rwadurian/mpc-system.git
cd mpc-system
# 安装依赖
make init
# 启动服务
docker-compose up -d
# 运行测试
make test
3. 验证安装
# 健康检查
curl http://localhost:8080/health
# 运行集成测试
go test -v ./tests/integration/... -run "TestFull2of3MPCFlow"
系统概览
┌─────────────────────────────────────────────────────────────────────┐
│ MPC 分布式签名系统 │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Account │ │ Session │ │ Message │ │
│ │ Service │───►│ Coordinator │───►│ Router │ │
│ │ 账户管理 │ │ 会话协调 │ │ 消息路由 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌──────────────┐ │ │
│ │ │ Server Party │◄────────────┘ │
│ │ │ ×3 实例 │ │
│ │ │ TSS 计算 │ │
│ │ └──────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ PostgreSQL + Redis │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
核心功能
阈值签名支持
| 方案 | 密钥生成 | 签名 | 状态 |
|---|---|---|---|
| 2-of-3 | 3 方 | 任意 2 方 | ✅ 已验证 |
| 3-of-5 | 5 方 | 任意 3 方 | ✅ 已验证 |
| 4-of-7 | 7 方 | 任意 4 方 | ✅ 已验证 |
安全特性
- ✅ ECDSA secp256k1 (以太坊/比特币兼容)
- ✅ 密钥分片 AES-256-GCM 加密存储
- ✅ 无单点密钥暴露
- ✅ 门限安全性保证
测试报告
最新测试结果:
=== 2-of-3 MPC 流程测试 ===
✅ 密钥生成: PASSED (92s)
✅ 签名组合 0+1: PASSED
✅ 签名组合 0+2: PASSED
✅ 签名组合 1+2: PASSED
✅ 安全性验证: PASSED
=== 3-of-5 MPC 流程测试 ===
✅ 密钥生成: PASSED (198s)
✅ 5 种签名组合: ALL PASSED
=== 4-of-7 MPC 流程测试 ===
✅ 密钥生成: PASSED (221s)
✅ 多种签名组合: ALL PASSED
✅ 安全性验证: 3 方无法签名
技术支持
- 问题反馈: GitHub Issues
- 文档更新: 提交 PR 到
docs/目录
版本历史
| 版本 | 日期 | 更新内容 |
|---|---|---|
| 1.0.0 | 2024-01 | 初始版本,支持 2-of-3 |
| 1.1.0 | 2024-01 | 添加 3-of-5, 4-of-7 支持 |