A real-time multiplayer snake game with instant gameplay and on-chain USDC staking.
KŌBRA is a competitive multiplayer snake game where players stake real USDC and battle for 2 minutes in a provably fair arena. Every move is cryptographically signed through Yellow Network's state channels — solving the fundamental problem that has trapped Web3 gaming in an impossible trade-off.
THE PROBLEM
Competitive Web3 gaming is currently broken, forcing developers to choose between two failing options:
Option 1: Fully On-Chain Games
Option 2: Fully Off-Chain Games (Traditional Servers)
The myth is that "real Web3 games should be fully on-chain." The reality? Putting every action on-chain makes games financially and technically unplayable. Judges don't want full on-chain execution — they want solutions that make Web3 gaming actually viable.
THE SOLUTION: Yellow State Channels
KŌBRA uses Yellow Network's state channels to unlock Option 3: Web2 speed + Web3 security.
How it works:
The Result:
WHY THIS MATTERS
Without Yellow, KŌBRA would be just another centralized game server where you have to trust us. Yellow state channels make every game action cryptographically provable:
The leaderboard isn't a database — it's a collection of on-chain settlement proofs. Your rank is mathematically verifiable, not just claimed.
A live UI overlay quantifies Yellow's impact: real-time state counter, gas oracle showing on-chain cost ($20+) vs actual cost ($0.00), and ClearNode connection status. This makes the value proposition visible during every match.
BUSINESS MODEL
Revenue: 2% platform fee on winner's share (e.g., $5 stake match = $10 pot → winner gets $7.84, loser gets $2.00, platform gets $0.16)
Retention: Proof-of-Skill leaderboard where every score links to its on-chain settlement proof — players build verifiable reputation that can't be faked
Expansion: The Yellow state channel architecture is game-agnostic. Same infrastructure works for chess, poker, racing, any skill-based competition. Multi-game competitive platform with a unified trust layer.
CORE INNOVATION
KŌBRA proves that real-time competitive gaming CAN work on Web3 by embracing off-chain execution with cryptographic proofs — the exact use case state channels were designed for. This isn't a compromise; it's the correct architecture for high-frequency interactions.
Deployed on Base Sepolia. Live demo available. Code open-sourced.
KŌBRA is a multiplayer snake battle game built as a Next.js 14 web app using the App Router for seamless UI navigation. It leverages Yellow Network's state channels via the @erc7824/nitrolite SDK to enable real-time, off-chain game state streaming between players, drastically reducing blockchain interactions and gas costs. At the core, a USDC-based Escrow smart contract deployed on Base Sepolia handles trustless stake locking and settlement, compiled and deployed with Hardhat for reliable testing and integration.
The flow starts when a player selects a stake tier and matches with an opponent: both sign a match agreement through MetaMask, invoking createAppSessionMessage() to open a dedicated state channel with Yellow's ClearNode sandbox over WebSocket. This shifts all gameplay—snake movements, food spawns, collisions, and boosts—to off-chain updates, avoiding costly on-chain transactions.
A Socket.io-powered game server acts as the authoritative physics engine, broadcasting normalized state at 10-20 ticks per second to keep clients in sync. Each tick updates a local counter in the HUD for visual feedback. To maintain channel integrity without overwhelming the user, we throttle signing to every 50th tick using createSubmitAppStateMessage(), pushing signed states to ClearNode; upon acknowledgment, a "confirmed" counter increments, providing a live demo of local vs. channel operations. A real-time gas oracle panel estimates on-chain equivalents (e.g., 21k gas per update times base fee and ETH price) and highlights Yellow's $0.00 cost savings, emphasizing the efficiency of ERC-7824 state channels in enabling scalable, low-latency multiplayer without blockchain bloat.
At match end—via elimination, timeout, or forfeit—the client sends a FINALIZE intent with createCloseAppSessionMessage(), generating a signed settlement proof from ClearNode. The winner submits this proof to the Escrow's settle() function on-chain to claim both stakes, ensuring trustless payouts.
Cross-chain funding is streamlined via LI.FI's bridge widget: the DepositModal component integrates LI.FI's React SDK, configured for Base Sepolia USDC, allowing deposits from any supported chain without manual bridging, enhancing accessibility for players on diverse networks.
Player identities are humanized with ENS resolution through a custom useENS hook, fetching names and avatars so lobbies, matches, and results display readable profiles instead of raw addresses. Wallet management relies on wagmi v2 and RainbowKit for smooth connections, while the Yellow session is persisted as a singleton on window.__yellowSession to survive Next.js page transitions—preventing WebSocket disruptions mid-game. We added loading.tsx boundaries to eliminate UI flashes during route changes.
Notable hacks: Storing the session as a global singleton was crucial since Next.js unmounts components on navigation, which could kill the channel; cleanup only triggers on beforeunload for safe closure. Throttling signatures to 50-tick intervals avoids bombarding MetaMask with popups (potentially 20/sec), yet the UI counter updates every frame for lively visuals, balancing usability and demo appeal. This setup with partner tech like Yellow and LI.FI not only cuts costs by 95%+ via off-chain batching but also delivers a fluid, blockchain-agnostic experience for competitive gaming.

