Skip to content

WRAITH Protocol v1.6.0 - Mobile Clients & WRAITH-Chat

Choose a tag to compare

@doublegate doublegate released this 11 Dec 21:59
· 261 commits to main since this release

Phase 16 Implementation Complete - Mobile Apps + Secure Messaging

This major release introduces three production-ready client applications implementing the WRAITH Protocol with native platform integration and industry-standard end-to-end encryption.

Highlights

  • Android Client - Native Kotlin/Jetpack Compose with JNI bindings to wraith-ffi
  • iOS Client - Native Swift/SwiftUI with UniFFI bindings
  • WRAITH-Chat - End-to-end encrypted messaging with Signal Protocol Double Ratchet

Android Client (clients/wraith-android/)

Native Android application with Material Design 3 UI built on Jetpack Compose.

Technical Architecture

  • Rust JNI library (~800 lines) with global Tokio runtime management
  • Gradle integration with cargo-ndk for multi-architecture builds (arm64, arm, x86_64, x86)
  • Background foreground service for continuous file transfers
  • Storage permissions handling for Android 8.0+

Key Components

  • lib.rs (335 lines): JNI function exports (init_node, establish_session, send_file)
  • WraithClient.kt: High-level Kotlin API with coroutines
  • MainActivity.kt: Jetpack Compose UI with Material Design 3
  • WraithService.kt: Foreground service for background operations

iOS Client (clients/wraith-ios/)

Native iOS application with SwiftUI interface targeting iOS 16.0+.

Technical Architecture

  • Rust UniFFI library (~450 lines) for automatic Swift binding generation
  • Swift Package Manager integration
  • Tab-based navigation (Home, Transfers, Sessions, Settings)
  • MVVM pattern with ObservableObject state management

Key Components

  • lib.rs (276 lines): WraithNode implementation with async support
  • wraith.udl (83 lines): UniFFI interface definition
  • SwiftUI views: HomeView, TransfersView, SessionsView, SettingsView

WRAITH-Chat (clients/wraith-chat/)

Secure end-to-end encrypted messaging application built on Tauri 2.0 and React 18.

Cryptographic Implementation

Double Ratchet Algorithm (Signal Protocol)

  • X25519 Diffie-Hellman key exchange with Elligator2 encoding
  • ChaCha20-Poly1305 AEAD encryption (256-bit key, 192-bit nonce)
  • HKDF-SHA256 key derivation
  • Out-of-order message handling with skipped key storage (max 1,000 keys)
  • Forward secrecy via continuous DH ratcheting
  • Post-compromise security via symmetric ratchet

SQLCipher Database

  • AES-256 encryption
  • PBKDF2-HMAC-SHA512 key derivation (64,000 iterations)
  • Tables: contacts, conversations, messages, group_members, ratchet_states

Backend (Rust, ~1,250 lines)

  • crypto.rs (443 lines): Full Double Ratchet implementation
  • database.rs (407 lines): SQLCipher encrypted storage
  • commands.rs (292 lines): 10 Tauri IPC command handlers
  • state.rs (32 lines): Application state with ratchet cache

Frontend (React + TypeScript, ~1,400 lines)

  • Zustand stores for state management
  • Dark theme with WRAITH brand colors
  • TypeScript strict mode
  • Tailwind CSS v3 styling

Bug Fixes

  • Fixed Double Ratchet initialization asymmetry causing DecryptionFailed errors
  • Corrected responder receiving_chain_key derivation to match initiator sending_chain_key
  • Suppressed Rust 1.92+ false positive lint warnings for zeroize fields
  • Added SQLCipher CI dependencies for all platforms

Implementation Statistics

Metric Value
Total Code Volume ~7,900 lines
Android Client ~2,800 lines (800 Rust JNI, 1,800 Kotlin, 200 Gradle)
iOS Client ~1,650 lines (450 Rust UniFFI, 1,200 Swift)
WRAITH-Chat ~2,650 lines (1,250 Rust, 1,400 TypeScript/React)
Files Created 45 new files
Story Points (Phase 16) 302
Total Project Story Points 1,937

Quality Metrics

  • All workspace tests passing: 1,274 tests
  • Zero clippy warnings with -D warnings
  • TypeScript strict mode enabled
  • Cross-platform CI: Ubuntu, macOS, Windows

Breaking Changes

None - This release adds new client applications without modifying protocol APIs.


Dependencies

New Runtime Requirements

  • SQLCipher - For WRAITH-Chat database encryption
  • Android NDK - For Android client builds
  • Xcode - For iOS client builds

Full Changelog

See CHANGELOG.md for complete details.


Pre-built binaries will be attached after the Release workflow completes.