5
\$\begingroup\$

First off, I know almost nothing about game development/rng but I will learn. So apologies for sounding uninformed.

I want to make a sandbox ios game with several activities to do within, one of which is poker, but I want the poker to be infallibly transparent unlike online poker. They wouldn't dare.

So I want to show the rng code to be viewable by players as the hand plays out, so players will know its legit, and can verify after the hand etc if they have concerns, is this possible, can you "show" rng?

\$\endgroup\$
3
  • 15
    \$\begingroup\$ I mean, you can show anything you want. Whether or not that's an effective way to achieve your goals is something else. It looks to me like what you really want to know is "How can I prove to players that my card randomization is fair and unbiased?" — showing code running might not be the most effective (or most cheat-proof) way to accomplish that goal. \$\endgroup\$
    – DMGregory
    Commented May 14, 2021 at 11:57
  • 3
    \$\begingroup\$ Will people be betting actual money? If so, you'll probably want to talk to a lawyer (IANAL) as there are laws (AFAIK) around gambling. If not, why do you want it to be transparent? \$\endgroup\$
    – bob
    Commented May 14, 2021 at 14:36
  • \$\begingroup\$ no, it's in game currency, there are many other things to do in the app to earn money, like fighting games, racing games, speedruns, lots to do besides poker, the only cost would be a small cost for the app itself, if they want to sell their in game currency to each other in the real world that's not my business I'm definitely not getting into the gambling business. I want it to be transparent mostly as a personal goal and as a good gimmick, nobody else will ever do it, a large portion of poker players even play money players have distrust over the servers/dealers, so I want to help them out. \$\endgroup\$
    – Toddd
    Commented May 14, 2021 at 18:10

2 Answers 2

14
\$\begingroup\$

Yes, you can. There are already online platforms that are doing exactly that, by providing you the hash of the online secret key that is used as the seed for the random generation. Same seed = same random result. Now when the hand/ game is over, you can reveal the original secret. Players can verify by hashing it themselves and compare it to the previous provided hash. There is no problem to give the algorithm away how to create a hand as long as the seed stays secret.

The seed just has to be long enough that people can't brute force it in the time others are playing the game.

\$\endgroup\$
18
  • \$\begingroup\$ thanks for the reply, there is a site called coin poker that has something where you enter a phrase and later it shows up, good copywriting, but was poor in execution and is a shabby designed site, it failed and has little players, I would prefer something more visible, as it deals the, flop, turn, river, the code is all visible like debugging, maybe I could encrypt the rng so heavily to the extent that only afterwards could it be decrypted and show everyones cards and the randomness of the flop, turn, river, so they will trust the server, they can check themselves but not brute force in time. \$\endgroup\$
    – Toddd
    Commented May 14, 2021 at 6:09
  • 1
    \$\begingroup\$ @GGarrett2 you might be interested in Secure multi-party computation. Don't miss the see also section of the article. \$\endgroup\$
    – Theraot
    Commented May 14, 2021 at 6:37
  • 3
    \$\begingroup\$ The problem is, having a deterministic output from a fixed seed does not in any way suggest that algorithm is actually returning pseudo-random numbers. Yes, you can show the hash and then seed that was used, but unless you have the source code and sufficient understanding of RNGs, a seed and hash doesn't indicate that the "RNG" is actually doing what it says on the tin. You'd need a deep understanding of the algorithm for that, so I don't see any simple way to convince a layperson that the RNG is indeed fair. \$\endgroup\$ Commented May 14, 2021 at 14:07
  • 1
    \$\begingroup\$ With poker it's even more complicated, because you might not want to let any player examine all of the other players' cards, as this would expose their playing style, e.g. how often they bluff etc \$\endgroup\$
    – Codebling
    Commented May 14, 2021 at 21:55
  • 1
    \$\begingroup\$ @NuclearHoagie "The problem is, having a deterministic output from a fixed seed does not in any way suggest that algorithm is actually returning pseudo-random numbers." Er, having deterministic output from a fixed seed does suggest pseudo-random numbers (as opposed to truly random numbers, which aren't deterministic). What it doesn't tell you is if the distribution of those pseudo-random numbers is uniform. \$\endgroup\$
    – jamesdlin
    Commented May 14, 2021 at 23:31
3
\$\begingroup\$

See mental poker. That article describes a problem that's a bit harder than the one that you outline, as you are asking merely how to prove to the players that you gave them the "right" cards. For that problem, you can simply post a hash of the deck before the game, then post the deck afterwards. The players can then check that the deck hashes to the correct value.

If the players are really paranoid, however, they may worry that you're in cahoots with one of the players and telling them what cards the other players are getting. They also may worry that the deck isn't being chosen randomly, and merely posting the seed doesn't solve that, as that just raises the question of how the seed is chosen. The above article discusses how it's possible to eliminate even those possibilities.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I have come across the term mental poker before as another site tried to use it, but they had bad marketing/wanted people to play only in bitcoin so they failed, I may incorporate it, thanks for the synopsis. \$\endgroup\$
    – Toddd
    Commented May 15, 2021 at 2:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .