1. Getting Started
[Game] FairPlay API
  • Getting Started
    • Introduction
    • Session and Token
    • Request and Response
    • Real-time Events (SSE)
    • Lotto Rules — หวยเฮงเฮง
    • Provably Fair
  • Player
    • Demo
      • Demo Login
    • Player Bet History
      GET
  • Common
    • Game
      • By Game Code
        • Provably Fair
          • Set Client Seed
          • Verify Result
          • Get Revealed Server Seed
        • Check Session
        • Get Balance
        • Get Provably-Fair State
      • Lobby Game List
  • Wallet
    • Wallet Status
      GET
  • Game
    • Lotto (หวยเฮงเฮง)
      • Lotto Rules
      • Rooms
        • By Room
          • Join Round
          • Place Multi-player Bet
          • Get Round Result
          • Room Event Stream
      • Tickets
        • Create Ticket
        • Inquiry My Tickets
        • Get Ticket
      • Round
        • Get My Bets
        • Get My Result
        • Get Round Provably Fair
      • Results
        • Inquiry Results
      • Get Rooms
      • Get Current Round
      • Get Pay Table
  • Appendix
    • Game List
    • Error Codes
    • Rate Limits
  • Language List
    GET
  • Ping
    GET
  • Schemas
    • DemoLoginRequest
    • DemoLoginResponse
    • DemoProfileResponse
    • ProfileResponse
    • GetHistoryResponse
    • BetRecord
    • GameInfo
    • Room
    • GetGameResponse
    • BetRequest
    • Bet
    • BetResponse
    • BetResult
    • GetProvablyFairResponse
    • SetClientSeedRequest
    • SetClientSeedResponse
    • RotateServerSeedResponse
    • VerifyResultRequest
    • VerifyResultResponse
    • GetServerSeedResponse
    • GetStatusResponse
    • JoinRoundResponse
    • PlaceMultiPlayerBetRequest
    • PlaceBetResponse
    • RoundResultResponse
    • SuccessResponse
    • ErrorResponse
  1. Getting Started

Provably Fair

Provably fair lets a player check that a result was fixed before they bet and was not changed afterwards.

Model#

THAI-HILO single-player (SINGLE rooms, POST /g/thai-hilo/bet): each player has one state per game and per demo/real mode — a secret server seed (64-character lower-case hex), its hash, a client seed and a nonce. It is created on the first provably-fair call or bet with clientSeed "default" and nonce 1.
Commitment: serverSeedHash = lower-case hex SHA-256 of the server seed text. Show it before the player bets; the active server seed itself is never returned.
Client seed: POST /provably-fair/client-seed replaces the client seed and resets the nonce to 0; the server seed and its hash do not change.
Nonce: each single-player bet uses the current nonce, then the nonce goes up by 1.
Roll: bytes = HMAC-SHA256(key = the server seed as text — the 64 hex characters as-is, NOT hex-decoded; message = clientSeed + ":" + nonce in decimal). Die i (i = 0, 1, 2) = floor(uint32 big-endian of bytes[4i..4i+3] / 2^32 × 6) + 1.
Rotation: POST /provably-fair/rotate reveals the current server seed (revealedServerSeed with oldServerSeedHash), replaces it with a new one and resets the nonce to 1; the client seed is kept. Bets made under a seed can only be verified after that seed has been rotated out. GET /provably-fair/server-seed returns a rotated-out seed again by its hash.
Verify: POST /provably-fair/verify-result recomputes from what FE sends (serverSeed, clientSeed, nonce) and returns the dice and the SHA-256 of the seed. FE checks the hash equals the commitment shown before the bets and the dice equal the recorded roll; nothing is looked up on the server.
LOTTO, and THAI-HILO MULTI / MULTI_CSEED rooms, have no per-player server seed: each round publishes its own seedHash when it opens and reveals the seed at settlement. A MULTI round seed is the text "{brand}{gameCode}{roomID}{unixNano}{result}_{64-hex nonce}" (the drawn result is embedded; hash = SHA-256 of that text). A MULTI_CSEED round seed combines the room server seed with the round's client-seed slots.
In MULTI_CSEED rooms of both games, the player's clientSeed and nonce are what a bet contributes when it claims a client-seed slot.
The shared endpoints are under /c/g/{gameCode}/provably-fair; rotating the single-player seed is Thai Hilo's own /g/thai-hilo/provably-fair/rotate. For Lotto rounds, /g/lotto/round/provably-fair returns the round's seeds once it has settled — see Game → Lotto (หวยเฮงเฮง) → Lotto Rules → Round modes.
Modified at 2026-09-30 13:51:10
Previous
Lotto Rules — หวยเฮงเฮง
Next
Demo Login
Built with