You’ve joined a cryptocurrency casino and have no idea what Provably Fairness means. Neither did I 5 years ago! We’re going to break it down in parts and figure out step by step how to make sense of it all.
Index
- Prerequisites
- Meaning
- Values
- Issues
- Manipulation
- Remedy
- Applying remedy
- Nonce
- Conclusion
1. Prerequisites
- English
- Numbers
2. The meaning of provably fairness
Let’s break this down word by word.
- Provably: in a way that is capable of being proved.
- Fair: without cheating or trying to achieve unjust advantage.
Simply put, you can think of provably as provable and fair as the casino and player having no issues. In even simpler terms, all this means is that the results you get after placing bets is safe and can be trusted.
3. Values
The way to achieve this fairness by being able to prove it, is almost magical when first experiencing and going through the process.
- The casino choses a value e.g. 1234
- The player choses a value e.g. 5678
These values will combined together in a way that both the casino & player will know of from the start.
Let’s say that the way these numbers are added are by multiplying the 2 values given by both parties involved, it would look something as follows.
- casino value multiplied by player value = result
- 1234 x 6789 = 7006652
As you can see, the number 7006652 is the result of multiplying the casino’s value by the players value. This value is kind of big though and could easily confuse us if we are constantly having to work with and see such large numbers and therefore the casino tells you that we will only make use of the last two digits. the last two digits or single numbers can be obtained by only using the last two numbers meaning we get rid of 70066 and only use 52 for the result. Therefor 7006652 becomes 7006652. Now it’s a lot easier to quickly see if we won or lost.
We can additionally also give these values names:
- casino value = casino seed
- player value = player seed
Why seed? Well seeds can be seen as the building blocks of plants and in the same way the seeds of the casino and the player can be seen as the building blocks of our provably fair values.
4. Provably fairness issues
Let’s go ahead and bet 1 BCR coin that the resulting value from our 2 seeds will be 52. We make the bet, and we win but hang on a bit though because this can’t be fair to the casino if you know what the result is in advance. You’d always win and the casino would be out of business in minutes!
A work around for this would be for the casino to accept your bet first so it would essentially be locked in. Then after locking in the bet, we find the result of the seeds as follows:
- player bets 1 BCR coin that the resulting value from our 2 seeds will be 52
- bet is locked in
- casino gives value 1234
- player gives value 5678
- result is
7006652 and the player wins!
The casino shows you the value they chose, and you can calculate that it was indeed the correct result.
5. Manipulation
What happens if the casino makes a mistake or is roque and only choses numbers that won’t result in you ever winning as follows?
- You place your bet and lock it in
- You provide the casino with your seed
- The casino deliberately chooses their seed so that when it is multiplied by your seed, that the result will never be your winning bet basically meaning they never choose a seed of 1234
6. Remedy
One way to make sure that the casino can never exploit the loophole purposefully avoiding a seed that would result in them losing is by doing some maths formulas on their seed before you give them your bet that you will apply on their seed to make sure it’s not being manipulated.
- casino seed multiplied by 987
- 1234 x 987 = 1217958
- take the last digit of the result and then use it as the divisor and the entire result as the dividend
- 1217958 / 8 = 152244.75
- remove any digits after the dot and divide the result by 10 till the number is below 100
- 152244.75
- 152244.
75 - 152244
- 152244 / 10 = 15224.4
- 15224.
4 - 15224
- 15224 / 10 = 1522.4
- 1522.
4 - 1522
- 1522 / 10 = 152.2
- 152.
2 - 152
- 152 / 10 = 15.2
- 15.
2 - 15
- Now subtract this from the original casino seed (1234) and then multiply it with the result
- 1234 – 15
- 1219
- 1219 x 15
- 18285
Before you place your bet, the casino will give you this number 18285. You will use this to verify that they haven’t manipulated their seed and you will have the blueprint/instructions on how to check it as well.
Here is the short version in words:
- casino seed x 987
- step 1 result x last digit of step 1 result
- divide result by 10 and throw away digits after the dot until reaching a number less than 100
- casino seed – final result from step 3
- step 4 result x step 3 result
Here is the short version in numbers/values:
- 1234
- 1217958
- 152244
- 15224
- 1522
- 152
- 15
- 1219
- 18285
7. Applying the remedy
Let’s go through the steps:
- player gives casino seed
- casino gives blueprint value to player
- player makes bet
- casino reveals hidden seed
- player takes casino seed and applies blueprint on it and sees if it produces the right result
- if result isn’t correct, player knows the casino has made an error
Example is if the casino uses casino seed of 1234, the result can only be 128285. If the casino changes the seed to 3333 to make you lose, the value will be 985640, however, this won’t match 128285 that you received earlier.
8. Nonce
Taking these steps every time you want to place a single bet can become somewhat tedious after a while, which is why introduce a 3rd value which we simply call the nonce.
What does nonce mean? It’s something used for one occasion or cycle almost like a temporary value and the way we use this is by adding a nonce to our 4. Values step as follows:
- casino value = casino seed
- player value = player seed
- nonce = 1
Yes as simple as the value of one. But how do we actually use this? Can recall our formula of 1234 x 6789 = 7006652 ? Well we edit the formula to add in the nonce as follows:
- (casino seed + nonce) x (player seed + nonce)
- (1234 + 1) x (5678 + 1)
- 7013565
7013565- 65
When you want to place your 2nd bet, we don’t have to go through the trouble of choosing a different seeds again, but rather the player can bet as much as he/she wants and then at the end, the casino provides the original casino seed value for the player to check and seeing as though the nonce only increases by 1 every bet, it’s easy to remember and implement when you’re verifying the results.
Here are the first 10 results using our new formula:
701356570204807027397703431670412377048160705508570620127068941
9. Conclusion of provably fairness
These very simple examples to help you get accustomed to provably fairness or as we say, provable fairness. The most basic components needed are 3 things, aka, casino seed, player seed and nonce to speed up the process so betting can be nice and fast.
- player gives seed to casino
- casino chooses seed – value hidden from player
- casino tells user what blueprint is being used
- casino calculates temporary blueprint value for player to use later on and shares this value
- player makes a bet
- casino generates result and shows player (win or loss or draw)
- if player decides to stop playing and start verifying – casino shares hidden original casino seed value
- player calculates all the results and compares/checks if this is indeed what they received from the casino