Skip to main content

Architecture Overview

SimpleGo runs as multiple parallel FreeRTOS tasks on two CPU cores of the ESP32-S3. No Android, no Linux, no baseband processor -- complete autonomous firmware.

Task Architecture

Four tasks run concurrently across two cores:

TaskCoreStackResponsibility
network_taskCore 016 KB SRAMAll SSL/TLS connections, SMP frame I/O
smp_app_taskCore 116 KB SRAMProtocol state machine, ratchet encryption, NVS persistence
lvgl_taskCore 18 KB SRAMLVGL rendering, SPI2 bus sharing with SD card
wifi_managerCore 04 KB PSRAMWiFi connection management, multi-network, WPA3

Network I/O is isolated on Core 0 so a hanging TLS handshake never blocks the UI. App logic requiring NVS writes runs on a Main Task with internal SRAM stack -- a hard ESP32-S3 hardware constraint (PSRAM-stack tasks cannot write NVS due to cache conflicts).

Memory Architecture

RegionSizeContents
Internal SRAM512 KBTLS stack, LVGL draw buffers (DMA required), task stacks
PSRAM8 MBRatchet array (128 contacts), frame pool, ring buffers
NVS Flash128 KBRatchet keys, queue keys, handshake keys
SD Cardup to 128 GBAES-256-GCM encrypted chat history
LVGL Pool64 KBSeparate subsystem, message text in labels

Four Encryption Layers

Every message passes through four cryptographically independent layers:

  1. Double Ratchet (E2E): X3DH (X448) + AES-256-GCM -- perfect forward secrecy, every message has its own key
  2. Per-Queue NaCl: X25519 + XSalsa20 + Poly1305 -- prevents traffic correlation between queues
  3. Server-to-Recipient NaCl: additional cryptobox preventing correlation of server I/O
  4. TLS 1.3: transport layer, ALPN smp/1, mbedTLS

All messages padded to fixed 16 KB blocks at every layer.

Deep Dive

For the complete architecture document including inter-task communication, sliding window design, and file-by-file analysis, see the full Architecture reference.