FHEZmail is a decentralized, privacy email platform on the Ethereum Sepolia testnet. Using Fully Homomorphic Encryption (FHE), all emails are encrypted on-chain, and only the sender and recipient can read their content.
- Testnet Smart Contract:
0xCB45011ca6B8CDce01792CBB9B4c999479E94a0E - Frontend (Next.js/React): https://fhevm-zmail.netlify.app/ (or deploy your own)
FHEZmail combines blockchain and FHE encryption to create an email system that is:
- Decentralized: All emails stored on-chain, no central server.
- Encrypted: Subjects and bodies encrypted with Fully Homomorphic Encryption.
- Threaded: Supports replies and forwards while preserving privacy.
- Organized: Emails sorted into Inbox, Sent, Archive, Star, Spam, Trash, and Read.
- Solidity 0.8.24
- Fully Homomorphic Encryption (FHE):
- SepoliaConfig – Preconfigured Sepolia testnet setup
- React – Modern, responsive UI
- Next.js – Server-side rendering & optimized builds
- @zama-fhe/relayer-sdk – Integrates FHE encryption/decryption on FE
-
Send Emails
- Encrypts subject & body using FHE
- Creates copies for sender (
Sent) and recipient (Inbox) - Permission management for encryption
-
Reply
- Replies within existing threads
- Updates boxes and maintains encryption
-
Forward
- Securely forward emails
- Updates permissions for new recipients
-
Move Emails
- Move emails between boxes
- TRASH box is handled specially
-
View Emails & Threads
- Fetch mails by box type
- Fetch full threads with encrypted replies
- Node.js >= 20
- Yarn or npm
- MetaMask or Web3 wallet
- Sepolia testnet ETH
git clone https://github.com/NarutoLab/fhevm-zama-mail-app.git
cd pakages/site
npm installnpm run devOpen http://localhost:3000 to access the dApp.
Contract Address: 0xCB45011ca6B8CDce01792CBB9B4c999479E94a0E
Key Functions:
// Send a new email
sendMail(to, subjectExternal, subjectProofs, bodyExternal, bodyProofs);
// Reply to a thread
reply(threadId, subjectExternal, subjectProofs, bodyExternal, bodyProofs);
// Forward an email
forward(mailId, to);
// Move emails between boxes
move(mailIds, newBox);
// Fetch emails
(inbox(user),
sent(user),
archive(user),
star(user),
spam(user),
trash(user),
read(user));FHEZmail lays the foundation for next-gen decentralized communication:
- Cross-chain Encrypted Messaging
- Decentralized Identity Integration (ENS, DIDs)
- Encrypted Search & Filters without decryption
- Emails are encrypted on-chain; only allowed participants can decrypt
- No plaintext stored on-chain
- Full control of permissions using FHE primitives
- Hardhat + MetaMask: Set up your local devnet step by step using Hardhat and MetaMask.
- FHEVM Documentation
- FHEVM Hardhat
- @zama-fhe/relayer-sdk Documentation
- Setting up MNEMONIC and INFURA_API_KEY
- React Documentation
- FHEVM Discord Community
- GitHub Issues
This project is licensed under the BSD-3-Clause-Clear License - see the LICENSE file for details.
