A fully decentralized messaging application built on the Monad Testnet, enabling secure, censorship-resistant, and user-controlled communication directly on-chain.
- Wallet Integration – Connect MetaMask and interact with the Monad Testnet
- On-Chain Messaging – All messages are permanently stored on-chain using smart contracts
- Public Feed – View a live stream of messages broadcasted to the public
- Contact Management – Add and manage local contacts using browser storage
- Responsive UI – Mobile and desktop optimized interface
- EVM Compatibility – Built with Hardhat + Ethers.js, fully compatible with Ethereum toolchain
- Frontend: Next.js (App Router), TypeScript, Tailwind CSS, ShadCN/UI
- Web3: Ethers.js
- Smart Contracts: Solidity, Hardhat
- Deployment: Monad Testnet
🔗 Live Application: monad-d-mail.vercel.app/inbox
- Node.js 18+ and npm
- MetaMask wallet extension
- Monad Testnet funds (Get from faucet)
-
Clone the repository
git clone https://github.com/dinitheth/Monad-D-Mail.git cd Monad-D-Mail -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Add your private key to
.env:PRIVATE_KEY=your_metamask_private_key
⚠️ Warning: Never commit your.envfile or share your private key publicly. -
Deploy the smart contract
npx hardhat run scripts/deploy.ts --network monad
This will deploy
MessageBoard.soland save the contract address and ABI tosrc/contracts/contract-address.json. -
Start the development server
npm run dev
Open http://localhost:9002 in your browser.
├── src/
│ ├── app/ # Next.js App Router pages
│ ├── components/ # UI components (ShadCN/UI)
│ ├── context/ # WalletContext and state management
│ ├── hooks/ # Custom React hooks
│ └── contracts/ # Contract address and ABI
├── contracts/ # Solidity smart contracts
├── scripts/ # Hardhat deployment scripts
└── hardhat.config.js # Hardhat configuration
The core messaging functionality is implemented in MessageBoard.sol:
function sendMessage(address recipient, string calldata text) public;
function getMessageCount() public view returns (uint256);- Public feed messages use
address(0)as the recipient - All messages are stored on-chain and indexed by ID
- Messages include sender, recipient, content, and timestamp
- Connect Wallet: Click "Connect Wallet" and select MetaMask
- Switch Network: Ensure you're connected to Monad Testnet
- Send Messages:
- Use
0x0000000000000000000000000000000000000000for public messages - Enter any valid address for private messages
- Use
- View Messages: Check the public feed or your inbox for received messages
- Manage Contacts: Add frequently used addresses to your contact list
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
crypto_xbr
- Built on Monad - High-performance EVM-compatible blockchain
- UI components from ShadCN/UI
- Styled with Tailwind CSS
Disclaimer: This is a testnet application for demonstration purposes. Do not use real funds or sensitive information.