Architecture Overview
XMTP Integration Pattern
Protocol Flow
Group Lifecycle:- Creation: Creator creates optimistic group at event minting
- Population: Ticket purchases trigger member additions (Optimistic Group Creation)
- Activation: Event start enables real-time messaging
- Persistence: Group ID stored in event metadata for discovery
Database Management
Persistent Storage:- Each user gets dedicated database (
xmtp-${userAddress}) - No database conflicts between different wallet connections
- Stable client state across browser sessions
- Reduced worker spawning with consistent DB paths
Security & Privacy
Access Control
Ticket-Based Permissions:- Only ticket holders can join group chats
- Creator verification before group creation
- Real-time access revocation for refunded tickets
- End-to-end encryption via XMTP protocol
- Decentralized storage prevents platform censorship
- User-controlled data with client-side key management
Consent Management
Explicit Consent Model:Performance Optimizations
Client Lifecycle
Connection Pooling:- Single client per wallet across all events
- Persistent connections avoid repeated initialization
- Efficient memory usage with shared client instances
- Stable DB paths prevent worker respawning
- Incremental sync reduces bandwidth usage
- Local caching for message history
Recovery Mechanisms
Client Recovery:- Automatic reconnection for dropped connections
- State recovery from persistent storage
- Fallback modes for degraded functionality