Deterministic Simulation

in LeoFinancelast year

image.png

Hive needs a 'state' lottery.

What better way to prove our sovereignty than by creating a system that completely undermines the established status quo? All lotteries exploit the players and mathematically syphon money from the masses and funnel it into the hands of centralized agents.

This ends up being extremely hypocritical because the complexity of offering a game such as a lottery ends up being exceedingly simple. Notice how games of higher complexity are completely free. No one would play chess or checkers online if there was a cost. Poker should be free-to-play as well, but it never is. Why? Because money is changing hands. Whenever money is changing hands humans can't help but take a cut of the flow for themselves.

Hive is in a unique position in this regard.

I mean just look at most of the other blockchains out there. A fee is charged to post an operation on Bitcoin or Ethereum. Seeing as most of crypto is EVM chain based implies that fees are pretty much inescapable at the moment. Luckily our network allows users to yield farm that bandwidth as a derivative asset rather than charging the primary token. This is how we maintain 'free' transactions.


image.png

We can see here that the odds of winning the Powerball are one in almost three hundred million. With only eight billion people in the world that means if everyone played once... only 27 winners would exist on the average... out of the entire world. Luckily there are many more winners than that because people just keep buying tickets: especially when the jackpots are near all time highs.

Or perhaps "luck" has nothing to do with it.

Personally I've never played the lottery because I know exactly how bad the odds are. Still this doesn't seem to stop others from hoping to 'make it big' and escape the drudgery of their nine to five job. Statistics really should be a heavily required mathematics in school, as the real-world applications are far more numerous than any of the other mathematical disciplines.

And yet stats seems to be an outlier that many never even get exposed to. The conspiracy theorist inside me says this is because if everyone had a better understanding of statistics they'd know just how badly the current establishment exploits them. Can't have that.

Marbles on Stream

My original idea to create a lottery on Hive started out as a very basic concept. Bitcoin hashes would be used to seed the random numbers. This way the randomness of the game would be secure and completely unhackable (as long as the jackpot stays low enough so that Bitcoin miners don't throw block-rewards away in order to game the system).

However, a backend dice-roll is boring.

I can appreciate that players like to have a visual representation of the gambling experience. Something like Plinko would do quite nicely. Then I remembered Marbles on Stream which was viral on Twitch.TV for a hot minute. I couldn't help but wonder how obsessed people would be over a marble simulation like that which actually paid out real cash prizes (in the form of crypto) to the winners in a provably fair way. Truly the establishment is on borrowed time and crypto can do things that they just can't. It's only a matter of infrastructure.

Algodoo

The other day I was doing research on this idea once again and I came across this program called Algodoo. Rather than a 3D-simulation like Marbles on Stream it's a 2D physics engine that can do a lot of different things. Something like this would be perfect for the application in question.

Unfortunately then I realized that the devil is in the details.

There's certainly no reason to reinvent the wheel, but what if the wheel doesn't exist? There are tons of marble simulators and other physics engines online to draw from and copy, but how many of those are actually deterministic?

Deterministic?

In order for something like this to be decentralized everyone has to be able to run the simulation independently and everyone needs to get the same answer to come to consensus. It's an extension of crypto itself. Crypto accomplishes this, among other tactics, through the process of serialization. All the data is organized into a very particular order and format so no matter what operating system or hardware one is running: all machines will come to the same answer.


~~~ embed:Unity3D/comments/ivg2ye/how_would_you_go_about_creating_a_deterministic/ reddit metadata:fFVuaXR5M0R8aHR0cHM6Ly93d3cucmVkZGl0LmNvbS9yL1VuaXR5M0QvY29tbWVudHMvaXZnMnllL2hvd193b3VsZF95b3VfZ29fYWJvdXRfY3JlYXRpbmdfYV9kZXRlcm1pbmlzdGljL3w= ~~~

Further research on this topic in places like Reddit and Stackoverflow show that deterministic simulators are actually quite rare. Most will cite the unpredictability of floating-point logic as the cause but there are many other reasons for this as well. Not only can determinism make a simulation clunky and slow, it can also make it less random and less likely to create a Chaos-Theory effect, which is exactly the point of most simulations.

100% determinism means you can't use any nonfixed deltatime for calculation. You'll need a simulation backend that runs in discrete steps. This means you can't use Unity's physics solvers or animation system in any way that will affect the simulation since a lot of unity's systems inherently rely on the deltatime, and the physics system uses randomness to maintain stability (if I remember right). Your sim needs to be 100% a blackbox, meaning that animation & physics (plus other systems) must only receive simulation state but never ever feed back into it.

It's said floating point precision can also cause issues but this is only true if your simulation runs across multiple processors that don't use the same floating point architecture (for example multiplayer) but it's rare that this is the case - most modern processors use ‎IEEE 754 As long as your packets (in multiplayer) are guaranteed to arrive in order, you should be ok

float random = not_so_random

It's also important to note here that randomness doesn't truly exist in computers. Most random numbers are generated using algorithms that hash together multiple variables including time. Therefore the outputs appear random but can be reverse engineered if a hacker knows exactly how the algo works. Adding a financial incentive to crack the code guarantees this will happen eventually.

R-N Jesus be praised.

My COBO hardware wallet (that I never use) creates random numbers using a clever process that feeds imperfections of the physical device into the RNG process. Slight variances in voltage and whatever else are fed into the algorithm. A hacker would never be able to figure out exactly how much charge your battery has or things like that, so this ends up being a 'true random' solution that can't be reverse engineered. However this isn't super impressive because hardware wallets aren't supposed to connect directly to the Internet anyway (especially air-gapped ones).

diamond-eye-sauron-2.png

A final note on "Gambling"

Gambling has three prongs on a legal level

  1. Consideration (pay-to-play)
  2. Chance (games of skill aren't gambling)
  3. Prize (usually money)

Sweepstakes

A Sweepstake is when a company runs a lottery such as this but they eliminate the consideration variable of the equation. If players are allowed to play for free: then legally it is not gambling. The idea being that the marketing and promotion of the sweepstakes is more than worth the cost of it. Essentially it's an advertising model.

There's also a case to be made that it's not gambling if a centralized agent doesn't scoop money for themselves (this is how cardrooms in Oregon work) or games of skill (like poker) are not gambling. However it's much harder to argue these points to the regulators and the battles are constant.

I'm fairly certain that if something got built on Hive that didn't generate a profit but simply allowed users to gamble for free we'd get a lot of publicity out of that. Sure, plenty of gambling apps have been built here and elsewhere. I've yet to see one that was both compelling on the frontend and rake-free. Perhaps the incentives to build such a product simply do not exist.

Conclusion

We are living in an absurd digital world that hasn't caught up to speed yet. Over and over again, the same tactics of raking money into a centralized agents pockets occur. We call this 'value capture' in the corporation game. It is a necessary mechanic of legacy capitalism and current business models, but crypto will eventually break away from such things. It's not so different from what WEB2 did to WEB1. People like free service. The only question becomes: How does the value get captured if the service is free?

Sort:  

what about a very simple game that takes 2 minutes to play , requires a tiny amount of skill and costs something like 0.2 hive to play, rewards people with nfts (like collectible badges or achievements) but is nigh on impossible to win the jackpot on.
Im imagining little components dropping from the sky which you have to catch in a basket. If you catch certain combinations you get to fuse them to make an nft. These nfts can then be fused again when you collect enough of them, or perhaps there are special recipes to go after. Maybe certain mid level catches can win you a number of free turns, or an aesthetic addition to an nft of your choice. But all the while there will be prize pools building for certain lottery ticket catches which could win you a bunch of hive. On top of that there could be a prize for rarest catch of the day or something.... I don't know....just a bunch of different prizes, some of which statistically will become massive over time. So you have a lottery element, but that the nft collection is also an amusing game which creates a secondary market

requires a tiny amount of skill and costs something like 0.2 hive to play

That would be great but is very hard to accomplish.
Both the skill factor and the cost to play.

If the game requires skill how does one stop cheaters from botting it and other Sybil attacks?

If the game requires an entry fee who's going to hold the money in escrow and then pay the winner? That entity is guilty of running an unregulated gambling ring. How does this get navigated? 'Decentralized' in this context often means a bigger group is simply breaking the law... any very few gambling solutions are actually decentrailized beyond multisig... which again is just a couple more people being in on it and not a real solution.

ah crap. sounds like way too many issues to be feasible. I retract all suggestions of initiating unregulated gambling rings

I mean you definitely have the right idea we just might need to wait for some breakthrough infrastructure to lower the barrier to entry.

We just have to be careful not to turn into EOS. Aren’t they 90% gambling apps these days? Lol.

Does sound intriguing! Might be a good idea for an HBD sink.

We just have to be careful not to turn into EOS. Aren’t they 90% gambling apps these days?

I thought that was Tron

It was one of them! Lol it’s probably Tron!

Hmm
Creating a lottery section on here is actually not bad
Makes Hive more fun

Is that you Justin "TRON" Sun? :))

Show me a free gambling app on tron 😁

Congratulations @edicted! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 132000 HP as payout for your posts, comments and curation.
Your next payout target is 134000 HP.
The unit is Hive Power equivalent because post and comment rewards can be split into HP and HBD

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Check out our last posts:

Our Hive Power Delegations to the August PUM Winners
Feedback from the September Hive Power Up Day
Hive Power Up Month Challenge - August 2023 Winners List

I ran a lottery on Hive, which existed 3 years. It did well considering my marketing skills are amateurish at best. I think it could work to draw more people if the logistics of the cash out were simpler. Hive listing on Coinbase would make it ideal.