On-chain gaming platform where players stake crypto to battle AI, and compete for prize pools.
We’re building an on-chain competitive gaming platform that combines on-chain game logic, staking mechanics, and AI-powered analysis. The result is not just another on-chain game, but a full ecosystem for skill-based competitive events with real rewards and AI-enhanced insights. Here’s how it works:
Admin Portal: Event organizers create new game definitions using smart contracts. For each event, they configure prize pools, minimum stake amounts, and event durations — all recorded transparently on-chain.
Player Dashboard: Users browse available games and stake tokens to join events. For now, we’ve implemented a unique 4x4 Tic-Tac-Toe variant where:
The goal is to line up 4 in a row (row, column, or diagonal).
Every 4th turn, your move from 4 turns ago is erased — preventing endless draws and forcing dynamic play.
Gameplay Outcome: Once a match concludes, we generate a comprehensive result sheet: total moves, total time played, and a move-by-move history. A score is then computed and used to update the event leaderboard.
AI Post-Match Analyser: We integrated an autonomous AI agent hosted on AgentVerse. It reviews the complete game state and rules, then provides a strategic analysis of what could have been done better — almost like having a professional coach break down your performance.
Event Rewards: At the end of the event duration, the top players on the leaderboard receive their share of the prize pool by claiming.
⛓️ The On-Chain Foundation (Smart Contracts)
Technologies Used: We used Solidity to write the smart contracts and Foundry as our development framework. Foundry's speed and testing capabilities were crucial for iterating quickly and ensuring our contracts were correct.
How It's Pieced Together:
GameFactory.sol: This is a registry contract. Its only job is to deploy new, verified GameHub contracts. This ensures that every tournament is created from a trusted template. An admin calls this contract to create a new game type (like our 4x4 Tic-Tac-Toe).
GameHub.sol: This is the main contract for each tournament. It manages the entire lifecycle: handling player registration and staking, locking funds in the prize pool, recording the final winner, and claiming the prize . It's the on-chain referee and treasurer.
🎨 The User Experience (Frontend)
Technologies Used: The frontend is built with Next.js and TypeScript, providing a fast, modern, and type-safe development environment. For blockchain interaction, we used the Wagmi library, which provides amazing React hooks for wallet connections, contract reads, and contract writes, all powered by Ethers.js under the hood. The UI is built with Tailwind CSS and shadcn/ui for a clean, component-based design.
How It's Pieced Together: The frontend reads data directly from the GameHub contract ABI code to display active tournaments, prize pools, and leaderboards. When a user wants to join a game, the frontend uses ethers hooks to trigger the stake function in the smart contract, prompting the user to sign the transaction with their wallet.
🧠 The Off-Chain Brain (Backend & AI).
Technologies Used: A lightweight Node.js server using the Express.js framework. This server acts as an orchestrator and state manager for active games.
How It's Pieced Together: When a game starts, the frontend communicates with our Node.js server via a REST API to send moves back and forth. The server manages the temporary game state, like the current board layout and whose turn it is. Once the game is over, the frontend sends the final result to the GameHub smart contract to be permanently recorded.(stored on walrus & blobId on smartcontracts
we offloaded the complex AI logic to a specialized partner. After a game concludes, our Node.js backend packages the entire move history and analysis the game strategic insights.
💡 A Notable "Hacky" Implementation The most interesting technical challenge was designing our 4x4 Tic-Tac-Toe with the move erasure rule.
Standard Tic-Tac-Toe is often a solved game. We wanted something more dynamic. The rule is: on your 4th turn (and every turn after), your move from 4 turns ago is erased. This prevents stalemates and forces players to think about both offense and defense in a constantly changing environment.
The "Hack": Putting this complex, turn-by-turn logic on-chain would be incredibly gas-intensive. Each move would require multiple state changes (add a new piece, find and remove the old one).
Our Solution: We adopted a hybrid approach. The real-time management of the board state and the erasure rule is handled by our off-chain Node.js backend for speed and cost-efficiency. Players' clients communicate with this server during the match. However, the final outcome (who won) is the only thing that gets reported to and verified by the on-chain GameHub contract. This gives us the best of both worlds: a fast, complex game experience with the trust and security of an on-chain settlement.

