Public Provably Fair Verifier
Every marble race outcome is cryptographically predetermined prior to the start of betting. Verify mathematical fairness by auditing server seed unhashing, HMAC commitments, and initial slot allocations.
1. Commitment: Before betting opens for Race #N, the server generates a secret 256-bit server_seed and publishes its commitment:
Commitment = HMAC-SHA256(key = server_seed, data = client_seed + ":" + nonce)
2. Client Entropy: All player wagers contribute cryptographic entropy to the client_seed, preventing the server from altering the physics seed unnoticed.
3. Reveal & Audit: Once all marbles cross the laser finish line, the unhashed server_seed is revealed publicly. Players can compute the hashes above to guarantee the house could not manipulate the outcome mid-race.
4. Per-Room Lane Draw: One physics race of 200 lanes is shared by all betting rooms. Each room's marble numbers are shuffled onto lanes using an HMAC-SHA256 stream keyed by the committed seed:
block_c = HMAC-SHA256(key = server_seed, data = "marbleclash:lanes:v1:" + room + ":" + client_seed + ":" + nonce + ":" + c)
Each block gives 8 big-endian 32-bit words. Fisher-Yates from the top (i = 199…1, n = i+1) draws words until w < 2^32 − (2^32 mod n), then swaps positions i and w mod n. Marble #k races lane perm[k−1] + 1; your room's winner is the marble that raced the winning lane. Races before this upgrade are legacy (single shared result): marble #k raced lane #k.