Mines

Mines is a single-player grid game (5x5). Players try to reveal tiles without hitting a mine.

Events

Client -> Server

mines:start

Starts a new game.

  • Payload:

    {
        "betAmount": 10.5,
        "mineCount": 3, // 1 to 24
        "clientSeed": "user-provided-seed"
    }
  • Response: mines:start (Confirmation)

mines:reveal

Reveals a tile on the grid.

  • Payload:

    {
        "index": 12 // 0-24
    }
  • Response: mines:reveal (Result)

mines:cashout

Cashes out the current winnings.

  • Payload: None

  • Response: mines:cashout (Success/Failure)

Server -> Client

mines:start (Response)

  • Payload (Success):

mines:reveal (Response)

  • Payload (Safe):

  • Payload (Bomb/Loss):

mines:cashout (Response)

  • Payload (Success):

mines:proof

Emitted after game end (Cashout or Loss) to reveal secrets.

  • Payload:


Game Logic Details

  1. Provably Fair:

    • Uses serverSeed, clientSeed, nonce.

    • Generates the mine positions deterministically using a Fisher-Yates shuffle.

    • Public seed is captured but code notes imply it might not be strictly used for the core rng in this specific implementation (client seed + server seed dominate).