DeFi Messager
End-to-end encrypted on-chain messenger built with XMTP. Anonymous or wallet login, real-time DMs and group chats.
- React
- XMTP
- wagmi
- viem
- TypeScript
- Vite
What it is
DeFi Messager is a decentralized, end-to-end encrypted messaging app built on the XMTP protocol. It follows the bulletproof-react architecture — pages, components, features, and hooks are cleanly separated for maintainability and scalability.
Three ways to log in
- Anonymous — generates a random Ethereum keypair in-browser. No accounts, no email, no telemetry. The key never leaves the device and is stored in sessionStorage for the session only.
- Private key — paste a
0x-prefixed hex private key. The app creates an XMTP signer and registers an inbox id on the network. - Wallet — connect via MetaMask (or any injected EIP-1193 provider) using wagmi. The wallet signs a one-time message to register the inbox.
Real-time messaging
Once authenticated, the app syncs all conversations with client.conversations.syncAll() and then subscribes to streamAllMessages so new DMs and group chat messages arrive in real-time without polling.
New conversations started by other users appear automatically — the stream handler upserts the conversation into the list and updates the preview.
Architecture highlights
- Bulletproof-react structure:
features/(auth, conversations, messages),components/ui/,stores/(Context + useReducer),lib/xmtp/,config/,utils/. - No Zustand — all state is managed with React Context and
useReducer. - SessionStorage for anonymous users — true anonymity; no data persists after the tab closes.
- Nickname system — users can rename conversations locally, stored in
localStorage. - Copy-to-clipboard for address and inbox id.