Decentralized RNG Hashmap

in Hive Gaming7 days ago (edited)

dice rng random-gamble.gif

Random Number Generation is a tricky business.

As a computer science hobbyist and former professional poker player I would know better than most people. It would seem that the very concept of "random" is a bit of a misnomer in itself. Nothing in this world is truly random; it just ends up being a sufficiently complicated enough simulation that our tiny ape brains would not be able to predict the outcome. This has far-reaching effects in terms of gaming, gambling, predicting the weather, and any other type of chaos-theory event.

Double-compound-pendulum-chaos-theory-butterfly-effect.gif

Not random but totally unpredictable.


Humans are very good at finding patterns in things, and a lot of the time a pattern does not even exist; we simply project a false pattern onto a series of random events and end up extrapolating incorrectly. Take a slot machine for example. Some degens would tell you a slot machine is "hot" and more likely to hit the jackpot if it's already hit a couple of times. Others would tell you a "cold" machine is more likely to hit and is due for a win. Both degens are wrong. There is no pattern. Nobody has ever made a living playing slot machines unless they were cheating by hacking the device.

image.png


It’s problematic to convince the IRS that slot machine casino gambling isn’t entirely luck-based. I’m confident I could prove it sufficiently in court, but why bother to make that effort?

1) What

Of course according to the Internet: professional slot players do exist. Except these people are liars and snake oil salesmen. If you actually go and read these articles they are all just nonsense jibber-jabber. "Buy my 12-point plan that teaches you how to beat the casino at their own game." lol yeah right. Dream big. Be serious.

To make a living playing slots, you need to win at slots. That’s the first necessary skill. But the other essential skill is being able, again and again, to learn how to win at slots.

It's hard to believe these are actual quotes.

But these charlatans can get away with it because to the untrained participant anything that is sufficiently complicated enough feels like magic if we don't understand it. It's very easy to trick people into thinking professional slot players exist when you just compare them to professional poker players. The person being spoken too doesn't understand either one so they just nod their head and continue on believing it makes sense. Proving once again that it is actually TRUST that is the most valuable resource, which is why we all came to crypto to begin with. How ironic that our entire industry is littered with scams and disappointments.

round-robin-rng-sha-256.png

So why is decentralized RNG important?

Well if it's not decentralized then the centralized entity in charge of "random" number generation knows how to reverse engineer the system and cheat at at their own games. It's been proven a couple times beyond any reasonable doubt that well-respected online poker sites were definitely cheating and manipulating outcomes on their own tables. Of course this was difficult to confirm because gamblers themselves have such high levels of persecution and grandeur that they'd claim cheating was happening either way. Every bad beat must be cheating but every time they get lucky it's "about damn time". This is how human psychology works after all.

So really the ultimate benefit of decentralized RNG is that participants stop having that nagging question of whether or not they just got unlucky or they were actually cheated out of fair winnings. Such an result would allow the industry to have a lot more credibility. But how would it be accomplished?

In a way it already exists in a couple of different formats.

For example Bitcoin creates an infinite set of random numbers every ten minutes on average. The only way to hack these random numbers would be to mine Bitcoin blocks and then throw them away when you didn't like the result. AKA never going to happen; nobody is going to throw away a quarter million dollars just to reroll and probably lose again.

0000000000000000000166859d035a15f0e161c36fcfda62b2c54d427df93386

This is the hash for the current head block of Bitcoin #887651. This SHA-256 hash can derive infinite random numbers just like a seed phrase can generate infinite wallets. Need more random numbers? Just rehash the hash and get a whole new set. Need even more? Rehash that hash, and so on. The chance of two hashes being the same is effectively zero; it would be just as difficult to crack the encryption itself.

3268B3B71E92C22E3FEE44253201B872F3333CB43BC519E44D4A072C29700E0D

This is a secret message.

What have a said here? The only way to know would be to guess what I said and then reverse engineer it back into the hash. The SHA-256 algo itself can not be reverse engineered to figure out what it was hashing. This is a one-directional algorithm, and we can use that to our advantage.

This is a secret message.
The longer the message the more impossible it becomes to guess.
We can hash this message to mask it, and then reveal the message later to prove we said it.

image.png


This is a secret message.
The longer the message the more impossible it becomes to guess.
We can hash this message to mask it, and then reveal the message later to prove we said it.

https://passwordsgenerator.net/sha256-hash-generator/

This is a very crude way of proving we said or did something after the fact. I've seen it used a few times on social media when people wanted to make a prediction without revealing it at the time of making it. Then they use the timestamp and hash to prove they said the thing.

This strategy can also be applied to gaming. A player could make a secret move and nobody would know what it was; only that they posted a hash to the chain (or not). Then when it was safe to reveal what they had done they could prove they had done it. This could be used for competitive gaming and make it so even the server running the game would not be able to cheat or get inside information on what move was being made. At that point the information doesn't even need to be on chain for the most part and can exist on the second layer while only needing to go to layer one for conflict resolution (a rare outlier event).

Round Robin SHA-256 RNG

No sense in repeating myself too much because I've already discussed this idea a couple times in previous posts. This last one was Oct 3, 2024 so it's been a minute, but I still think the idea has promise. Basically every player that adds their own SHA-256 hash to the roll changes the outcome, so the only way to hack the dice is to know the password chosen for every single participant.

deck-poker-rng-random.jpg

Unfortunately decks are beyond these capabilities.

So imagine you want to pull a card from a deck. We can do this using the Round Robin style SHA-256 RNG pool tactic... we can prove we have the card... but we can't actually take the card out of the deck. Taking the card out of the deck means we have to prove other players can't draw that card; without revealing that it was actually drawn. This is when digital decentralized RNG starts to get insanely complex and completely beyond my paygrade.

Zero Knowledge Fog of War

This post was from Apr 22, 2023 so quite a bit older. The solution to building a deck or creating fog-of-war in gaming in a decentralized way might require the use of ZK proofs... but ZK proofs are so complex I can barely been to understand how they work; in fact that post is the only research I've ever done on them, and it was cursory at best.

From what I've heard ZK proofs create an abysmal UX because they are too slow. They are great for things like Monero and privacy based currencies that can take their time... but terrible for someone trying to play 60 hands of poker every minute... at least this is my current understanding. Maybe quantum computing could fix this... or break the entire system entirely. It's unclear.

Personally I think the solution here for a lot of these applications is to simply allow duplicates to exist and balance the product around this limitation. Would it really be that bad if you were playing a decentralized poker game and players could draw the same card?

Obviously some people would HATE that but I think the average player doesn't care very much. It becomes even less of a big deal when the strategy of the game doesn't hinge on unique cards being pulled. Is anyone really going to complain if three get-out-of-jail free cards gets pulled in a row while playing Monopoly? Someone will but that guy was annoying anyway and complains about everything.

Sort:  


The rewards earned on this comment will go directly to the people( @loading ) sharing the post on Reddit as long as they are registered with @poshtoken. Sign up at https://hiveposh.com. Otherwise, rewards go to the author of the blog post.

"...quantum computing could fix this... or break the entire system entirely."

I think quantum computing are so competent that extant encryption becomes trivial to hack, or at least that's been my understanding of claims made for it.

"SHA-256 is designed by NSA..."

Which is why I doubt it. Why would they release their rock solid cryptographic algorithm to a world full of their targets and enemies if they didn't have a sekrit backdoor?

Anywho, cryptography is becoming ever more important as the ability to speak privately is harder to enjoy with every passing day. It seems like all of Europe isn't just talking about E2E encryption being backdoored (to save the children from terrorists, of course) but actually forcing communications providers to do it, and this will make all of our dickpics classified government property, which means we won't even be able to see them without clearance. Worse, governments are utterly corrupt, so these backdoors will get into the wrong hands, and before we know it Bob's your uncle and every NK hax0r worth their salt will have ALL our dickpics and there won't be a damn thing we can do about it.

Thanks!

You can SHA-256 hash an 80 gigabyte file.
There is no backdoor.
The data is lost.
You can't reverse engineer a couple of characters back into an 80 gig file.
It's pretty well documented that SHA-256 does not have backdoors and is often cited as the reason why people thought Satoshi worked for the NSA at one point.

I can't, but I have no confidence the NSA can't. There's all sorts of mathematical tricks smart, sneaky people have come up with. You are aware, of course, that translating Satoshi Nakamoto means 'central intelligence', so I don't need to point that out. Anyway, I don't trust anything from known liars, and I know the NSA are pathological liars.

'Nuff said.

Very interesting post. Very complex for normies like myself but I did grab a few bites.
As a degen #poker gambler, this is of the most interest to me :D

Isn't there a term for that when you see patterns where they don't actually exist?

Apophenia

That's the word I was looking for...

one thing i never get right is winning the casino, i suck at gambling, i heard most of this casino owners do manipulate the machine at their own game, but if casino can be taught why do other players say its by luck they hit the jackpot?

Lol, the whole thing about slot machines is hilarious, people really believe in hot and cold machines like they have moods. Casinos rigging RNG is a good example of why I stay away from gambling. If I lose, I’d rather blame myself than the algorithm