Provably Fair
← Back to Game

Verify Game Fairness

Enter a Game ID to verify the cryptographic proof

Manual Verification

Enter seeds to independently calculate the map

5x5
6x6
7x7
How Provably Fair Works

Game Flow

PLAYER
BACKEND
CONTRACT
PYTH VRF
SETUP
P
PrepareRequest game
B
Salt Hashkeccak256(salt)
B
Commiton-chain
VRF
P
Start Gamebet + VRF fee
C
Requestentropy()
V
CallbackvrfSeed
GAMEPLAY
B
Set TilesbombBitmap
REPEAT
P
Move
B
Reveal
FINALIZE
B
Completereveal salt
C
Verifyrecalc
$
PayoutMON

Map Generation Algorithm

// 1. Final seed from dual-source randomness
finalSeed = keccak256(vrfSeed + backendSalt + gameId + VERSION)

// 2. Start tile (bottom row) and finish tile (top row)
startHash = keccak256(finalSeed + gameId + "start" + VERSION)
start = bottomRow[startHash % gridWidth]
finishHash = keccak256(finalSeed + gameId + "finish" + VERSION)
finish = topRow[finishHash % gridWidth]

// 3. Trap positions via Fisher-Yates with path guarantee
for nonce = 0 to 100:
  for i = 0 to trapCount:
    hash = keccak256(finalSeed + gameId + "bomb" + nonce + i + VERSION)
    j = i + (hash % (availableTiles - i))
    swap(positions[i], positions[j])
  traps = positions[0..trapCount-1]
  if pathExists(start, finish, traps): break

// 4. Reward tiles (same Fisher-Yates on remaining tiles)
rewardCount = random(minRewards, maxRewards)
for i = 0 to rewardCount:
  hash = keccak256(finalSeed + gameId + "rewardPos" + i + VERSION)
  // ... same shuffle logic

Why Backend Cannot Cheat

Salt committed before VRF: Backend cannot change salt after seeing the random seed
VRF is unpredictable: Backend cannot predict Pyth's random number when committing salt
On-chain verification: Contract recalculates all trap positions and verifies every tile claim
Wrong claims = revert: If backend lies about any tile, transaction fails and player keeps bet