Real-Time Messaging & Zero Trust Architecture
Last updated
Last updated
Sudo delivers fast, secure, and Web3-native messaging by combining real-time delivery protocols with a Zero Trust security model. The system is designed for scalability, decentralization, and privacy, ensuring that no intermediary — not even Sudo — can access or compromise user communications.
Sudo employs a hybrid infrastructure to balance immediate reliability with a clear path toward full decentralization:
Ably Realtime Messaging: Used in the initial deployment phase to provide enterprise-grade reliability for message routing.
WebSockets: Enables persistent, bi-directional connections for low-latency communication between clients.
Redis: Serves as an in-memory message queue for high-speed event handling, user presence tracking, and ephemeral message caching.
PostgreSQL + Drift (Local DB):
PostgreSQL manages structured message metadata, group/channel configurations, and delivery logs.
Drift (client-side database) ensures offline access to messages by storing encrypted copies locally on user devices.
Future Upgrade Path: Migration to libp2p transport and decentralized signaling servers to remove reliance on centralized routing infrastructure entirely.
Sudo implements Zero Trust Design Principles, ensuring no server is inherently trusted:
End-to-End Encryption: All communications use the LibSignal Protocol for encryption, the same technology powering Signal and WhatsApp.
Wallet-Signed Messages: Every message is cryptographically signed by the sender’s Web3 wallet (EVM-compatible address).
No Server Access to Content: Even if infrastructure is compromised, no plaintext messages can be exposed.
No Centralized Identity: Users are identified solely by their blockchain wallet, without KYC, phone numbers, or email.
This approach enforces the principle: "Trust no server. Trust only your wallet."
Phase
Description
Send
Message encrypted on the sender’s device using the recipient’s public key.
Transit
Routed via Ably or WebSocket transport for real-time delivery.
Delivery
Temporarily stored in Redis for quick push to the recipient’s active session.
Sync
Encrypted message stored in Drift local DB for offline access and sync on reconnect.
Expiry
Optional vanish mode auto-deletes messages after they are read or after 24 hours (DMs only).
Vanish Mode: Messages automatically delete after 24 hours or upon being read.
Blur Mode: Message content is blurred until the recipient actively taps to reveal it.
Real-Time Indicators: Typing status, message seen confirmations, and delivery events are all updated live.
Socket Disconnection Handling: Automatic reconnection and queued retries ensure no messages are lost during temporary network outages.
A typical message transaction in Sudo follows this flow:
Redis (real-time message transit & user presence) → PostgreSQL (relational metadata storage) → Drift (offline sync on client) → WebSocket Transport → User Client Interface
This design provides low-latency delivery, offline resilience, and scalable storage while maintaining encryption end-to-end.
Sudo replaces traditional, centralized user identity systems with Web3 wallet-based authentication:
Every Message Linked to Wallet Identity: Ensures message integrity and non-repudiation.
No Decrypted Content Stored Anywhere: Protects against server breaches and data subpoenas.
No Personal Identifiers Required: Enhances privacy by removing the need for phone numbers, emails, or centralized accounts.