Skip to content

Commit e571629

Browse files
committed
docs(protocol): Sessions 25+26 — Bidirectional Chat + Persistence (M3-M6)
1 parent 251fa1b commit e571629

6 files changed

Lines changed: 918 additions & 50 deletions

File tree

docs/protocol-analysis/01_SIMPLEX_PROTOCOL_INDEX.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@
22

33
**Project:** SimpleGo - Native ESP32 SMP Implementation
44
**Version:** v0.1.18-alpha
5-
**Last Updated:** 2026-02-14 (Session 25🎯 Bidirectional + Receipts!)
5+
**Last Updated:** 2026-02-14 (Session 26🗄️ Persistence!)
66

77
---
88

9-
## 🎯 LATEST: Bidirectional Chat + Receipts! (Session 25)
9+
## 🗄️ LATEST: Ratchet State Persistence! (Session 26)
1010

11-
On February 14, 2026 (Valentine's Day), Session 25 achieved **THREE milestones**:
11+
On February 14, 2026, Session 26 achieved **Milestone 6**:
1212

13-
- **Milestone 3:** First App message decrypted on ESP32
14-
- **Milestone 4:** Bidirectional encrypted chat ESP32 ↔ App
15-
- **Milestone 5:** Delivery receipts (✓✓) working!
13+
- **Milestone 6:** ESP32 survives reboot without losing crypto state!
14+
- **Write-Before-Send:** Evgeny's golden rule implemented (7.5ms)
15+
- **NVS Storage:** 128KB partition, 150+ contacts supported
1616

17-
**Refactoring:** main.c 2440 → 611 lines (−75%)
18-
**Bugs Fixed:** 8 (5 critical, 3 high)
19-
**Lessons Learned:** 112 total
17+
**Lessons Learned:** 120 total (8 new in S26)
2018

2119
---
2220

2321
## Documentation Structure
2422

25-
The complete protocol analysis (~20,000+ lines, 438+ sections) is split into 22 parts:
23+
The complete protocol analysis (~21,000+ lines, 457+ sections) is split into 23 parts:
2624

2725
| Part | File | Lines | Content |
2826
|------|------|-------|---------|
@@ -48,17 +46,18 @@ The complete protocol analysis (~20,000+ lines, 438+ sections) is split into 22
4846
| 20 | [22_PART20_SESSION_23.md](22_PART20_SESSION_23.md) | ~570 | 🎉 CONNECTED! Historic Milestone! |
4947
| 21 | [23_PART21_SESSION_24.md](23_PART21_SESSION_24.md) | ~600 | 🏆 First Chat Message! Milestone #2! |
5048
| **22** | [**24_PART22_SESSION_25.md**](24_PART22_SESSION_25.md) | **~480** | **🎯 Bidirectional + Receipts! M3,4,5!** |
51-
| **Total** | | **~20,000+** | **438+ Sections** |
49+
| **23** | [**25_PART23_SESSION_26.md**](25_PART23_SESSION_26.md) | **~600** | **🗄️ Persistence! Milestone 6!** |
50+
| **Total** | | **~21,000+** | **457+ Sections** |
5251

5352
---
5453

5554
## Quick Reference Documents
5655

5756
| Document | Lines | Description |
5857
|----------|-------|-------------|
59-
| [README.md](README.md) | ~510 | Project overview and navigation |
60-
| [BUG_TRACKER.md](BUG_TRACKER.md) | ~1,300 | All 39 bugs documented, 112 lessons |
61-
| [QUICK_REFERENCE.md](QUICK_REFERENCE.md) | ~1,130 | Constants, wire formats, verified values |
58+
| [README.md](README.md) | ~560 | Project overview and navigation |
59+
| [BUG_TRACKER.md](BUG_TRACKER.md) | ~1,350 | All 39 bugs documented, 120 lessons |
60+
| [QUICK_REFERENCE.md](QUICK_REFERENCE.md) | ~1,200 | Constants, wire formats, verified values |
6261

6362
---
6463

@@ -88,19 +87,22 @@ The complete protocol analysis (~20,000+ lines, 438+ sections) is split into 22
8887
| **23** | **Feb 7-8, 2026** | **CONNECTED** | **🎉 First SimpleX on Microcontroller!** |
8988
| **24** | **Feb 11-13, 2026** | **FIRST A_MSG** | **🏆 First Chat Message!** |
9089
| **25** | **Feb 13-14, 2026** | **BIDIRECTIONAL** | **🎯 Chat + Receipts! (8 bugs)** |
90+
| **26** | **Feb 14, 2026** | **PERSISTENCE** | **🗄️ Milestone 6! Ratchet State Persistence** |
9191

9292
---
9393

9494
## Key Achievements
9595

96-
### ✅ COMPLETE BIDIRECTIONAL CHAT (Session 25)
96+
### ✅ COMPLETE BIDIRECTIONAL CHAT + PERSISTENCE (Session 26)
9797
- TLS 1.3 Handshake
9898
- SMP Protocol (Contact + Reply Queues)
9999
- X3DH Key Agreement
100100
- Double Ratchet Header+Body Decrypt
101101
- E2E Encrypt/Decrypt both directions
102102
- A_MSG Send + Receive
103103
- Delivery Receipts (✓✓)
104+
- **Ratchet State Persistence (NVS)** 🗄️
105+
- **ESP32 survives reboot!** 🗄️
104106
- **ESP32 ↔ SimpleX App — Full Chat!** 🎯
105107
- Zstd Decompression
106108
- ConnInfo JSON Parsing

docs/protocol-analysis/02_SIMPLEX_STATUS.md

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,38 @@
22

33
**Project:** Native SimpleX SMP Client for ESP32
44
**Version:** v0.1.18-alpha
5-
**Archive:** See `01_SIMPLEX_PROTOCOL_INDEX.md` for complete documentation (438+ sections, 22 parts)
5+
**Archive:** See `01_SIMPLEX_PROTOCOL_INDEX.md` for complete documentation (457+ sections, 23 parts)
66

77
---
88

9-
## 🎯 LATEST: THREE MILESTONES! (2026-02-14 Session 25)
9+
## 🗄️ LATEST: MILESTONE 6! (2026-02-14 Session 26)
10+
11+
```
12+
═══════════════════════════════════════════════════════════════════════════════
13+
14+
🗄️🗄️🗄️ RATCHET STATE PERSISTENCE! 🗄️🗄️🗄️
15+
16+
┌─────────────────────────────────────────────────────────────────────────┐
17+
│ │
18+
│ MILESTONE 6: ESP32 survives reboot without losing crypto state! │
19+
│ │
20+
│ - Ratchet state restored from NVS flash │
21+
│ - Queue credentials persisted │
22+
│ - Delivery receipts work after reboot │
23+
│ - Write-Before-Send: 7.5ms verified │
24+
│ │
25+
│ Date: February 14, 2026 (Valentine's Day Part 2) │
26+
│ Platform: ESP32-S3 (LilyGo T-Deck) │
27+
│ NVS Capacity: 150+ contacts │
28+
│ │
29+
└─────────────────────────────────────────────────────────────────────────┘
30+
31+
═══════════════════════════════════════════════════════════════════════════════
32+
```
33+
34+
---
35+
36+
## 🎯 SESSION 25: Bidirectional Chat + Receipts! (2026-02-14)
1037

1138
```
1239
═══════════════════════════════════════════════════════════════════════════════
@@ -311,18 +338,19 @@ Bytes 80-95: HEADER_IV (iv2) ← FOR HEADER!
311338
| 3 | 📥 App→ESP32 Decrypt | 2026-02-14 | 25 |
312339
| 4 | 🔄 Bidirectional Chat | 2026-02-14 | 25 |
313340
| 5 | ✓✓ Delivery Receipts | 2026-02-14 | 25 |
341+
| **6** | **🗄️ Ratchet Persistence** | **2026-02-14** | **26** |
314342

315343
---
316344

317-
## 🎯 Next Steps (Session 26)
345+
## 🎯 Next Steps (Session 27)
318346

319-
1. **Message persistence**Store messages on ESP32 flash
320-
2. **UI integration**Display on LilyGo T-Deck screen
321-
3. **Multiple contacts**Handle more than one connection
322-
4. **Reconnection logic**Handle connection drops gracefully
347+
1. **Fix "bad message ID"**Persist send counter in NVS
348+
2. **Multi-Task Architecture**SMP Receive, SMP Send, LVGL UI tasks
349+
3. **Complete Chat UI**Connect keyboard to chat screen
350+
4. **Message bridge**SMP ↔ LVGL task communication
323351
5. **Post-quantum upgrade** — Full SNTRUP761 KEM implementation
324352

325353
---
326354

327-
*Status updated: 2026-02-14 Session 25🎯 BIDIRECTIONAL CHAT + DELIVERY RECEIPTS!*
328-
*History: S8 Breakthrough → S23 CONNECTED → S24 First MSG → S25 Bidirectional!*
355+
*Status updated: 2026-02-14 Session 26🗄️ RATCHET STATE PERSISTENCE!*
356+
*History: S8 Breakthrough → S23 CONNECTED → S24 First MSG → S25 Bidirectional → S26 Persistence!*

0 commit comments

Comments
 (0)