This is a paid-for submitted press release. CCN does not endorse, nor is responsible for any material included below and isn’t responsible for any damages or losses connected with any products or services mentioned in the press release. CCN urges readers to conduct their own research with due diligence into the company, product or service mentioned in the press release.

Ethereum features its decentralised capability and transparency, exceptionally ideal for betting game platform operation. However, unlike ordinary development environment, in blockchain world, there is no intrinsic way to seed and generate random numbers, as all outputs within blockchain environment are deterministic. By the way, there are some workarounds to implement this.

Blockhash approach

This targets games which are merely for fun or with a relatively low stake, as its number generation algorithm is transparent and shown in the smart contract, also its inputs, like blockhash (an unique long text for labelling a block) and block number (completely deterministic). Normally, blockhash is unpredictable but if the reward is extremely large or worthy, miners can choose to whether publish or give up a new block to the network, so they can have some degrees of control in blockhash generation for result manipulation.

Oraclize

This is a technology developed by a FinTech startup and its usages are not only for random number generation but also off-chain data feeding. They treat blockchain as an isolated world and Oraclize is a bridge between web2 and Ethereum’s world. 

The concept is having a mechanism to provide proof which ensures the source data from external parties not being illegally trampled while travelling to the destination. 

However, it practically takes time to get a random number from external sources, like random.org, at least taking several block times, and also consuming significant amount of gas too!

In addition, the same issue persists, if the game reward is tasteful enough, on-demand results from a centralized source can become trustless. 

Blockchain-based Provably Fair

It is a moderate workaround for random number generation under blockchain environment. If you have installed MetaMask in Chrome or Firefox, welcome to have a try in this technical demo running in Ropsten testnet, by ETH888, an Ethereum casino platform.

There are three major concerns in its design:

  1. convince players that random factor was generated before they placing a bet
  2. players can contribute their inputs to affect number generation
  3. players are unable to control the result


For point 1, it provides a SHA256 encrypted hash to the players before any bets placed. The key to this hash actually is a random server-side seed (a long random string) generated from a centralized world (a private client node in Ethereum network). The seed is already stored in a private database (no public end-point). Once result available, the server-side seed will be available too. They can check all consistencies with an open validator.

For point 2 and 3, the players are allowed to place their bet coupled with their user-side seed. The smart contract will take the betting information, hash given and also user-side seed, broadcasting an event to our private client node by providing these information as well. The private node has the access to the private database, so it has the server-side seed, and calculates the final result. When done, it will callback an owner function in the smart contract, most importantly, providing the server-side seed which consists with the hash under SHA256 algorithm.

Conclusion

After a series of trials, a provably-fair result generated by ETH888’s Blockchain-base Provably-Fair approach, in average, takes less than 30 seconds. All results are totally verifiable. It is indeed far more practical. In contract, blockhash approach is too transparent to the players while Oraclize consumes too much time and gas from the players.

Posted by Tom Clancy