Decentralized end-to-end encrypted email using ENS identities and Filecoin storage.


dMail is a fully decentralized, end-to-end encrypted email system that replaces traditional email servers with Web3 infrastructure. Instead of relying on Gmail-style centralized storage and identity, dMail uses ENS names as email addresses, Filecoin (via the Synapse SDK) for storing encrypted messages and attachments, and a deterministic wallet-derived cryptographic identity for encryption and signing meaning users never create passwords or manage keys manually. Every message is encrypted client-side using ephemeral X25519 keys and AES-GCM, ensuring only the intended recipient can ever read it. Mailboxes are stored as append-only indexes on Filecoin and referenced through ENS or an optional off-chain resolver, allowing anyone to discover and retrieve their mail in a trustless way. The app includes a background outbox queue that provides instant “Send” UX while pushing content to Filecoin in the background, surviving tab reloads, offline usage, and multi-device access. No central server ever sees message content, keys, or metadata, giving users full control and censorship resistance. dMail brings familiar email workflows to a decentralized, wallet-based environment while maintaining privacy, security, and true data ownership.
dMail is built as a fully client-side decentralized application using React + Vite, with no backend servers. Wallets authenticate users, and identities are deterministically derived from a single MetaMask signature using HKDF to generate X25519 encryption keys and Ed25519 signing keys removing the need for key management while still enabling strong end-to-end encryption. We use ENS both for identity and as an on-chain mailbox pointer system. Recipient discovery happens via ENS text records or an off-chain resolver API that we built, which reduces on-chain writes and avoids repeated MetaMask signature prompts. File storage is powered by Filecoin through the Synapse SDK, which handles uploads, CDN-backed retrieval, dataset creation, and provider routing. Each email is encrypted client-side using ephemeral X25519 ECDH + AES-GCM and stored as envelopes on Filecoin, while lightweight mailbox indexes reference those CIDs. One of the most challenging parts was performance: Filecoin writes take ~30 seconds each. Initially sending a single email could take several minutes. We engineered several hacky but effective optimizations:

