How nightdropapp/nightdrop works
Night Drop is a local-first, privacy-focused 1:1 messenger. Its main workflow is user-driven pairing or invite acceptance, followed by encrypted messaging between peer nodes over Tor/direct transport or optional relay mailboxes; encrypted state persists locally. The Rust core exposes the high-level API to the Flutter shell, while platform code supplies native behavior. The tree contains no Flutter UI source, so UI screens and their wiring cannot be mapped. README documentation supplies several product relationships; the source index establishes core module references, but unsampled implementation details are not inferred.
Main entry points: node.rs Peer Node · api.rs Core API · mod.rs Transport · tor.rs Tor Transport
Components 24
Client Core
- Core API
core/src/api.rs - Peer Node
core/src/node.rs - Core Lifecycle
core/src/lifecycle.rs - Encrypted Store
core/src/storage/mod.rs - Backup and Restore
core/src/api.rs - Android Host
app/android/app/src/main/kotlin/app/nightdrop/MainActivity.kt - Background Startup
app/android/app/src/main/kotlin/app/nightdrop/BootReceiver.kt
Identity and Security
- Device Identity
core/src/identity/mod.rs - E2E Crypto
core/src/crypto/mod.rs - Short-Code Pairing
core/src/pake/mod.rs - PQ Pairing
core/src/pqkem.rs
Networking
- Wire Protocol
core/src/wire/mod.rs - Transport
core/src/transport/mod.rs - Tor Transport
core/src/transport/tor.rs - Nearby Transport
core/src/transport/nearby.rs - Relay Client
core/src/relay_client/mod.rs - Relay Service
relay/src/main.rs - WebTunnel Client
webtunnel/src/client.rs - Bridge Fetch
moat/src/lib.rs
Supporting Services
- Relay Directory
core/src/directory.rs - Signing Key Rotation
core/src/keyroll.rs - Signed Updates
core/src/update.rs - Diagnostics
core/src/diag.rs
Other components
- User
Connections 24
- User → Core API: uses
- Core API → Peer Node: drives
core/src/api.rs - Peer Node → Wire Protocol: exchanges frames
core/src/wire/mod.rs - Peer Node → E2E Crypto: encrypts messages
- Peer Node → Device Identity: uses identity
- Peer Node → Short-Code Pairing: pairs via
- Short-Code Pairing → PQ Pairing: hybridizes rendezvous
- Peer Node → Encrypted Store: persists state
- Core API → Backup and Restore: exports and restores
core/src/api.rs - Peer Node → Transport: communicates through
- Transport → Tor Transport: selects Tor
- Transport → Nearby Transport: offers nearby
- Peer Node → Relay Client: uses mailbox
- Relay Client → Relay Service: exchanges blobs
relay/src/main.rs - Relay Service → Tor Transport: publishes onion service
relay/src/main.rs - Core API → Relay Directory: uses directory
core/src/api.rs - Core API → Signing Key Rotation: rotates keys
core/src/api.rs - Signing Key Rotation → Signed Updates: references update signing
core/src/keyroll.rs - Core API → Signed Updates: checks updates
core/src/api.rs - Core API → Diagnostics: reports diagnostics
core/src/api.rs - Tor Transport → WebTunnel Client: can use bridge transport
- User → Bridge Fetch: requests bridges
- Android Host → Core API: hosts core
- Background Startup → Android Host: starts background delivery
app/android/app/src/main/kotlin/app/nightdrop/BootReceiver.kt