System Architecture
Complete system diagram and component interaction model for Monsuta Core.
High-Level Architecture
┌─────────────┐
│ PLAYERS │
└──────┬──────┘
│
standard login / wallet optional
│
┌──────▼──────┐
│ GAME CLIENT │
│ (Unity/Web) │
└──────┬──────┘
│
websocket / REST API
│
┌────────────────────▼────────────────────┐
│ GAME SERVER (Authoritative) │
│ │
│ • matchmaking engine │
│ • combat resolution │
│ • inventory management │
│ • AI opponents │
│ • leaderboard tracking │
│ • reward calculation │
│ • session management │
│ │
└────────────────────┬────────────────────┘
│
API calls (signed, authorized)
│
┌────────────────────────────▼────────────────────────────┐
│ MONSUTA CORE │
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌───────────────┐ │
│ │ Identity │ │ Competition │ │ Treasury │ │
│ │ Layer │ │ Layer │ │ Layer │ │
│ │ │ │ │ │ │ │
│ │ • proof-of- │ │ • seasons │ │ • reward pool │ │
│ │ play NFTs │ │ • leagues │ │ funding │ │
│ │ • achieve- │ │ • events │ │ • AVAX inflow │ │
│ │ ments │ │ • leaderboard│ │ • THC distri- │ │
│ │ • trophies │ │ contracts │ │ bution │ │
│ └──────┬──────┘ └──────┬───────┘ └───────┬───────┘ │
│ │ │ │ │
│ ┌──────▼──────┐ ┌─────▼────────┐ ┌──────▼────────┐ │
│ │ Crafting │ │ Prize Pool │ │ Staking │ │
│ │ System │ │ System │ │ Engine │ │
│ │ │ │ │ │ │ │
│ │ • blending │ │ • trustless │ │ • configurable│ │
│ │ • upgrades │ │ pools │ │ parameters │ │
│ │ • recipes │ │ • 3rd party │ │ • multi-model │ │
│ │ • minting │ │ funding │ │ support │ │
│ └──────┬──────┘ └──────┬───────┘ └───────┬───────┘ │
│ │ │ │ │
│ ┌──────▼────────────────▼───────────────────▼────────┐ │
│ │ Migration Layer │ │
│ │ • token bridge (WAX ↔ AVAX) │ │
│ │ • NFT migration │ │
│ │ • oracle network │ │
│ └────────────────────────┬───────────────────────────┘ │
└───────────────────────────┼─────────────────────────────┘
│
smart contract calls
│
┌──────────▼──────────┐
│ AVALANCHE │
│ (C-Chain / EVM) │
│ │
│ • THC ERC-20 token │
│ • prize pool escrow │
│ • achievement NFTs │
│ • crafted item NFTs │
│ • staking contracts │
│ • bridge contracts │
└─────────────────────┘
Component Responsibilities
Game Client
| Responsibility | Details |
|---|---|
| Rendering | Unity, Godot, or web-based frontend |
| Input handling | Player actions sent to server via websocket |
| Wallet integration | Optional — only triggered for on-chain actions |
| State display | Receives authoritative state from game server |
The client is a thin display layer. It has no authority over gameplay state.
Game Server
| Responsibility | Details |
|---|---|
| Matchmaking | Pairs players based on skill/league/queue |
| Combat resolution | Processes turns, abilities, damage, outcomes |
| Inventory management | Tracks in-game items, currencies, deck state |
| Reward calculation | Determines who earned what, stores pending claims |
| Session management | Authentication, reconnection, timeout handling |
| API to Monsuta Core | Submits results, triggers on-chain settlement |
The game server is server-authoritative. Clients cannot cheat by sending fabricated state.
Monsuta Core
Monsuta Core sits between the game server and the blockchain. It provides:
- Abstraction — the game server does not interact with smart contracts directly
- Modularity — each layer can be adopted independently
- Configuration — economic parameters are set per-game, not hardcoded
Avalanche (C-Chain)
| Contract | Purpose |
|---|---|
| THC Token (ERC-20) | Gameplay currency, bridge-mintable |
| Bridge Contract | Receives oracle-signed data, mints/burns tokens |
| Prize Pool Contract | Holds tournament funds, processes claims |
| Achievement Contract | Mints proof-of-play NFTs |
| Staking Contract | Configurable staking with parameter-driven rewards |
Data Flow Examples
Match Completion → Reward Claim
Player wins match
│
▼
Game Server records result
│
▼
Server updates internal reward ledger
│
▼
Player requests claim (connects wallet)
│
▼
Server signs claim data
│
▼
Claim submitted to Avalanche contract
│
▼
Contract verifies signature, transfers tokens
Tournament Flow
Sponsor deposits AVAX into Prize Pool Contract
│
▼
Contract locks funds, tournament registered
│
▼
Matches played off-chain (server authoritative)
│
▼
Server submits final standings
│
▼
Winners call claim() on Prize Pool Contract
│
▼
Contract verifies standings, releases funds
Token Bridge (WAX → Avalanche)
Player initiates teleport on WAX
│
▼
WAX contract locks tokens, emits teleport event
│
▼
Oracle(s) detect event, sign attestation
│
▼
Signatures stored on WAX chain
│
▼
Player (or relayer) calls claim() on Avalanche contract
│
▼
Contract verifies oracle signatures
│
▼
THC minted on Avalanche, delivered to player address
Multi-Game Support
Monsuta Core is game-agnostic. Multiple games can connect to the same infrastructure:
Game A ──┐
│
Game B ──┼── Monsuta Core ── Avalanche
│
Game C ──┘
Each game:
- Runs its own game server
- Configures its own staking parameters
- Defines its own crafting recipes
- Creates its own achievement types
- Can use shared or isolated prize pools
The shared infrastructure means players carry their on-chain identity across games.
Network Requirements
| Component | Network | Protocol |
|---|---|---|
| Game Client | Public internet | WSS / HTTPS |
| Game Server | Cloud / VPS | Internal API |
| Oracle Network | Internet → Chain | RPC / WS |
| Avalanche | Public chain | EVM JSON-RPC |
| WAX (legacy) | Public chain | EOSIO Hyperion |
Deployment Topology
┌─────────────────────────────────────────────────────────┐
│ CLOUD INFRASTRUCTURE │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────────┐ │
│ │ Game Server │ │ Oracle(s) │ │ API Gateway │ │
│ │ (Node.js) │ │ (Node.js) │ │ (REST/WS) │ │
│ └──────┬───────┘ └──────┬───────┘ └───────┬───────┘ │
│ │ │ │ │
│ └─────────────────┼───────────────────┘ │
│ │ │
└───────────────────────────┼──────────────────────────────┘
│
┌─────────────┼──────────────┐
▼ ▼ ▼
┌────────┐ ┌─────────┐ ┌──────────┐
│ MongoDB│ │Avalanche│ │ WAX │
│ (state│ │ C-Chain │ │ (legacy)│
│ store)│ │ │ │ │
└────────┘ └─────────┘ └──────────┘