How is roulette fair?

Information about how roulette is provably fair

smz avatar
Written by smz
Updated over a week ago

At the start of every day (00:00 UTC) we randomly generate a set of results that will be given out for the next 24 hours. There are 2 variables that are used for this generation:

  • Server seed (A SHA-256 hash of 16 cryptographically secure random bytes - Example: a09910148cbc5d6abda98b9f2e46deccdc672c2d410bdd8277d37498e73e1849)

  • Public seed (5 pairs of random numbers, 01 to 39 - Example: 1914223138)

After we’ve randomly generated the results, they’re given out over the next 24 hours. While they’re being given out, the server seed is hashed and will appear red on the provably fair page like so:

If we didn’t do this, customers would be able to see what results are going to be given out in advance.

At 00:00 UTC the following day, the hashed server seed used for the last 24 hours is unhashed which allows customers to verify previous results against our system.

To verify previous results, customers can use the following PHP script:

<?php

$server_seed = "96f3e04d221ca1b2048cc3b3b844e479f2bd9c80a870628072ee98fd1aa83cd0";
$public_seed = "460670512935";
$round = "321";
$hash = hash('sha256', $server_seed . "-" . $public_seed . "-" . $round);
$roll = hexdec(substr($hash, 0, 8)) % 15;
if ($roll == 0) $roll_colour = 'bonus';
elseif ($roll >= 1 and $roll <= 7) $roll_colour = 'orange';
elseif ($roll >= 8 and $roll <= 14) $roll_colour = 'black';

echo("Roll: $roll\nColour: $roll_colour");

This can be run locally or on any PHP script runner found online. We direct customers to: https://3v4l.org/ for this, but there are plenty of options available like so:

To use the script, you will need to edit the server_seed, public_seed & round variables in the script to verify results.

This information can be found here: https://csgoempire.com/fairness under ‘Roulette’. You can find specific results attached to round numbers by clicking onto a set of rounds on the right-hand side:

For example, if you run the following script it matches up with the result and side logged in the roll history for round 8878257:

<?php

$server_seed = "a09910148cbc5d6abda98b9f2e46deccdc672c2d410bdd8277d37498e73e1849";
$public_seed = "1914223138";
$round = "8878257";
$hash = hash('sha256', $server_seed . "-" . $public_seed . "-" . $round);
$roll = hexdec(substr($hash, 0, 8)) % 15;
if ($roll == 0) $roll_colour = 'bonus';
elseif ($roll >= 1 and $roll <= 7) $roll_colour = 'orange';
elseif ($roll >= 8 and $roll <= 14) $roll_colour = 'black';

echo("Roll: $roll\nColour: $roll_colour");

This helps customers prove that we pre-generated Dice as the result for 8878257 at the start of the day, and that we gave out that result correctly. If the provably fair script returned a different result, it would be obvious that we manipulated the result compared to what was given out to customers.

Did this answer your question?