Back to blog
Decentralandalytics
Rob-authoredOriginally May 3, 2021

Lucky Number 7 - An Audit of Roulette in Decentraland

By Rob941 wordsarticle

Primary roulette audit with supporting workbook.

Powered by Decentralandalytics

One of the most popular attractions in Decentraland today are the casinos. These estates receive a large amount of the total player traffic in game, and are often the locations of popular events. These events often have cash or crypto giveaways, NFTs are traded and introduced, and live performances - the draw is often the games. These casino games - roulette, blackjack, slots and backgammon - allow users to play with “Free Play” or with crypto to win real money. What’s more, these games operate without a central counterparty adding to the decentralized experience.

Decentraland Games architecture diagram
Decentraland Games architecture diagram

But are these games fair? Theres’ been an increased number of users expressing concern that the games may not have odds that are reflective of being fair:

<https://www.reddit.com/r/decentraland/comments/gojtqx/are_casinos_and_slot_machines_in_the_decentraland/>

“Are casinos and slot machines in the decentraland virtual world regulated ? I am curious about this because it can pose problems later done the road if it is not the case. The creators should talk about this. Many US casinos are regulated and even some online ones too. The SEC and CFTC” - u/mojindu464

<https://www.reddit.com/r/decentraland/comments/n1cr1a/atari_casino_launch_party_event_analytics/gwci04d>

“If anyone can look into the dataset, don’t you think it will be the demise of decentralized gambling?” - /u/svezia

We at Decentralandalytics thought this concern to be a bit odd - surely if you had concerns about the odds being set up fairly, you could just look at the blockchain to understand the code being run and see for yourself. We decided to try and answer this question, starting with Roulette, and provide an answer to the question of fairness once and for all.

How to Find the Data

Once we embarked down the path of looking for the Roulette game data, we realized why it may not be so easy for your average user to validate the games by themselves. The first step to observing results is accessing a Polygon Node.

Polygon (formerly the Matic Network) is its own blockchain that settles periodically back to the Ethereum blockchain - think of it like a sort of second-layer network to avoid the pesky problem of huge gas fees when committing large amounts of data to a blockchain. Polygon is not so easy to set up; the instructions on the website assume a high level of technical competency (advice to Polygon devs: learn Docker).

As we are impatient folks, we wanted quick access to a Polygon node. The original Matic website led us to QuickNode, a private service that provide access beyond the data caps that exist on publicly available Matic/Polygon block explorers. QuickNode offers a 7-day free trial to a Polygon/Matic Node which was more than sufficient for us to pull all of the data off the blockchain that we needed to perform the “audit” - every single roulette game that’s ever been played in Decentraland.

Polygon method calls over time
Polygon method calls over time
Polygon method call breakdown
Polygon method call breakdown

This work forced us to learn how the Polygon/Matic blockchain worked. It seems to be very similar to Ethereum: blocks occur every 2-5 seconds and gas appears to be comparatively inexpensive. The miner model does not rely on proof of work but a hybrid of validators and stakers. It’s still hard to understand how large the validation network is and therefore how secure the network is, as our exploration indicated that every block was “mined” by the same address of 0s; we’re not sure if this is reflective of the small network of nodes (e.g. is there only one centralized node?) or a vestige of Polygon/Matic’s original fork of Ethereum and differing mining model.

In order to track down all of Roulette data, we had to trace back all of the previous contract deployments to assemble the total history. As the roulette contract uses an OpenZeppelin contract and simply supports functions and doesn’t store token history, the way it gets updated is to deploy the contract on a new address and forwards all requests from previous addresses to the new one. So finding the whole history of the game required chasing down each of these contracts.

Given our experience with Polygon, we will likely be deploying our own Polygon node for the community shortly. Stay tuned for updates.

The Results

The results of Roulette in Decentraland seem quite fair.

Roulette winning number distribution
Roulette winning number distribution

Check -Had to set up a Matic Node

Forced me to learn how the Matic block chain worked

Had to track down all of the previous contract deployments to assemble the complete history

We will likely set up a matic node for staking opportunities stay tuned

Audited the Roulette tables owned by Decentraland Games

Time frame is from November 3 2020 to May 2 2020, 180 days of games

1161 players have paid to play roulette

By far streamcrypto (insert more meta) is the most degenerate gambler in the game

User number 731

Joined on Fri Feb 07 2020 04:08:50 GMT+0000, game launch was 13 days later

137421 out of the recorded 389851 games

Average of 763 games per day

Average of 31 games an hour

Is this account a bot or using a bot to play roulette?

Is Decentraland full of gambling players, no

1161 unique players over the course of 180 days.

Are the tables fair? Lucky Number 7

Yes. See distributions in excel document

We are not suggesting to only bet on 7 in the casino.

Do not misconstrue this blog post as gambling advice or encouragement. Should you need help with you gambling addiction please reach out to this link.

Supporting Assets

  • /blog-assets/decentralandalytics/roulette-winning-numbers.xlsx - supporting workbook.
  • /blog-assets/decentralandalytics/roulette-winning-numbers.csv - extracted roulette-number counts from the workbook.

Source Links