Skip to main content

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

ResponsibilityDetails
RenderingUnity, Godot, or web-based frontend
Input handlingPlayer actions sent to server via websocket
Wallet integrationOptional — only triggered for on-chain actions
State displayReceives authoritative state from game server

The client is a thin display layer. It has no authority over gameplay state.

Game Server

ResponsibilityDetails
MatchmakingPairs players based on skill/league/queue
Combat resolutionProcesses turns, abilities, damage, outcomes
Inventory managementTracks in-game items, currencies, deck state
Reward calculationDetermines who earned what, stores pending claims
Session managementAuthentication, reconnection, timeout handling
API to Monsuta CoreSubmits 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:

  1. Abstraction — the game server does not interact with smart contracts directly
  2. Modularity — each layer can be adopted independently
  3. Configuration — economic parameters are set per-game, not hardcoded

Avalanche (C-Chain)

ContractPurpose
THC Token (ERC-20)Gameplay currency, bridge-mintable
Bridge ContractReceives oracle-signed data, mints/burns tokens
Prize Pool ContractHolds tournament funds, processes claims
Achievement ContractMints proof-of-play NFTs
Staking ContractConfigurable 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

ComponentNetworkProtocol
Game ClientPublic internetWSS / HTTPS
Game ServerCloud / VPSInternal API
Oracle NetworkInternet → ChainRPC / WS
AvalanchePublic chainEVM JSON-RPC
WAX (legacy)Public chainEOSIO 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)│ │ │ │ │
└────────┘ └─────────┘ └──────────┘