## What is Provably Fair Gambling?

Provably Fair gaming is a technology that is unique to Bitcoin gambling that makes it impossible for a player or casino to cheat. Suspicious plays can be checked using a Bitcoin cryptographic has function, proving the results are indeed calculated properly and fairly. This type of provability does not exist in the world of land-based casinos or traditional online casinos, making Bitcoin gaming a more reliable and trustworthy form of gambling.

## BetChain Bitcoin Casino is Provably Fair

Not all Bitcoin Casinos have Provably Fair gaming. BetChain is proud to feature this technology so that our players can rest assured that all plays are trustworthy and fair. Our top priority is honesty and the satisfaction of our clientele.

#### Many of our games are provably fair.

To check the provability of a game, just click on the purple tab on the right hand side of the screen to open up the validation window. There you can check the hash string.

## How Does it Work?

Provably Fair systems work based on cryptographic hash functions. Data is converted into a hash string, which can be verified with an algorithm. If there was any interference in the game or any error in the payout, the hash will not be verified. As a player you can check the result of any bet yourself and have complete transparency and confidence in our Bitcoin games. Each casino game has a different algorithm for calculating its fairness.

## Provably Fair Roulette

#### 1. A computer model is used for the Roulette wheel and a random spin is applied.

A list of tiles is generated in the order they appear on the wheel. A random location is then generated for the roulette wheel to stop at. The best pseudorandom number generator called the Mersenne Twister algorithm is used. The spin is called the ‘Result’.

#### 2. The “Fingerprint” of the spin and a random generated number called “Secret” is revealed.

This is called the Hash{Result+Secret}. The “Secret” random number is used to create a fingerprint of the data to model the game. This ensures that the final spin result can’t be determined from just the “fingerprint”.

The unique “fingerprint” is created by hashing the data with the SHA-256 Hashing Algorithm ensuring that it is unique to that exact spin of the wheel and “Secret”, and can be used later to verify the game.

#### 3. The Players Input

The player adds an extra push to the wheel and can select a number from 0 to 36 (or 37 for American roulette which has an extra tile) to push the wheel further along by that amount when spun. The player can either pick his own number or use one chosen randomly for him.

#### 4. Gameplay

Bets are placed and the game is played.

#### 5. The Game Data is Shown

When the game ends, we shown the spin of the wheel(Result+Secret), the “fingerprint” (hash[Result+Secret]), the players input in the game and the final result. Using the pop out widget, the play can be verified by checking that the spin matches the “fingerprint”.

#### 6. Check the Players Effect on the Game

The effect of the players input can be checked by comparing the spin (Result+Secret) to the final result. Take the client seed and count that many tiles past the tile it was originally set to land on (found in Result+Secret) and the same tile as the final result should be shown.

## Provably Fair Card Games

#### 1. The Shuffled Deck and a “Secret” Number are Generated

“Secret” is what the number generated by the server is called. This number is used for the hash. The shuffled deck is generate by a method called the “Fisher Yate’s Shuffle” which is similar to picking a number out of a hat. We use a randomizing algorithm called the “Mersenne Twister” to generate the numbers for the shuffling technique. This method is of the highest standard in the industry. The shuffled deck is called the “Result”.

#### 2. The “Fingerprint” of the shuffled deck and the “Secret” is Shown

This is called the Hash(Result+Secret). The “fingerprint” is created by hashing the data with the SHA-256 Hashing algorithm. The “fingerprint” is unique to the deck in each game. It can be used later to verify the game.

#### 3. The Players Input

The player gets the opportunity to pick the location where to cut the deck. A number called the “client seed” represents this. That number is used to affect the outcome of the game. This ensures the fairness of the game. For example, if a player chooses 32 as the client seed, the deck will be cut 32 cards from the top before the cards are dealt and the game is started.

#### 4. Game play

Bets are placed and the game is played.

#### 5. The Game Data is Shown

Once the game has finished, the full shuffled deck (Result+Secret), the “fingerprint” (hash[Result+Secret]), the players input (client seed) and the final result are shown. Using the pop out widget, the play can be verified. 6. Check the Players Effect on the Game The effect of the players input can be checked by comparing the fully shuffled deck (Result+Secret) to the final result. The values will be the same deck, but one of them has been cut at the position hat was chosen.

## Provably Fair Slots

#### 1. A Computer Model is used for the Slot Reels and a Random Spin is applied to each one.

Each reel is modeled as a list of tiles in the order they appear as on the slot. A random location is generated for each reel to stop at using the “Mersenne Twister” randomizing algorithm. The spin is called the “Result”.

#### 2. The “Fingerprint and “Secret” Number are Shown

This is called the Hash(Result+Secret). A randomly generated number called “Secret” is used to create a “fingerprint” of the game. This ensures that the final result of the game can’t be determined solely from the “fingerprint”. The “fingerprint” is created by hashing the data with the SHA-256 Hashing algorithm. The “fingerprint” is unique to the exact spin of the reel and the “Secret” seed in each game. It can be used later to verify the game.

#### 3. The Players Input

The player gets the opportunity to add an extra push to each of the reels. He can select a number from 0 to 9 for each reel to spin that extra number of times. The number can be chosen by the player or randomly selected.

#### 4. Game play

Bets are placed and the game is played.

#### 5. The Game Data is Shown

Once the game has finished, the spin of the reel (Result+Secret), the “fingerprint” (hash[Result+Secret]), the players input (client seed) and the final result are shown. Using the pop out widget, the play can be verified by checking that the spin matches the “fingerprint” given before the game.

#### 6. Check the Players Effect on the Game

The effect of the players input can be checked by comparing the spin (Result+Secret) to the final result. The player’s input, called the client seed, is a number where each digit represents a different reel. So, for a 5 reel slot machine, it will be a 5 digit number. If the number was 30700 then for the final result you will have the icon at the top of the first reel match the first icon in the fourth set shown in Result (the first set counts as 0). The second icon will the second icon listed in first set, third icon will be the third icon listed in the eighth set and so on. You can do the same for the second and third rows too.

## Mersenne Twist Pseudorandom Number Generator Package

### Overview

The Mersenne Twist method for generating pseudorandom numbers is an extremely fast, flexible, and desirable approach to random-number generation. It has superb statistical properties and a ridiculously long period (2^19937-1).

### Features of the Package

- Fastest implementation known (as of 20 June 2001).
- C and C++ access using same header and object files.
- Inlined code when available.
- Variety of formats: integer and double, 32- and 64-bit.
- Automatic seeding.
- Multiple independent (uncorrelated) PRNG streams.
- Functions for generating popular distributions.
- Downloadable in source form.

### Background

A number of implementations of the MT PRNG exist, in a number of languages. Most of these are listed on the inventors’ Web page. However, I wanted something a bit more flexible and complete than was available; in particular I wanted multiple independent PRN streams. In the process of writing that code, I got involved in a bit of optimization and wound up with a faster implementation than anything else available at the time. My version can be downloaded in source form for use under the LGPL.

My PRNG package will generate numbers in both integer and floating-point format, including 64-bit integers if the compiler supports them. It also supports the ability to generate multiple independent streams of random numbers, so that simulations and similar studies can be done without inadvertent correlations.

In addition to the PRNG code, my package also includes code to generate random variates following a number of common distributions (uniform, normal, lognormal, exponential, Erlang, Weibull, triangular, and empirical).

Finally, my package follows two ideas from Richard J. Wagner. First, it is simple to initialize the PRNG from the system time or from `/dev/random`

(when available. This feature is very handy for games, signature pickers, and similar applications that need to get a different random-number stream each time they are run. Second, the PRNG state can be saved to a file (in ASCII) and restored later. The save format is compatible with Wagner’s code.

### Performance

Running in 32-bit mode on the fastest machine available to me at the time, a 3.6 GHz Pentium Xeon, my PRNG can produce up to 132 million random 32-bit integers per second, and 59.1 million 64-bit integers per second. Floating-point values are slower, of course: about 36.3 million per second for numbers with 32 bits of randomness, and 18.9 million per second for 53 bits of randomness (which is the maximum representable on most machines). These figures are the result of ten experimental runs with the same random seed, and are valid to the given precision at a 99% confidence level.

On an older 450 MHz Pentium II, my implementation generates up to 21.2 million random 32-bit integers per second, and 8.2 million 64-bit integers per second. Floating-point values are generated at about 11.3 million per second for numbers with 32 bits of randomness, and 5.3 million per second for 53 bits of randomness.

### Downloading

The current version of the package is 1.5. Because of the provenance of the code, most of it is released under the LGPL. The source is available for download in gzipped tar format only.

### Bug Reports

Please report bugs and requests for improvements to the author of the package.

## What is Mersenne Twister (MT)?

Mersenne Twister(MT) is a pseudorandom number generating algorithm developped by Makoto Matsumoto and Takuji Nishimura (alphabetical order) in 1996/1997. An improvement on initialization was given on 2002 Jan.

MT has the following merits:

- It is designed with consideration on the flaws of various existing generators.
- The algorithm is coded into a C-source downloadable below.
- Far longer period and far higher order of equidistribution than any other implemented generators. (It is proved that the period is 2^19937-1, and 623-dimensional equidistribution property is assured.)
- Fast generation. (Although it depends on the system, it is reported that MT is sometimes faster than the standard ANSI-C library in a system with pipeline and cache memory.) (Note added in 2004/3: on 1998, usually MT was much faster than rand(), but the algorithm for rand() has been substituted, and now there are no much difference in speed.)
- Efficient use of the memory. (The implemented C-code mt19937.c consumes only 624 words of working area.)

### MT Asks

- MT is a free ware. Use as you like. When you use the code, I wish you to let me know how and what purpose you use it, how is the result, and a proper reference to your result, if you can, preferably to m-mat @ math.sci.hiroshima-u.ac.jp (remove two spaces by hand). If possible, let me know a link to your results.
- If you have any improvement, problems, applications of MT (e.g. other implementation, assembly language, non-uniform random variates, etc.), and you allow us to link them to this home page, please let me know.
- MT uses results of pure abstract mathematics, in particular a classical number theory developed 50-100 years ago, and at that time they were not considered to be useful to the science. These days, pure abstract mathematics are considered to be redundant even in universities, and mathematics departments tend to be closed or changed into informatics. We don’t think this is a right way. Pure mathematics shows “unexpected unreasonable effectiveness” in many areas of the science, although its effectiveness is not so easily percepted by the society, compared to other branches of science. We are glad if you take it into consideration that the present society is supported by mathematics developped hundreds years ago, and the next generation might be supported by the modern mathematics which might seem to be too abstract to utilize in the society, just right now.

### MT Acknowledgements

The idea of Twisting in MT comes from the discussion with Prof. Nobuo Yoneda who left us in Apr. 1996. The paper is dedicated to his memory.

A previous ancestor of MT, Twisted GFSR is a joint work of Matsumoto and Y. Kurita.

MT is a descent of F2 linear generators and heavily depends on the researches by Professors M. Fushimi, S. Tezuka, P. Lecuyer, R. Couture, H. Niederreiter, and many many other researchers whose names we omit here.

The research of MT is helped by Dept. of Math of Keio University, RIMS at Kyoto University, CRM of Montreal University, Max-Planck-Institute for Mathematics, Salzburg University, and many other institutes, and supported by a Monbusho grant.

MT uses many existing ideas. In particular, we are thankful to the following persons.

N. Yoneda, P. L’Ecuyer, R. Couture, H. Niederreiter, P. Hellekalek, M. Fushimi, S. Tezuka, Y. Kurita, D. Knuth, H. Leeb, S. Wegenkittl, T. Cooper, M. Rieffel, H. Enomoto, and many many persons who gave us valuable comments, including the users of TT800, a previous twisted generator.

## The origin of the name MT

MT was firstly named “Primitive Twisted Generalized Feedback Shift Register Sequence” by a historical reason.

Makoto: Prof. Knuth said in his letter “the name is mouthful.”

Takuji:……..

a few days later

Makoto:Hi, Takkun, How about “Mersenne Twister?” Since it uses Mersenne primes, and it shows that it has its ancestor Twisted GFSR.

Takuji:Well.

Makoto:It sounds like a jet coaster, so it sounds quite fast, easy to remember and easy to pronounce. Moreover, although it is a secret, it hides in its name the initials of the inventors.

Takuji:…….

Makoto:Come on, let’s go with MT!

Takuji:….well, affirmative.

Later, we got a letter from Prof. Knuth saying “it sounds a nice name.” 🙂