Towers
Towers is a single-player game where players climb a tower of 8 layers. Each layer contains multiple buttons — some safe, some bombs. Players reveal one button per layer and can cash out any time after passing at least one layer.
Difficulty Reference
easy
3
1
2/3 (~66.7%)
medium
4
2
2/4 (50%)
hard
3
2
1/3 (~33.3%)
Button indices are 0-based. Valid range: 0 to buttons - 1 (e.g. 0–2 for easy/hard, 0–3 for medium).
Multiplier formula: ((1 - 0.10) / probability) ** layer (10% house edge)
Events
Client → Server
towers:start
Starts a new game.
{
"amount": 10.5,
"difficulty": "easy",
"clientSeed": "user-provided-seed"
}amount: number, min0.01, max50difficulty:"easy"|"medium"|"hard"clientSeed: non-empty string (used for Provably Fair)
towers:reveal
Reveals a button on the current layer.
button: integer index,0tobuttons - 1for the current difficulty
towers:cashout
Cashes out at the current multiplier. Requires at least one layer to have been successfully revealed.
Payload: (none)
Server → Client
towers:start (Response)
Success:
Failure:
Possible failure messages: "Bets are currently disabled", "Invalid difficulty", "clientSeed is required", "Invalid bet amount", "Max bet is $50", "Invalid user", "You have an active game", "Insufficient balance", "An error occurred".
towers:reveal (Response)
Safe tile — game continues:
Bomb hit — game over:
patternis the full 8-layer board revealed.0= bomb,1= safe.proofis present only if the server seed is still held in memory (normal flow). Always verifyserverSeedby hashing it and comparing toserverSeedCommitment.
All 8 layers cleared — auto cashout:
Error:
towers:cashout (Response)
Success:
proofis present under normal conditions. Always verify by hashingserverSeed→ compare toserverSeedCommitment.
Failure:
Possible failure messages: "No active game", "You must reveal at least one layer", "An error occurred".
Provably Fair
The outcome of every layer is determined before the game starts using:
serverSeed— random 32-byte hex, generated by the server. Kept secret until game end.serverSeedCommitment—SHA-256(serverSeed). Sent to the client at game start so they can verify fairness after the game.clientSeed— provided by the player. Included in the outcome derivation, giving the player control.nonce— a per-user incrementing counter.
Verification (after receiving serverSeed):
Compute
SHA-256(serverSeed)and confirm it matches theserverSeedCommitmentyou received at game start.For each layer
l(0-indexed, 0 = bottom), the button layout is determined by a Fisher-Yates shuffle seeded withHMAC-SHA256(serverSeed, "${clientSeed}:${nonce}:i:layer_${l}").
Disconnect Behaviour
If the player disconnects before revealing any layer, the bet is fully refunded.
If the player disconnects after revealing at least one layer, an automatic cashout is performed at the current multiplier.
Last updated