Inspiration

My inspiration was to solve a fundamental problem in the Web3 space: communication. While blockchain enables user-owned assets and identity, our communication tools remain stuck in the centralized Web2 world. I was inspired to create an email service that felt as simple and seamless as Gmail but was built on a foundation of decentralization, privacy, and user sovereignty. The vision was to bridge the gap, allowing the two worlds to communicate effortlessly while giving users true ownership over their data, powered by the security and interoperability of the Polkadot ecosystem.

What it does

Miiglu Mail is a decentralized email dApp that provides users with a permanent, user-owned email address (e.g., you@miiglu.com). It allows users to:

Receive Encrypted Mail: All emails sent between Miiglu users are end-to-end encrypted. The content is stored on the decentralized file system IPFS, and the decryption keys are held in a personal on-chain "key vault" that only the user's wallet can access. Bridge Web2 and Web3: A user on a traditional service like Gmail can send an email to a Miiglu address without knowing anything about blockchain. The architecture handles the "magic" of encrypting and decentralizing the email behind the scenes. Send Mail Anywhere: Users can send emails from their Miiglu address to both other Web3 users and any traditional Web2 email address, making it a fully functional replacement for a standard email client.

How I built it

I built Miiglu Mail using a modular, multi-service architecture that separates concerns and leverages the best tool for each job:

Smart Contract (The On-Chain Brain): I wrote a Solidity smart contract deployed on a Polkadot EVM-compatible parachain. This contract manages user identity (mapping usernames to wallet addresses) and serves as the secure "key vault" for email decryption keys.

Frontend (The User Interface): The web app is built with React and TypeScript. This is where the user interacts with their mail. Crucially, all decryption happens client-side in the browser, ensuring that unencrypted data is never exposed to the servers.

SMTP Gateway (The Web2-to-Web3 Bridge): I developed a custom SMTP server in Rust, which is deployed as a serverless application on Shuttle. This service listens for incoming emails from the traditional web, encrypts them, stores them on IPFS, and registers the key on the smart contract.

API Layer (The Real-Time Connector): A serverless Cloudflare Worker acts as the primary API. It handles inbound email routing and requests for sending outbound mail and manages a WebSocket server to push real-time notifications to the frontend when a new email arrives.

Challenges I ran into

My biggest challenge was a strategic pivot on the smart contract layer. I initially began building with ink!, the native smart contract language for the Polkadot ecosystem. However, I quickly realized that to achieve a smooth user experience, I needed to leverage the mature tooling and widespread wallet support of the EVM.

I made the difficult but necessary decision to switch to Solidity and target a Polkadot EVM-compatible parachain. This allowed users to connect with familiar wallets like MetaMask, drastically reducing the barrier to entry. This taught me a valuable lesson in prioritizing user experience and pragmatism over technological purism.

Another challenge was ensuring reliable email delivery to Web2 addresses. Rather than trying to reinvent the wheel and risk emails being marked as spam, I chose to integrate a trusted third-party email service for outbound mail, allowing me to focus on the core Web3 functionality.

Accomplishments that I'm proud of

The Seamless Web2/Web3 Bridge: I successfully created a system where the complexities of blockchain are completely abstracted away from the sender. A Gmail user can interact with a Web3 user without any friction, which I see as a huge win for adoption. True End-to-End Encryption: I built a fully functional application where email decryption happens exclusively on the client-side. This provides a "zero-knowledge" guarantee that I, as the service provider, can never access user data. A Robust, Multi-Service Architecture: Integrating four distinct services written in different languages (Solidity, Rust, TypeScript) into a single, cohesive product was a significant engineering accomplishment. Leveraging Modern Serverless Infrastructure: The use of Shuttle for the Rust backend and Cloudflare Workers for the API demonstrates a modern, scalable, and cost-effective approach to building dApps.

What I learned

Pragmatism is Key: The decision to switch from ink! to Solidity taught me that leveraging a mature and widely-adopted ecosystem is often more important for user experience and development velocity than using a "native" but less-supported technology. Abstraction is Everything: For Web3 to go mainstream, the underlying complexity must be hidden. Users want great products that solve their problems; the fact that it runs on a blockchain should be an implementation detail. Focus on the Core Mission: Don't try to solve problems that have already been solved well by others. By using a third-party service for outbound email delivery, I was able to focus all my energy on the novel, decentralized aspects of the project.

What's next for Miiglu Mail

While Miiglu Mail is a functional dApp, the vision is to evolve it into a foundational, decentralized communication protocol.

Decentralize the Gateway: The next major step is to replace the centralized smtp-gateway with a decentralized network of nodes run by community operators, potentially incentivized by a token. This will remove the last single point of failure and create a truly trustless bridge. Standardize the Protocol: The aim is to evolve the MiigluMailbox smart contract into a new open standard (akin to an EIP or ERC) for on-chain identity and key exchange, allowing other developers to build compatible services. Foster an Ecosystem of Clients: With a standardized protocol, this web app would become just one of many clients. The vision is a future where other teams can build alternative frontends—like native mobile apps or even integrations for Outlook—that all speak the same on-chain language, creating a rich and competitive ecosystem for private communication.

Built With

+ 6 more
Share this project:

Updates