Spunk Odds Reference

Crash guide

Crystal Crash: turning a hash into a crash point

The word Crystal names this page only; the arithmetic below would be identical under any other name. The subject is the pipeline that turns seeds into a crash multiplier, one byte at a time, so that you could repeat it with your own tools.

The four stages

  1. Combine the inputs. A secret server seed is the key; the message is built from a client seed, a round counter (the nonce) and a cursor, joined with colons.
  2. Hash them. HMAC-SHA256 produces 32 bytes, written as 64 hexadecimal digits.
  3. Take bytes and scale. The first 4 bytes, read as one big-endian whole number, lie between 0 and 4,294,967,295. Dividing by 232 gives a float u in [0, 1).
  4. Apply the game formula. For crash, a common choice is (1 - e)/(1 - u), rounded down to cents, never below 1.00.
Crystal worked example: server seed crystal-srv-41c9, client seed crystal-player, nonce 57
Server seed (revealed later)crystal-srv-41c9
Commitment shown before play: SHA-256(server seed)557535ff485a3797142cdeefcaedffc030574d96a4825bec67a5b2de2fdd9596
Client seed : nonce : roundcrystal-player:57:0
HMAC-SHA256(server seed, message)77dff9790f7109d772a8b40265a4e1d211f0486deb8d3d98d9dff7753389a9f9
First 4 bytes (8 hex digits)77dff979 = 2,011,167,097
Float = value / 2^320.4682613297
Crash point = floor(100 x 0.99 / (1 - float)) / 100, minimum 1.001.86x

One common construction, shown for teaching. Real services document their own message format; check theirs before verifying.

Why exactly 4 bytes

Four bytes give 232 = 4,294,967,296 possible values. That is fine enough that the gap between neighbouring floats is about 0.233 billionths, far smaller than anything the cent rounding can show for ordinary multipliers. Some services read more bytes, or loop through several digests, but the idea of scaling a whole number into [0, 1) is the same.

Reading the bytes big-endian means the first hex pair is the most significant. Reading them in the other order is also a valid design, but it gives a different number. When you verify a round, you must match the operator's documented byte order exactly, or every result will disagree.

Five rounds from the same seeds

Only the nonce changes from round to round. The table repeats stage 3 and stage 4 for nonces 57 to 61 with the same seeds. Each value is computed by the page's code from the HMAC digest.

Crystal seeds, nonces 57 to 61: first 8 hex digits, float and crash point (1% edge)
NonceFirst 8 hex digitsFloat uCrash point
5777dff9790.4682611.86x
5821b0380d0.1315951.14x
59b927470e0.7232563.57x
60a846b33b0.6573292.88x
61a49266800.6428592.77x

The crash points jump around with no visible pattern, which is what a good hash function should produce. A change of one digit in the nonce changes the whole digest. That is also why studying past crash points cannot reveal future ones while the server seed stays secret.

Doing the check yourself

Any language with an HMAC-SHA256 function can repeat these rows. In Python, hmac.new(server, message, hashlib.sha256).hexdigest() gives the digest; slice the first 8 characters, convert with int(x, 16), divide by 232, and apply the formula. The hash fairness guide covers the commitment step that makes the check meaningful.