Crash Fairness

Our Crash is a provably fair game, which means players from all over the world can manually and individually verify the fairness of each match that is hosted by our reliable system.

Technical Details

Crash's fairness is guaranteed by using a long chain of hashed values that provide a fair distribution of random outcomes. This chain is calculated before any game is initiated and starts with 32 bytes of cryptographically secure pseudorandom numbers, followed by the hash of the previous value. Along with this chain, a 32-byte public salt is also added to ensure that the initial value of the hash chain was not chosen in favor of the house.

The result for each match is determined by feeding the following variables into a SHA256 HMAC hashing algorithm:

  1. Public Salt is a hex string of 32 bytes of the chosen value. The public salt of the current chain is
  2. Secret is the current hash value of the hash chain.
1async function hmacSHA256(keyString, messageString) {
2	const enc = new TextEncoder("utf-8");
3	const key = await window.crypto.subtle.importKey(  
4        "raw",
5        enc.encode(keyString),
6        {
7            name: "HMAC",
8            hash: {name: "SHA-256"}
9        },
10        false,
11        ["sign", "verify"]
12    );
13
14    const sign = await window.crypto.subtle.sign(
15        "HMAC",
16        key,
17        enc.encode(messageString)
18    );
19
20    const bytes = new Uint8Array(sign);
21    return Array.prototype.map.call(bytes, x => ('00' + x.toString(16)).slice(-2)).join("");
22}
23
24async function getMultiplierForHashValue(hashValue, salt, leverage) {
25    const hash = (await hmacSHA256(hashValue, salt)).toLowerCase();
26
27    // Use the most significant 52-bit from the hash to calculate the crash point
28    const value = parseInt(hash.substring(0, 52 / 4), 16);
29    const maxValue = Math.pow(2, 52);
30
31    return Math.floor(
32        Math.max(
33            100,
34            (100 * maxValue - 3 * value) / (maxValue - value) * (1 - leverage / 100)
35        )
36    ) / 100;
37}
38
39const secret = "ddcf544330c1fc826cb36e93866e1e3ec292d60e1242ce6ef5468376cc8541ad";
40const publicSalt = "56c49d1fe912f52855afc1240febed3ac58b944c2022c1bb64edfdf848c3df4d";
41const leverage = 6.66;
42getMultiplierForHashValue(secret, publicSalt, leverage).then(
43	(multiplier) => console.log(multiplier)
44);

Recent Rounds