Skip to content

xplodegame/xplode-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฃ Xplode - On-Chain PvP Grid Engine for Strategy Games


๐Ÿš€ See Xplode in Action: Blazing-Fast On-Chain Gameplay

showcase.mp4

๐ŸŽฅ Full End-to-End Gameplay

๐Ÿ‘‰ Watch the complete end-to-end gameplay on X (Twitter)

See the entire Xplode experience, from start to finish, as featured by MagicBlock!


๐Ÿš€ Overview

Witness Xplode's blazing-fast Mines Battle Royaleโ€”where every move is transparent & strategic.

Xplode is a revolutionary take on the classic minesweeper game, combining real-time multiplayer gameplay with blockchain technology. Players can bet using real cryptocurrencies, have their moves recorded on-chain at lightning speed, and compete for prizes in a provably fair gaming environment.

No lag. No gas. Just pure adrenaline ๐ŸŽฎ

Powered by MagicBlock's ephemeral rollups, Xplode achieves sub-50ms latency and 1ms block times, making on-chain gaming feel like Web2 while maintaining full blockchain transparency and security. Every move is recorded instantly on Solana without compromising speed or user experience.

โœจ Key Features

  • โšก Lightning-Fast On-Chain: Sub-50ms latency with MagicBlock's ephemeral rollups
  • ๐ŸŽฏ Real-time Multiplayer: WebSocket-based gaming with instant move synchronization
  • ๐Ÿ’ฐ Multi-Currency Support: SOL, USDC betting with zero gas fees
  • ๐Ÿ”— Transparent Blockchain: Every move recorded on Solana at Web2 speeds
  • ๐Ÿ† Competitive Gaming: Leaderboards, PnL tracking, and tournament support
  • ๐ŸŽจ NFT Messaging: Mint special NFTs for in-game communication and expressions
  • ๐Ÿ” Provably Fair: Cryptographically secure random number generation

๐Ÿ—๏ธ Architecture

graph TD

%% Client Layer
subgraph Client Layer
    Client[Web Client]
end

%% Game Server
subgraph Game Server
    GS_API[REST/WebSocket API]
    GS_Engine[Game Engine]
    GS_Cache[Redis Interface]
    GS_DB[DB Interface]
    GS_Xplode[Xplode Moves Client]
end

%% Wallet Server
subgraph Wallet Server
    WS_API[REST API]
    WS_DB[DB Interface]
    WS_Solana[Solana Adapter]
    WS_EVM[EVM Adapter]
end

%% Worker
subgraph Worker
    DepositWorker[Deposit BG Worker]
end

%% Infra Layer
subgraph Infra
    Redis[Redis Cache]
    DB[(PostgreSQL DB)]
end

%% External Services
subgraph External Services
    XplodeMoves[Xplode Moves API]
    SolanaRPC[Solana RPC Node]
    EVMDeposits[EVM Bridge]
end

%% Ephemeral Rollup Layer
subgraph Ephemeral Rollup Layer
    RollupClient[Ephemeral Rollup Client]
    EphemeralRollup[Ephemeral Rollup Node]
end

%% Blockchain
subgraph Blockchain
    Solana[Solana Blockchain]
end

%% Client Connections
Client --> GS_API
Client --> WS_API

%% Game Server Flow
GS_API --> GS_Engine
GS_Engine --> GS_Cache
GS_Engine --> GS_DB
GS_Engine --> GS_Xplode
GS_Cache --> Redis
GS_DB --> DB
GS_Xplode --> XplodeMoves
XplodeMoves --> RollupClient
RollupClient --> EphemeralRollup
EphemeralRollup --> Solana

%% Wallet Server Flow
WS_API --> WS_DB
WS_API --> WS_Solana
WS_API --> WS_EVM
WS_DB --> DB
WS_Solana --> SolanaRPC
WS_EVM --> EVMDeposits

%% Worker Flow
DepositWorker --> DB
DepositWorker --> SolanaRPC

Loading

๐Ÿ”ง Core Services

Service Port Description
Game Server 3000 WebSocket-based multiplayer game logic with geo-localized matchmaking
Wallet Server 8080 HTTP API for deposits, withdrawals, user management, and transaction handling
Deposit Worker - Background service for processing blockchain deposits
Discovery Service - Redis-based service for intelligent server routing and player matchmaking

๐ŸŽฎ How It Works

  1. Blazing-Fast Matchmaking: Intelligent server localization redirects players to servers closest to game creators
  2. Game Creation: Players create or join game rooms with customizable parameters
  3. Betting: Set bet amounts in supported cryptocurrencies (SOL, USDC)
  4. Lightning Gameplay: Take turns revealing cells in a minesweeper grid with sub-50ms response times
  5. Instant Blockchain Recording: Each move is recorded on Solana blockchain via MagicBlock's ephemeral rollups
  6. Real-time Settlement: Winners receive the pot instantly with zero gas fees
  7. NFT Messaging: Mint special NFTs for in-game communication and player expressions
  8. Instant Rematch: Real-time rematch confirmations feel almost instantaneous

๐Ÿš€ LIVE on Devnet! Experience the future of on-chain gaming with Web2-level performance.

๐ŸŽฏ Game Mechanics

  • Intelligent Matchmaking: Server localization for optimal latency based on game creator location
  • Grid Sizes: Customizable from small (8x8) to large grids
  • Bomb Density: Adjustable number of mines per game
  • Turn-Based: Players alternate moves until someone hits a mine
  • Time Limits: Configurable time limits to keep games moving
  • Instant Rematch: Real-time rematch confirmations with sub-second response times
  • NFT Communication: Express yourself through mintable in-game NFT messages

๐Ÿ› ๏ธ Technology Stack

Core Gaming Infrastructure

  • Language: Rust ๐Ÿฆ€
  • Web Framework: Actix-web
  • WebSocket: tokio-websockets
  • Database: PostgreSQL with SQLx
  • Cache: Redis

Blockchain Infrastructure

  • MagicBlock Ephemeral Rollups: 1ms block times, sub-50ms latency
  • Solana Blockchain: Base layer for final settlement
  • Anchor Framework: Smart contract development
  • Xplode Moves API: Custom game state management

Infrastructure

  • Containerization: Docker with multi-region deployment
  • Deployment: Fly.io with intelligent server localization
  • Monitoring: Built-in health checks and metrics
  • Scalability: Horizontal scaling with Redis-based discovery and geo-routing
  • Load Balancing: Smart player routing to optimal game servers

Blockchain Integration

  • MagicBlock Ephemeral Rollups: Sub-50ms latency for real-time on-chain gaming
  • Solana Program: Custom program for game state management via Xplode Moves API
  • Lightning Move Recording: Each game move recorded on-chain at Web2 speeds
  • Zero Gas Fees: Gasless transactions for seamless user experience
  • Secure RNG: Cryptographically secure random number generation
  • Multi-Signature: Treasury management with multi-sig support

๐Ÿš€ Quick Start

Prerequisites

  • Rust 1.70+
  • PostgreSQL 14+
  • Redis 6+
  • Solana CLI tools

Installation

  1. Clone the repository
git clone https://github.com/your-username/mines-backend.git
cd mines-backend
  1. Set up environment variables
cp .env.example .env
# Edit .env with your database and blockchain configurations
  1. Database setup
# Create database and run migrations
psql -f migrations/create_schema.sql
  1. Build and run
# Build all services
cargo build --release

# Run game server
cd server && cargo run

# Run wallet server (in another terminal)
cd wallet && cargo run

๐Ÿ† Game Features

Supported Currencies

  • SOL: Native Solana token
  • USDC: USD Coin stable currency

Game Modes

  • Quick Match: Blazing-fast matchmaking with intelligent server localization
  • Private Rooms: Create custom games with friends on optimized servers
  • Tournaments: Structured competitive events with real-time progression
  • Practice Mode: Free play for learning without gas fees

NFT Communication System

  • Express Emotions: Mint GIF-based NFTs for in-game reactions
  • Player Interactions: Send NFT messages during gameplay
  • Community Building: Collect and trade unique communication NFTs
  • Achievement Unlocks: Special NFTs for gameplay milestones

๐Ÿ”’ Security Features

  • On-Chain Verification: All game moves recorded on blockchain
  • Multi-Signature Treasury: Secure fund management
  • Rate Limiting: Protection against abuse and spam
  • Input Validation: Comprehensive validation of all user inputs

๐Ÿš€ Deployment

The project is designed for cloud deployment with Docker containerization:

# Deploy game server
docker build -f server/Dockerfile.game-server -t xplode-game .
docker run -p 3000:3000 xplode-game

# Deploy wallet server (handles all wallet functionality)
docker build -f wallet/Dockerfile.wallet-server -t xplode-wallet .
docker run -p 8080:8080 xplode-wallet

๐Ÿค Contributing

We welcome contributions!

Development Guidelines

  • Follow Rust best practices and conventions
  • Add tests for new functionality
  • Update documentation for API changes
  • Ensure all tests pass before submitting

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ”— Links & Community

๐Ÿ™ Acknowledgments

Shoutout to MagicBlock for making on-chain gaming real-time

MagicBlock's ephemeral rollups have revolutionized our gaming experience, enabling:

  • Sub-50ms latency for real-time blockchain gaming
  • Zero gas fees for seamless user experience
  • Horizontal scaling for massive multiplayer support

Built with โค๏ธ using Rust, Solana & MagicBlock

Bringing blockchain gaming to the mainstream, one mine at a time ๐Ÿ’ฅ

About

Blazing-fast, on-chain PvP game engine powering real-time grid battles on Solana.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages