Designing a cross-platform library for encrypted messaging
summary
Threema replaces three diverging codebases (iOS, Android, desktop) with a Rust core that models protocol flows as blackbox state machines, exposed over FFI so there is no async across language boundaries. Apps drive the protocol by calling poll/add_chunks and executing explicit instructions, letting native TCP, TLS and WebSocket implementations stay in the platform. Bindings are generated with uniffi and wasm-bindgen/TSI, yielding testable, audit-friendly transitions and smaller surface area for misuse.
AI-written summary · about
chapters (14)
- 0:00Prima introduction
- 1:05Prima background
- 2:33Multiple code bases challenges
- 3:41Cross-platform library requirements
- 4:45Async/await across languages
- 8:42Async/await FFI challenges
- 9:46API design without async/await
- 11:14State machines for protocols
- 12:39Black-box state machine
- 14:44FFI bindings overview
- 15:45Error handling in Rust
- 17:52Error handling in TypeScript/Kotlin/Swift
- 18:56Key learnings
- 20:00Q&A
related talks
48mStrengthening the Base: Laying the Groundwork for a more robust Rust SDK
01h 21mLeveraging Rust to build cross-platform mobile libraries
30mInterop with Android, IOS and WASM in the same project
50mBuilding Production-Grade End to End Encrypted App...
38m"Secure Messaging: The Guardian’s Whistleblowing System"
34mUnable to decrypt this message
39mSeamless Multiplatform – Kotlin-Rust-Multiplatform?!
33mBuilding Next-Gen Cross-Platform Apps with Tauri 2.0
