How tw1xss/min works
MIN is a local-first, one-to-one private messenger: users exchange invite strings, establish encrypted sessions, send and retrieve messages through a Tor-routed relay, and view conversation history on-device. The iOS app presents chat and contact workflows; its Rust core handles identity, sessions, message processing, recovery, and storage through an FFI boundary. The relay queues opaque envelopes and maintains minimal delivery/auth state. Some backend subsystem links reflect README architecture rather than sampled implementation details.
Main entry points: core.rs App core · handlers.rs Relay handlers · AppState.swift App state · lib.rs Tor transport
Components 21
iOS client
- App state
MIN/App/AppState.swift - Chat UI
MIN/Views/ChatView.swift - Contact invite
MIN/Views/AddContactView.swift - Local keychain
MIN/Services/KeychainService.swift - Tor service
MIN/Services/TorService.swift
Core boundary
- Swift core client
MIN/Services/MinApp.swift - C ABI
backend/crates/min-ffi/src/app_ffi.rs
Messaging core
- App core
backend/crates/min-app/src/core.rs - Recovery
backend/crates/min-app/src/recovery.rs - Session manager
backend/crates/min-session/src/manager.rs - Cryptography
backend/crates/min-crypto/src/lib.rs - Identity keys
backend/crates/min-identity/src/lib.rs - Wire protocol
backend/crates/min-protocol/src/envelope.rs - Encrypted storage
backend/crates/min-storage/src/lib.rs
Delivery transport
- Delivery client
backend/crates/min-delivery/src/lib.rs - Tor transport
backend/crates/min-tor/src/lib.rs
Relay service
- Relay handlers
backend/crates/min-relay/src/handlers.rs - Relay queue
backend/crates/min-relay/src/store.rs - Anti-spam
backend/crates/min-relay/src/antispam.rs
Other components
- User
- Relay operator
Connections 21
- User → Chat UI: uses chats
README.md - User → Contact invite: exchanges invite
README.md - Chat UI → App state: requests actions
MIN/Views/ChatListView.swift - Contact invite → App state: adds contact
MIN/App/AppState.swift - App state → Swift core client: calls core
MIN/App/AppState.swift - Swift core client → C ABI: uses FFI
README.md - C ABI → App core: dispatches calls
- App core → Recovery: uses recovery
backend/crates/min-app/src/core.rs - App core → Session manager: uses sessions
- App core → Encrypted storage: reads and writes
- App core → Delivery client: exchanges frames
backend/crates/min-app/src/core.rs - Session manager → Cryptography: uses cryptography
- App core → Identity keys: manages identity
- App core → Wire protocol: processes envelopes
- Delivery client → Tor transport: uses transport
- Tor service → Tor transport: routes via SOCKS
MIN/Services/TorService.swift - Tor transport → Relay handlers: connects to relay
- Relay operator → Relay handlers: operates service
- Relay handlers → Relay queue: queues and retrieves
backend/crates/min-relay/src/handlers.rs - Relay handlers → Anti-spam: checks limits
backend/crates/min-relay/src/handlers.rs - Local keychain → App state: protects local keys
MIN/App/AppState.swift