Provably Fair

Verify Game Fairness

Enter a Game ID to verify the cryptographic proof

Game Flow

PLAYER
BACKEND
CONTRACT
PYTH RNG
1
prepare game
2
saltHash = keccak256(salt)
3
saltHash on-chain
4
startGame() + VRF fee
5
request VRF
6
vrfSeed callback
7
reveal salt + complete
8
verify & payout

Final Seed Generation

// Dual-source randomness - neither party can manipulate
finalSeed = keccak256(vrfSeed + backendSalt + gameId + VERSION)

// Trap positions via Fisher-Yates shuffle
for i = 0 to trapCount:
  hash = keccak256(finalSeed + gameId + "mine" + i + VERSION)
  j = i + (hash % (gridSize - i))
  swap(positions[i], positions[j])

traps = positions[0..trapCount-1]

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