Decentralized, end‑to‑end encrypted group messaging on AO — rebuilt with a clean modular architecture and fully powered by HyperBEAM.
Updated: 2025-10 Docs Version: v1.0 Current Version: Alpha 0.4.0
DM ("Sup Chat") is a decentralized, end-to-end encrypted messenger built entirely on AO and HyperBEAM. The application recently underwent a major refactor into a clean, modular codebase that separates responsibilities across dedicated frontend modules for clarity, performance, and extensibility.
This version includes:
- Fully HyperBEAM-integrated messaging
aoconnect0.0.91 with polyfills (configured in Vite)- Messaging style that currently uses compute-slot query returns (similar to LegacyNet execution)
- A coming evolution toward push-based messaging + endpoint-driven state fetch
# Install
npm install
# Run locally
npm run dev- Install the Wander Wallet browser extension.
- Open the development server URL.
- Connect your wallet.
- Start messaging — all content is encrypted and decentralized.
- Wander Wallet (browser extension)
- Modern browser with Web Crypto API
- HyperBEAM connectivity
- aoconnect 0.0.91 (with included polyfills)
- Any static server or Vite-dev workflow
DM uses a modular frontend architecture paired with a scalable master/child AO process system.
- Wallet connection & AO signing
- Message encryption/decryption
- UI rendering, themes, toasts, reactions
- Session lifecycle, reconnection, timers
- Caching, local state, refresh logic
-
Master Process
- Maps users → their child messaging processes
- Spawns new child processes on login
-
Child Process
- Fully isolated per-user state and data
- Handles chats, messages, contacts, reactions
- Enforces owner validation
bootstrap.js → wallet-login.js → messaging.js
↓ ↓
session.js contacts.js
↓ ↓
core-ui.js emoji-reactions.js
A clean tree representation of the current frontend modules:
src/
├── bootstrap.js # App entry point, initializes everything
├── wallet-login.js # Wallet state, AO login, aliased exports
├── session.js # Session lifecycle, timers, reconnection
├── messaging.js # Message send/receive logic, refresh logic
├── contacts.js # Contact management
├── emoji-reactions.js # Emoji reactions + cached reaction state
└── core-ui.js # Theme, toasts, UI helpers
- User connects Wander Wallet → frontend obtains
userAddress. - Frontend calls master process login → master returns (or spawns) the user's child process ID.
- Frontend stores this ID and all messaging routes through the child process moving forward.
The login flow is designed to be instant and transparent, showing only a spinner until ready.
DM currently uses a compute-slot messaging model, where messages are sent to AO and retrieved via query results.
- AES‑256‑GCM shared chat key per room
- RSA‑OAEP encrypted key per member
- Per-message unique IV
- Cached decrypt results to reduce compute
- Reaction updates share the same flow
Message refresh logic runs through messaging.js, including:
- Per-member message counts
- State hash comparison
- Local cache invalidation
Emoji reactions are handled in emoji-reactions.js.
- Reactions are cached
- Duplicates prevented at UI level
- Reaction metadata preserved per message
contacts.js manages the local + remote contact list, including:
- Adding known users
- Syncing known contacts to the child process
- End-to-end encryption across all chats
- Per-user AO child process provides isolation
- Owner validation enforced on every handler
- No cross-user state sharing
DM uses a multi-part version tag:
MASTER_VERSION - USER_PROCESS_VERSION - FRONTEND_VERSION
Example: A01-A01-A01
The frontend displays the user's BUILD_VERSION and participates in update flows when backend or child processes change.
The next stages of development include:
- Endpoint-state fetching for minimal compute costs
- Custom emoji support (including themed packs)
- New UI skins / themes
- Richer message types (files, images, reactions v2)
- More performant local cache and sync logic
npm install
npm run dev- Small, single-responsibility modules
- Clear data flow from bootstrap → wallet → session → messaging
- AO child process isolation ensures scalability
MIT License.