Architecture¶
High-level technical architecture of the Mystery Gift platform.
System Overview¶
The Mystery Gift platform consists of several independent services that work together:
Services¶
| Service | Language | Purpose |
|---|---|---|
| Livestream Server | Node.js | 24/7 raffle automation |
| Stream Overlay | React | OBS overlay for Twitch |
| Marketplace API | TypeScript (CF Worker) | Pack purchasing |
| Marketplace Client | React | Gacha machine web UI |
| Miss AI | Node.js | Conversational AI agent |
| Randomness TEE | Rust + WASM | Verifiable randomness |
| Vault TEE | Rust + WASM | Secure NFT custody |
Shared Packages¶
blockchain- Solana utilities and RPC clientsdatabase- Prisma ORM models and migrationsrandomness- Randomness provider abstractionsshared- TypeScript types and utilities
Data Flow¶
- Token holders snapshotted via RPC
- Raffles scheduled and executed
- Winners selected via TEE randomness
- NFTs transferred from TEE vault to winners
- Announcements posted to social media
Security Model¶
- TEE Services: Private keys never leave Intel TDX enclaves
- On-chain Verifiability: All transfers verifiable on Solana/Base
- Remote Attestation: TEE services provide cryptographic proofs
Next Steps¶
- Livestream Server - Raffle automation details
- Deployment - Production deployment