Back to all projects

Word Dash

Real-Time Multiplayer Typing Game with On-Chain SOL Rewards

A real-time multiplayer typing game where two players race to finish a given text, staking SOL through a custom Solana Anchor program that automatically pays out the winner from a shared on-chain vault.

Live DemoRepository

Word Dash pairs two players in a live typing race, using a custom Solana Anchor program to escrow stakes and automatically pay out the winner on-chain once the race concludes.

  • Competitive typing games need sub-second synchronization of opponent progress to feel fair and responsive.
  • Trustlessly rewarding a winner requires on-chain staking and payout logic instead of a centralized ledger.
  • Players disconnecting mid-race or failed blockchain transactions both need graceful, well-defined recovery paths.

A Next.js client talks to a Rust/Tokio WebSocket server for matchmaking and live race state, while a Solana Anchor program independently handles staking and payout via program-derived addresses.

System Architecture DiagramClick to expand
Word Dash Architecture Diagram
Data Flow

Players connect their Solana wallets and enter Quick Match, Create Room, or Join Room.

Once matched, both clients initialize and fund an on-chain game vault via the Anchor program.

The server broadcasts the race text once both players are funded.

Each keystroke streams progress to the opponent over WebSocket.

The first player to finish triggers an on-chain claim that pays out the vault automatically.

Key Architectural Decisions

  • ✓Built a Rust WebSocket server on Tokio to manage rooms, matchmaking, and live progress broadcasting between two players.
  • ✓Wrote a Solana Anchor program that creates a game and vault PDA per match, letting both players stake SOL before the race starts.
  • ✓Implemented automatic winner payout via an on-chain claim call, with a retry flow for failed transactions and automatic forfeit handling on disconnect.
RustNext.jsTypeScriptTailwind CSSWebSocketTokioSolanaAnchorDocker
  • Splitting matchmaking (WebSocket) from settlement (Solana) kept each system simple and let failures in one be handled independently of the other.
  • A dedicated funding handshake before the race starts avoids ambiguity about whether both players have actually staked.