The 'Provably Fair' algorithm that most gamble sites uses to prove fairness

in #steemit7 years ago (edited)

Most of bitcoin gamble sites uses the 'Provably fair' algorithm to inform users that the game you played was fair. However, it is difficult for most users to understand because they introduces it with difficult terms and codes that are difficult for the ordinary person to understand.

We also uses the algorithm to prove the fairness of Milkdice. We'll explain how it works and how to prove the fariness as simple as possible.

About Provably Fair

Milkdice use the 'Provably Fair' algorithm for the fairness of a game. What does 'Provably Fair' mean? Wikipedia describes the algorithm as below

Once a game has been played, the player can use these algorithms to test the game's response to his in-game decisions and evaluate the outcome by only using the published algorithms, the seeds, hashes, and the events which transpired during the game.
Wikipedia : Provably fair

The results of each dice game are mathematically predetermined and cannot be changed by a third party. Players can verify the fairness of a game through two seed values, a server seed and a client seed.

How it works.

For example, it goes through the following process.

  1. The number of dice is from 0 to 99.
  2. The user first selects a number from 1 to 9999. (called Client Seed)
  3. Then, the server selects numbers from 1 to 9999. (called Server Seed)
  4. Divide the sum of the two numbers into 100, and the remaining value becomes the number of rolled dice.
  5. The client seed and the hash of the server seed are released to the player.
  6. The original value of the hashed server seed will be disclosed after the player plays the game.
  7. The player can verify the number of dice by calculating it his own.

Although not 100% true to explain the Provably Fair algorithm, it may be an appropriate explanation to help you understand the process. Milkdice uses the user's ID as the first client seed value when the user sign up. This can be changed by the user before the game starts, as shown on the screen below.

change_client_seed.gif

the value of the probability is determined entirely by the player, Because the pre-created server seed value does not change until you played 100 games. Of course players can not manipulate the rolled number because they don't know what server seed is.

How to verify it.

From now on, we will explain how the numbers are determined from a computer programmer perspective. In addition to the server seed and the client seed values, we uses special number called nonce. The server seed value has been changed every 100 games. We uses nonce to keep this rule. The number increases by one for each game.

We now have two strings and a number. The code for calculating the number of dice is as follows. The code is written in Python.


    import hashlib

    seed = server_seed + ':' + client_seed + ':' + str(nonce)
    hashed = hashlib.sha512(seed.encode('utf-8')).hexdigest()
    roll_number = int(hash, 16) % 10000

When server seed values are disclosed, all players can verify the fairness of the results of the dice by executing the above code directly. We're planning to implement game verification features on the website so that ordinary people can uses it

Thank you for reading it. If it was useful, please vote up!

Thanks.

We're Milkdice.

Our Official Web Site : https://milkdice.io/
Our Official Telegram Group : https://t.me/joinchat/KwgM-RIovrdAUsH0S2RZIw

Sort:  

Hello @milkdice! This is a friendly reminder that you have 3000 Partiko Points unclaimed in your Partiko account!

Partiko is a fast and beautiful mobile app for Steem, and it’s the most popular Steem mobile app out there! Download Partiko using the link below and login using SteemConnect to claim your 3000 Partiko points! You can easily convert them into Steem token!

https://partiko.app/referral/partiko

Congratulations @milkdice! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

SteemitBoard Ranking update - A better rich list comparator
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.09
TRX 0.31
JST 0.031
BTC 106343.27
ETH 3786.18
USDT 1.00
SBD 0.58