|
1 | | -# Ratatoskr Implementation Plan |
| 1 | +# Ratatoskr Implementation Roadmap |
2 | 2 |
|
3 | | -## Phase 1: Foundation (Core & SOS) |
4 | | -Goal: Establish the architectural skeleton, basic P2P connectivity, and the critical "Black Box SOS" feature. |
| 3 | +## ✅ Phase 1: Foundation (Core & SOS) |
| 4 | +**Status:** Complete |
| 5 | +**Goal:** Establish architectural skeleton, P2P connectivity, and "Black Box SOS". |
5 | 6 |
|
6 | | -- [x] **Project Setup** |
7 | | - - [x] Initialize Monorepo (Core, Server, Desktop). |
8 | | - - [x] Configure Rust Workspace. |
9 | | - - [x] Initialize Tauri + Svelte frontend. |
10 | | -- [x] **Core Library (`ratatoskr-core`)** |
11 | | - - [x] Define basic data models (`SosPayload`, `GeoLocation`). |
12 | | - - [x] Implement ECIES Encryption (X25519 + AES-GCM) for anonymous SOS. |
13 | | - - [x] Setup `libp2p` Swarm with GossipSub and mDNS. |
14 | | -- [x] **Relay Node (`ratatoskr-server`)** |
15 | | - - [x] Implement basic server that listens to P2P network. |
16 | | - - [x] Subscribe to `ratatoskr-sos` topic and log incoming packets. |
17 | | -- [x] **Desktop Client (`ratatoskr-desktop`)** |
18 | | - - [x] Integrate Rust Core with Tauri. |
19 | | - - [x] Implement background P2P thread. |
20 | | - - [x] Create "Tactical UI" with Svelte & Tailwind/CSS. |
21 | | - - [x] Connect UI "SOS Button" to Core networking logic. |
| 7 | +- [x] **Project Setup** (Monorepo, Workspace, Tauri+Svelte). |
| 8 | +- [x] **Core Library** (Models, ECIES Encryption, libp2p Swarm). |
| 9 | +- [x] **Relay Node** (Basic listener, GossipSub). |
| 10 | +- [x] **Desktop Client** (Tactical UI, Background P2P thread, SOS logic). |
22 | 11 |
|
23 | | -## Phase 2: Decentralized Identity (DID) |
24 | | -Goal: Allow users to exist independently of any server. |
| 12 | +## 🚧 Phase 2: Identity & Routing |
| 13 | +**Status:** In Progress |
| 14 | +**Goal:** Self-Sovereign Identity and decentralized discovery. |
25 | 15 |
|
26 | | -- [x] **Identity Generation** |
27 | | - - [x] Implement Ed25519 Keypair generation/storage (KeyVault). |
28 | | - - [x] Create `DidDocument` structure (W3C standard compatible - baseline hex ID implemented). |
29 | | -- [x] **Registration flow** |
30 | | - - [x] Generate a unique "Ratatoskr ID" (e.g., `did:rat:zABC...`). |
31 | | - - [x] Implement "First Run" wizard in UI (Create Account / Import Seed). |
32 | | - - [x] Implement Mnemonic recovery (BIP-39). |
33 | | - - [x] Add secure backup export (.txt). |
34 | | -- [x] **Routing** |
35 | | - - [x] Implement DHT (Kademlia) for finding peers by ID. |
36 | | - - [ ] Allow publishing "Mailbox" addresses to the DHT/Network. |
| 16 | +- [x] **Identity Management** |
| 17 | + - [x] Ed25519 Keypair generation/storage (`KeyVault`). |
| 18 | + - [x] BIP-39 Mnemonic recovery. |
| 19 | + - [x] Secure Backup Export (.txt). |
| 20 | +- [x] **Routing (DHT)** |
| 21 | + - [x] Implement Kademlia DHT (`libp2p-kad`). |
| 22 | + - [x] Discovery via mDNS and Bootstrap nodes. |
37 | 23 | - [ ] **Privacy & Anonymity** |
38 | | - - [ ] Implement Disposable Inboxes (Ephemeral burner DIDs). |
39 | | - - [ ] Implement Circuit Breaker for public gateways (adaptive PoW). |
40 | | - - [ ] Implement Blocklist / Gatekeeper settings. |
41 | | -- [ ] **Digital Legacy** |
42 | | - - [ ] Implement Shamir's Secret Sharing for key sharding. |
43 | | - - [ ] Create "Guardian" invitation and shard distribution flow. |
| 24 | + - [ ] **Disposable Inboxes (Burner IDs):** |
| 25 | + - [ ] Implement HD Wallet derivation (BIP-32 style) for generating sub-keys from master seed. |
| 26 | + - [ ] Add `burn_after` field to DID Document. |
| 27 | + - [ ] UI: "Generate Temporary Contact Link" flow. |
| 28 | + - [ ] **Gatekeeper System:** |
| 29 | + - [ ] Implement `Blocklist` storage in SQLite. |
| 30 | + - [ ] Logic to drop messages from blocked DIDs at the network level. |
| 31 | + - [ ] "Allow Anonymous" toggle in settings (reject unsigned/unknown envelopes). |
| 32 | + - [ ] **Circuit Breaker:** |
| 33 | + - [ ] Implement Hashcash (Proof-of-Work) validation for incoming anonymous messages. |
| 34 | + - [ ] Dynamic difficulty adjustment based on inbox flood rate. |
44 | 35 |
|
45 | | -## Phase 3: Secure Chat & Efficient Communication |
46 | | -Goal: Enable standard E2EE messaging with "Inbox Zero" architecture and multi-device support. |
| 36 | +## 🔮 Phase 3: Secure Chat & Efficiency |
| 37 | +**Status:** Active |
| 38 | +**Goal:** E2EE messaging, "Inbox Zero" workflow, and multi-device sync. |
47 | 39 |
|
48 | | -- [ ] **Messaging Protocol** |
49 | | - - [ ] Implement Double Ratchet Algorithm (Signal Protocol style). |
50 | | - - [x] Define `ChatMessage` structure with Semantic Types (`Direct`, `Ephemeral`, `Transactional`). |
51 | | - - [x] Implement `TTL` logic for ephemeral messages (backend cleanup + UI removal). |
52 | | - - [x] Implement bidirectional chat history (sender and recipient visibility). |
53 | | - - [x] Implement Reply/Quote system. |
54 | | -- [x] **Inbox Zero Logic** |
55 | | - - [x] Implement `GarbageCollector` background service. |
56 | | - - [x] Implement `ActionRequired` and `Done` state logic. |
57 | | -- [ ] **Data & Sync** |
58 | | - - [ ] Implement Large File Transfer (IPFS-style chunking). |
59 | | - - [ ] Implement Multi-Device Sync using CRDTs. |
60 | | -- [ ] **Mailbox / Offline Delivery** |
61 | | - - [ ] Implement "Blind Storage" logic on Relay Server. |
62 | | - - [ ] Implement Client logic to poll Mailbox for new messages. |
63 | | -- [x] **Local Storage** |
64 | | - - [x] Setup SQLite database with SQLx. |
65 | | - - [ ] Implement "Plausible Deniability" (Decoy password vs Real password). |
| 40 | +- [x] **Core Messaging** |
| 41 | + - [x] `ChatMessage` structure with Semantic Types. |
| 42 | + - [x] SQLite Storage & History. |
| 43 | + - [x] UI: Two-pane chat, Replies, Self-messages. |
| 44 | + - [x] Inbox Zero: TTL auto-deletion (backend + UI). |
| 45 | +- [ ] **Advanced Cryptography (Double Ratchet)** |
| 46 | + - [ ] Implement **X3DH** (Extended Triple Diffie-Hellman) for initial key exchange. |
| 47 | + - [ ] Implement **Double Ratchet** session management (root key, chain keys). |
| 48 | + - [ ] Store session states securely in SQLite (using `sqlcipher` or application-level encryption). |
| 49 | + - [ ] Header Encryption (hide routing metadata). |
| 50 | +- [ ] **Inbox Zero Logic** |
| 51 | + - [ ] **Semantic Actions:** |
| 52 | + - [ ] Implement `ActionRequired` pinning logic. |
| 53 | + - [ ] UI for "Defer" (Snooze) -> hide message until timestamp. |
| 54 | + - [ ] UI for "Delegate" -> forward message and track status. |
| 55 | + - [ ] **Integrations:** |
| 56 | + - [ ] Define JSON Schema for `Transactional` messages (e.g., Bank Alert, Server Log). |
| 57 | + - [ ] Create Webhook Gateway for external services to push messages to local node. |
| 58 | +- [ ] **Digital Legacy (Guardians)** |
| 59 | + - [ ] **Sharding:** Implement Shamir's Secret Sharing (Split seed into N parts). |
| 60 | + - [ ] **Guardian Protocol:** |
| 61 | + - [ ] "Invite Guardian" flow (sends encrypted shard). |
| 62 | + - [ ] "Accept Guardian" flow (stores shard securely). |
| 63 | + - [ ] **Recovery Switch:** |
| 64 | + - [ ] Logic for Guardians to publish "Shard Reveal". |
| 65 | + - [ ] Client logic to reconstruct Master Key from K revealed shards. |
| 66 | +- [ ] **Offline Delivery (Mailbox)** |
| 67 | + - [ ] **Server:** Implement "Blind Storage" (store encrypted blobs keyed by Recipient DID). |
| 68 | + - [ ] **Protocol:** `RequestMessageStore` and `FetchMessages` commands in `libp2p`. |
| 69 | + - [ ] **Client:** Polling logic to check Mailbox when online. |
66 | 70 |
|
67 | | -## Phase 4: Resilience & Governance |
68 | | -Goal: Operate without standard internet and manage community trust. |
| 71 | +## 🛡️ Phase 4: Resilience & Governance |
| 72 | +**Goal:** Operate without standard internet and manage community trust. |
69 | 73 |
|
| 74 | +- [ ] **Data & Sync (CRDTs)** |
| 75 | + - [ ] **Device Cluster:** Link mobile and desktop via QR code (share Master Key). |
| 76 | + - [ ] **State Sync:** Implement CRDTs (using `automerge` or `crdt`) to sync message history and read states between devices without a central server. |
| 77 | + - [ ] **Large Files:** Implement chunked file transfer stream (IPFS-style DAG) for media >10MB. |
70 | 78 | - [ ] **Mesh Networking** |
71 | | - - [ ] Research & Implement Bluetooth Low Energy (BLE) transport for `libp2p`. |
72 | | - - [ ] Enable peer discovery via local Wi-Fi multicast. |
73 | | -- [ ] **The Plague Protocol** |
74 | | - - [ ] Implement trust-graph based reputation scoring. |
75 | | - - [ ] Create "Quarantine" logic for infected nodes (silent muting). |
76 | | -- [ ] **Maintenance** |
77 | | - - [ ] Implement P2P Update System (viral patching). |
78 | | -- [ ] **Trust Network** |
79 | | - - [ ] Implement `VolunteerCredential` issuing and verification. |
| 79 | + - [ ] **Bluetooth LE:** Integrate `libp2p-bluetooth` or platform-specific bindings for local discovery. |
| 80 | + - [ ] **Wi-Fi Direct:** Android/Linux specific implementation for off-grid connection. |
| 81 | +- [ ] **The Plague Protocol (Reputation)** |
| 82 | + - [ ] **Trust Graph:** Store "Trust Scores" for contacts in DB. |
| 83 | + - [ ] **Reporting:** "Report Spam" button signs a `MalfeasanceProof` against the sender. |
| 84 | + - [ ] **Quarantine:** Logic to drop gossip propagation from nodes with Score < Threshold. |
| 85 | + - [ ] **Jury:** Random selection protocol for resolving disputes (advanced). |
| 86 | +- [ ] **Unstoppable Updates** |
| 87 | + - [ ] Implement P2P file distribution for binary updates. |
| 88 | + - [ ] Verify updates against Foundation's offline GPG key. |
80 | 89 |
|
81 | | -## Phase 5: Media, Mobile & Polish |
82 | | -Goal: High-performance real-time communication and mobile release. |
| 90 | +## 📱 Phase 5: Mobile & Polish |
| 91 | +**Goal:** Public release and mobile parity. |
83 | 92 |
|
| 93 | +- [ ] **Mobile Port (Tauri Mobile)** |
| 94 | + - [ ] Configure Android manifest & permissions (Foreground Service for P2P). |
| 95 | + - [ ] Configure iOS capabilities (Network Extensions). |
| 96 | + - [ ] Adapt UI: Bottom navigation, touch gestures (swipe to reply). |
84 | 97 | - [ ] **Real-time Media** |
85 | | - - [ ] Implement 1-on-1 A/V calls (WebRTC/libp2p stream). |
86 | | - - [ ] Implement Group A/V calls via Blind SFU (Relay nodes). |
87 | | -- [ ] **Mobile Port** |
88 | | - - [ ] Adapt UI for Mobile (Responsive). |
89 | | - - [ ] Configure Tauri for Android/iOS build. |
90 | | -- [ ] **Audit & Launch** |
91 | | - - [ ] Security audit of crypto and P2P implementation. |
92 | | - - [ ] Public Beta release. |
| 98 | + - [ ] **1-on-1:** WebRTC signaling over P2P connection + direct media stream. |
| 99 | + - [ ] **Group Calls:** Implement "Blind SFU" logic on Relay nodes (forwarding encrypted SRTP packets). |
| 100 | +- [ ] **Security Audit** |
| 101 | + - [ ] Fuzz testing of P2P handlers. |
| 102 | + - [ ] Formal review of Double Ratchet implementation. |
0 commit comments