Dec 21st 2021 06:58

No Random Number Generator in Lotteries Explained!

The core process of any lottery is the means by which winners are selected. This is done through a Random Number Generation (RNG), which in most cases, is a method of which the winning numbers in a lottery is chosen by the lottery organization using some sort of internal or external software.

Since the advent of the large-scale lottery, many techniques have been invented to determine the winning numbers in the fairest way possible. One method is to randomly generate numbers to declare as winning numbers. But this way of generating numbers, is not randomized enough and here we are explaining why RNG is not an effective way. Solidity and other blockchain programming languages are not capable of creating random numbers. Infact, every algorithm for creating random numbers is pseudorandom — no programming language can create completely random numbers. The problem with Solidity is that complex algorithms cost more (every interaction with smart contract is considered a transaction, hence needs a gas fee to be covered), so more basic solutions are used. Besides that, Solidity code should be deterministic, as it will run on multiple nodes.

 

Things like a clock time (a very good medium of creating unique states) are not available for generating random numbers, so other options should be considered. But other options come at the cost of either not being comprehensive and truly random or being prone to various cyber security attacks. One of the most used algorithms is ‘linear congruential generator’ (LCG). It’s one of the oldest algorithms, fast, and easy to understand. LCG is a good option for embedded systems as they have a limited amount of memory.

However, it is not well-suited for cryptographically secure applications. Although, this is still being used in smart contracts as a fast algorithm and is much cheaper to implement in terms of gas costs. The problem with RNG is that widespread that any individual with a programming background and good searching command can conclude that randomly generated numbers are not comprehensively random and can be tampered or altered by an adversary. To summarize, RNG is not a good solution to declare winning numbers for the current blockchain technology. Thus, MyLottoCoin uses winning numbers that are declared by official lotteries through a robust process, to declare winning numbers on its platform.

To do that, MyLottoCoin captures the winning numbers for each draw, from the official websites of official lottery games, and feed them as the winning numbers to the smart contract. From this point, MyLottoCoin’s smart contract uses those numbers to identify the winners. Tap into the first of its kind the fairest decentralised lottery game.