Spunk Odds Reference

Plinko guide

Dragon Plinko: mapping a hash to every peg bounce

The dragon name is only a label, chosen for the page, and it hides no special mechanics. This page traces one 15-row drop from a hash digest down to its final slot, one row at a time.

Why plinko needs many random numbers

A dice roll needs one random value. A plinko drop needs one per row, because each peg makes its own left-or-right decision. A 15-row drop therefore needs 15 independent values. In the construction shown here, each value comes from 4 bytes of an HMAC-SHA256 digest. One digest has 32 bytes, so it yields 8 values; a 15-row drop uses the full first digest and 7 values from a second one.

One 15-row drop rebuilt from example seeds (nonce 41)
Server seed (revealed later)dragon-srv-b81e04
Commitment shown before play: SHA-256(server seed)e65e003dfeb235f4a81b734535470ad395b1e107d0c0db3a5687240c74990a30
Client seed : nonce : rounddragon-player-22:41:0
HMAC-SHA256(server seed, message)0b462b7606c368cdee232fb0a1866d94acb2827e7acbce41e38e43d9c8f7faeb
First 4 bytes (8 hex digits)0b462b76 = 189,148,022
Float = value / 2^320.0440394557
15 floats, one per row (>= 0.5 goes right)LLRRRLRRLRLLRRR
Final slot = number of R9

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

Bytes to float to direction

  1. Build the message client seed:nonce:round. The round starts at 0 and goes up by one each time a new digest is needed.
  2. Compute HMAC-SHA256 with the server seed as the key. The result is 32 bytes, shown as 64 hex digits.
  3. Read the bytes in groups of 4. Each group is a whole number from 0 to 2^32 - 1 = 4,294,967,295.
  4. Divide each number by 2^32 to get a float in [0, 1).
  5. Map each float to a bounce: 0.5 or more goes right, below 0.5 goes left.
  6. Count the right bounces. That count is the slot.
All 15 bounce values for the example seeds, nonce 41
RowDigest (round)FloatBounce
100.04403946left
200.02641921left
300.93022440right
400.63095746right
500.67459884right
600.47967233left
700.88888954right
800.78503388right
910.06470443left
1010.61805169right
1110.19458772left
1210.03755007left
1310.93665458right
1410.58167401right
1510.73488847right

The first eight rows come from the round-0 digest and the last seven from the round-1 digest. Because the threshold is exactly half the range, each bounce has a 50/50 chance, which is what makes the slot follow the binomial distribution on 32,768 equally likely routes.

Why the mapping does not bias the board

Each 4-byte group is uniform over 2^32 values, and exactly half of those values are 2^31 or more. So the left and right halves are the same size, with no remainder to tilt the odds. Other services may map differently, for example by taking one bit per row; the requirement is only that each direction gets an equal share. The hash fairness guide covers the general idea.