Skip to main content

Plinko PF

Written by Birate

terms used

client seed: a string chosen by the player (or automatically generated if you don't choose one)

server seed: 64-character hex string generated using crypto.randomBytes(32) and hashed with SHA-256

nonce: the number of the round you're on, increases by 1 for every round across all house games

cursor: internal number representing a nonce within the round, in plinko it dictates how far from the leftmost bucket (0) the ball moves

the number of individual cursors for each round will always be the same as the amount of rows selected - each bounce increments the cursor by 1

rows: how many vertical rows are on the plinko board (8-16)

HMAC: cryptographic function that mixes unhashed server seed, client seed, nonce and cursor to produce a result

here's a 3rd party HMAC tool to verify each step for yourself: https://cryptii.com/pipes/hmac - (or any other one you prefer)


how HMAC is used to determine outcomes, example round to demonstrate

unhashed server seed: cb8bd577e2b1f62e91c0fe5296c145330bc8ae4307729a372aa4fe639a5af24c

client seed: 62OUyVeUGCRnTpU6

nonce: 8796

cursor: 0

here’s what the "message" part for your first bounce in the HMAC tool looks like: <clientSeed:nonce:cursor> which gives: 62OUyVeUGCRnTpU6:8796:0 (next bounce would be 62OUyVeUGCRnTpU6:8796:1)

the "key" part is your unhashed server seed

if you're using the 3rd party site above to follow along, it would look like this:


first bounce HMAC result:

879478937bf6c3bc276ffa54c04bb64a8981d724ff8824e3db88f51f6d9aa405

from that, the first 4 bytes (8 characters) are converted from hexadecimal → decimal (879478932274654355*)

*

that number is used to determine whether the ball moves left or right on each pin.

if the number is even, the result is "left"

if the number is odd, the result is "right"

from the code’s perspective, starting bucket is 0, a result with ‘“right” adds +1 to the current number, “left” means ‘stay’, it doesn’t add or subtract

do that for each row, 1...16 and you get the following result:
R, R, L, R, R, R, R, R, R, R, R, L, R, R, R, R

16 rows, 16 bounces, 14 rights = final bucket is 14.

16 lefts -> bucket 0

8 lefts -> bucket 8

0 lefts -> bucket 16


but you gave me a busted seed and filled my plinko balls with tungsten

the server seed itself isn't enough to rig anything. as long as you're able to set a client seed after the hashed server seed is revealed, the HMAC output where your plinko result comes from cannot be controlled by the casino

the total number of possible 32-bit values is 2^32 = 4,294,967,296 (which is evenly divisible by 2)

every one of those 4,294,967,296 results are equally likely to happen, meaning both "left" and "right" for each bounce has a 50% chance of happening.


how would i even know if it WAS rigged?

1. if your hashed server seed wasn't shown before playing

2. if your hashed server seed was shown to you only after committing to a client seed

3. if the algorithm was changed to use a different part of the hash (you can verify that this isn't the case with steps above)

4. if your hashed server seed didn't match the unhashed seed when checking with a SHA-256 calculator


TL;DR

  • client seed, nonce, cursor and unhashed server seed make up the final result for each bounce

  • due to 4,294,967,296 possible results, left and right for every bounce are equally as likely

  • all possible server+client seed combinations result in completely random and fair odds

  • If there was something hidden behind the scenes making you lose - your rounds could no longer be verified using the steps above

Did this answer your question?