Fast, Private Messaging on Monad Testnet
NadChat is a decentralized messaging dApp on the Monad Testnet, leveraging its 10k TPS and 1-second block times for a seamless, privacy-first communication experience. With Privy’s wallet-based authentication, users can log in effortlessly, create profiles, manage friends, and send messages—all secured on-chain. Built for crypto enthusiasts and newcomers, NadChat showcases Monad’s high-performance EVM with a sleek, intuitive interface.
- Instant Login: Privy-powered wallet auth for frictionless onboarding.
- Personal Profiles: Set a username and (optional) IPFS-hosted image.
- Friend System: Add/remove friends with on-chain tracking.
- Real-Time Chat: Send/receive messages in under a second.
- Decentralized & Private: No servers, full user control via Monad.
NadChat is a full-stack decentralized application:
- Smart Contract:
NadChat.solhandles all logic on Monad Testnet. - Frontend: Next.js 15 with React components for a dynamic UI.
- Auth: Privy for seamless wallet integration.
- No Off-Chain: Fully on-chain, leveraging Monad’s capabilities.
| Category | Tools |
|---|---|
| Frontend | Next.js 15, React 19, Tailwind CSS, Framer Motion, Lucide React |
| Blockchain | ethers.js, Monad Testnet (Chain ID: 10143) |
| Auth | Privy (@privy-io/react-auth) |
| Utilities | react-hot-toast, @pinata/sdk (future IPFS), clsx, tailwind-merge |
| Dev Tools | Hardhat, TypeScript, PostCSS, @nomicfoundation/hardhat-toolbox |
Full list in package.json.
- Address:
0x797BD798E2C96EBd66DE171BBf452D7ed38e1158 - Core Functions:
createAccount(string name, string profileImage, bool isPublic): Registers users with a profile.addFriend(address friend_key): Adds a friend to your list.sendMessage(address friend_key, string _msg): Sends a message, stored on-chain.readMessage(address friend_key, uint256 start, uint256 count): Fetches paginated chat history.
- Design: Lightweight, optimized for Monad’s parallel execution and low gas costs.
- Components:
Auth.tsx: Manages login, profile creation, and updates.Chat.tsx: Renders friend lists and real-time messages.AllUsers.tsx: Displays public users for friend requests.
- State:
UserContext.tsxcentralizes user data with React Context. - UI: Tailwind CSS for responsive design, Framer Motion for smooth animations.
- Speed: 1-second block times enable near-instant message delivery.
- Scalability: 10k TPS supports high-volume messaging without bottlenecks.
- Efficiency: Low gas fees make frequent interactions affordable.
- EVM Power: Standard Solidity deployment with enhanced performance.
- Authentication:
- Privy logs users in via wallet (
ClientWrapper.tsx). - Checks
checkUserExistsand promptscreateAccountif new (Auth.tsx).
- Privy logs users in via wallet (
- Messaging:
sendMessagewrites to the blockchain in ~1s (Chat.tsx).readMessageretrieves chats with pagination for efficiency.
- Social Features:
addFriendandgetMyFriendListmanage relationships (AllUsers.tsx,Chat.tsx).
- Monad: Outperforms slower EVM chains (e.g., Ethereum’s 15s blocks), ideal for real-time apps.
- Privy: Simplifies UX, targeting crypto newcomers for mass adoption.
- Next.js 15: Balances SSR and client-side rendering for performance and SEO.
- Decentralized: No off-chain dependencies, fully reliant on Monad.
- Privy:
@privy-io/react-authfor wallet auth. - ethers.js:
ethersfor contract calls. - Pinata:
@pinata/sdk(IPFS image uploads). - UI Enhancements: Tailwind CSS, Framer Motion, Lucide React.
