
Legionは、プライバシーを重視して構築されたゼロ知識認証ファブリックです。
ハードウェアにバインドされたデバイスリング署名による真のゼロ知識認証
Legionは、あなたが誰であるかを明かすことなく、あなたが認可されていることを証明するゼロ知識認証システムです。 あなたは公開データに基づいて何かを証明し、現在のアクションをあなたの公開アドレスに結び付けません。
| プロパティ | 保証 |
|---|---|
| ユーザー匿名性 | 2^20分の1(1,048,576) |
| デバイス匿名性 | 2^10分の1(1,024) |
| 健全性エラー | 2^-128 |
| 証明システム | Halo2 PLONK |
| パスワードハッシュ | Argon2id |
| ハードウェアバインディング | WebAuthn Level 2 |
| レート制限 | 1時間あたり5回の試行 |
| デバイス失効 | 即時ブラックリスト |
# Clone and run
git clone https://github.com/deadends/legion.git
cd legion
# Linux/macOS
chmod +x install.sh && ./install.sh
# Windows
install.bat
以上です! ブラウザで http://localhost を開いてください。
パフォーマンス: 登録 約10秒、認証 約4分(k=16 証明生成)
# 1. Install Redis
# macOS: brew install redis && redis-server
# Ubuntu: sudo apt install redis && redis-server
# Windows: https://redis.io/docs/install/install-redis/install-redis-on-windows/
# 2. Run server (terminal 1)
cd legion-server
cargo run --release --features redis
# 3. Build frontend (terminal 2)
cd wasm-client
wasm-pack build --target web --release
python3 -m http.server 8000
# 4. Open http://localhost:8000
本番環境へのデプロイについては、DEPLOYMENT.md を参照してください。
| セキュリティレベル | k | 証明時間 | 証明サイズ | ユースケース |
|---|---|---|---|---|
| テスト | 12 | 約10秒 | 2.5 KB | 開発 |
| 標準 | 14 | 約60秒 | 3.0 KB | ステージング |
| 本番 | 16 | 約4分 | 3.5 KB | 推奨 |
| 高セキュリティ | 18 | 約15分 | 4.0 KB | エンタープライズ |
📖 暗号技術の詳細を含む段階的な認証フローの詳細については、ARCHITECTURE_FLOW.md を参照してください
┌──────────────────────────────────────────────────────────────────────────┐
│ CLIENT (Browser) │
├──────────────────────────────────────────────────────────────────────────┤
│ ┌────────────────┐ ┌─────────────────┐ ┌──────────────────────────┐ │
│ │ UI Layer │ │ WASM Module │ │ Hardware Security │ │
│ │ (Vanilla JS) │ │ (Rust→WASM) │ │ (WebAuthn Level 2) │ │
│ ├────────────────┤ ├─────────────────┤ ├──────────────────────────┤ │
│ │ • Registration │ │ • Blake3 Hash │ │ • TPM 2.0 │ │
│ │ • Login Form │ │ • Argon2id KDF │ │ • Secure Enclave │ │
│ │ • Session UI │ │ • Halo2 Prover │ │ • FIDO2 Authenticator │ │
│ │ • Error Handle │ │ • Merkle Proof │ │ • Device Private Key │ │
│ └────────────────┘ └─────────────────┘ └──────────────────────────┘ │
└────────────────────────────────┬─────────────────────────────────────────┘
│ HTTPS/TLS 1.3
│ (Encrypted Channel)
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ REVERSE PROXY (Nginx) │
├──────────────────────────────────────────────────────────────────────────┤
│ • TLS Termination • Rate Limiting (100 req/min) │
│ • Load Balancing • Request Logging │
│ • Static File Serving • Security Headers (CSP, HSTS) │
└────────────────────────────────┬─────────────────────────────────────────┘
│ HTTP (Internal Network)
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ LEGION SERVER (Rust/Axum) │
├──────────────────────────────────────────────────────────────────────────┤
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ API Layer (Axum) │ │
│ ├─────────────────────────────────────────────────────────────────┤ │
│ │ POST /register │ POST /auth/challenge │ POST /auth/verify│ │
│ │ POST /auth/session │ GET /health │ POST /logout │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Business Logic Layer │ │
│ ├─────────────────────────────────────────────────────────────────┤ │
│ │ • Credential Manager │ • Challenge Generator (32-byte random)│ │
│ │ • Merkle Tree Builder │ • Nullifier Tracker (replay protection)│ │
│ │ • ZK Proof Verifier │ • Session Manager (linkability tags) │ │
│ │ • Device Tree Manager │ • Timestamp Validator (±5min window) │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Cryptographic Layer │ │
│ ├─────────────────────────────────────────────────────────────────┤ │
│ │ • Halo2 Verifier (PLONK) │ • Poseidon Hash (ZK-friendly) │ │
│ │ • Blake3 (credential hash)│ • Argon2id (password KDF) │ │
│ │ • Merkle Tree (2^20 users)│ • Device Tree (2^10 devices/user) │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└────────────────────────┬──────────────────────┬──────────────────────────┘
│ │
▼ ▼
┌────────────────────────┐ ┌───────────────────────────┐
│ Redis (In-Memory) │ │ RocksDB (Persistent) │
├────────────────────────┤ ├───────────────────────────┤
│ • Session Tokens │ │ • User Credentials │
│ • Linkability Tags │ │ • Merkle Tree Nodes │
│ • Active Challenges │ │ • Device Trees │
│ • Nullifier Cache │ │ • Nullifier History │
│ TTL: 1 hour │ │ Persistent Storage │
└────────────────────────┘ └───────────────────────────┘