# Is Magic Dice Provably Fair?

in utopian-io •  4 months ago  (edited)

#### Repository

https://gist.github.com/themarkymark-steem/09ab5f94bab17c705350781182094042

#### Introduction

I was curious how fair Magic Dice really is. They claim to be provably fair and have a script to check an individual bet. I wanted to check real-world results across thousands of bets.

#### Process

• Choose Sample Set
• Collect Data
• Parse Data
• Calculate Results

#### Choose Sample Set

While I could parse every type of bet, I chose to focus only on 50/50 bets (technically 49%). This makes data collection and parsing very simple and would give me a very good answer if Magic Dice is truly fair.

#### Collect Data

I wrote a script (see above gist) that goes through the entire account history for `magicdice` and creates a python generator that can be later iterated through.

#### Parse Data

Parsing data required two steps.

• Find bets that are 50/50 bets.
• Determine if the bet was a Win or a Loss.

The first part was easy, I just looked for `Multiplier: 2.00` in a memo from @magicdice to another user. This would identify any bet successful memo that had even money.

The second part simply checks if `You have won` or `You lost` is in the memo. The result of this test is stored in either the `win` or `loss` variable.

#### Calculate Results

All that is left is to add up the Wins and Losses to find the total amount of bets, then divide this number by the number of wins. This will give me a win percentage for even money bets.

#### Results

The final result was 71913 Wins and 74906 Loses for a total of 146,819 bets using even odds. If we then divide the wins by the loses the result is 0.489807 or 48.98%. When you factor in the 2% house advantage, this is right on the money.

#### Conclusion

As far as I can see, Magic Dice's claim to be provable fair is in fact true. Over a very large sample of games (almost 150,000), the win rate is very close to the 49% Win Chance claimed for an even money bet. Magic Dice does provide another script to test individual bets but as stated above I wanted to see for myself based on actual bets.

#### Tools and Scripts

I used Python and @holger80's fantastic Beem library to conduct this analysis.

#### What I could have done better

This test only verifies a subset of the bets, the even money bets. I believe this covers a very large sample of the games played, but a more in-depth test would collect data for all bets and compare the results to the stated odds. I don't think this is necessary or productive but would provide a more comprehensive analysis.

Sort Order:
·  4 months ago

Hi @themarkymark, cool idea to cross-check the MagicDice results! With a total of around 13M STEEM sent there up to now, they'd better be fair :) Even though there are methods and scripts provided by MagicDice how results can be verified based on the retrospectively published seeds, the server seed generation itself is not included there. However, this also means that your contribution is unfortunately not in the scope of Utopian since MagicDice is currently not an open source project. Nevertheless, nice work and important results for MagicDice!

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

·
·  4 months ago

Thank you for your review, @crokkon! Keep up the good work!

·  4 months ago

Magic dice is awesome too, one of the cooler things happening on this blockchain

·  4 months ago

That's great news. At least there's some great fact checking going on.

Posted using Partiko Android

·  4 months ago

Rip my poor Steem

Posted using Partiko Android

·  4 months ago

I like the idea of stacking SMTs while playing. Of course, not being completely tethered to the nonsense of steemitdotcom is a bonus too.

Posted using Partiko Android

·  4 months ago

The rolling dice is very similar to https://freebitco.in's one. I used to play that and I think they are probably fair.

·
·  4 months ago

Just because one is doesn’t mean they all are.

·  4 months ago

That's awesome - thanks for confirming! :D

·  4 months ago

Interesting information! But was there a selection among the winners and losers, what percentage remained in the plus?

Posted using Partiko Android

·  4 months ago

My first magic dice rolls. I want to continue the experiment, but my wallet was devastated. I think it can be a very short example, why any cool Martingale-like strategy will fail at one fine moment. I will play only card games now :D

·  4 months ago

#### Hi @themarkymark!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 8.073 which ranks you at #27 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 212 contributions, your post is ranked at #12.

##### Evaluation of your UA score:
• Your follower network is great!
• Good user engagement!

·  4 months ago

This post has been included in the latest edition of SOS Daily News - a digest of all you need to know about the State of Steem.

·  4 months ago

What is the chance to lose a bet 10 times in a row? And what is the chance that the same number will fall out of three bets twice? We tested in one day, 100% it will happen.

·
·  4 months ago

It happens a lot strangely enough.

·  4 months ago

Thanks for the info. It would be interesting to see if they will stay that way. Maybe you should check them again after several months.

·  4 months ago

According to my past experience on Dice game platforms, they all claims their games are Provably Fair.

But in reality, suddenly a losing streak over 20 losses in a row will happen when your account performance is good, which over 25% earning.

Anyway, this is just my past experience. Maybe MagicDice is really Provably Fair up to today.

I share one of my posts related to MagicDice here for the reference.

·
·  4 months ago (edited)

Yeah, the streaks are concerning, I see 10+ and even 20 losing streaks far more often than I would ever expect with 50/50 odds. Easily 3-5+ 10+ streaks an hour. I've had multiple 20+ streaks.

I need to look at the algorithm closer and see how it works. I took a bird's eye view on the end results, but the streaks are really what makes/breaks it.

·
·
·  4 months ago

Does this mean you don't see a similar winning streaks as often as you see losing streaks?

If it's so, I doubt your observations.

Anyway, waiting for an update about an audit of the algo from you.

·
·
·
·  4 months ago

I see streaks on both sides, but streaks is what kills any strategy as it doesn't matter the direction.

If your betting 1 Steem, and you get a streak of 10 wins, you make 10 Steem. But when you get a streak of 10 loses, you lose 1500 Steem.

·
·
·
·
·  4 months ago

True. A loss of 1024 STEEM to be precise. But if one could always win, how will a casino run its business :)

·  4 months ago

Thanks for this, I have played a little and this is reassuring!