The random number generator is based on SmartHoldem's truly random entropy. The SmartHoldem blockchain is used as a source of entropy.
If you discover the winning number at the end of the game, travel back in time, select that number, and the game's result will change to a different winning number.
Every 8 seconds in BlockChain SmartHoldem, randomly ranked delegates generate a unique Hash ID block containing a numerical series of hexadecimal values, for example: d291a92dce4d774285d9d0c4e6e1cc1f765c6e30ca2733f337c80c8af932dfa0.
The resulting hexadecimal Hash of the block is converted into a decimal numeric sequence.
To calculate the current random number, values with the required number of characters are selected from the number series, for example, 2 (from 00 to 99).
The block explorer and Hex to Decimal Bytes Array Converter make it easy to verify all blocks. To do so, copy the block hash into the Hex to Decimal Bytes Array Converter.
Example of sampling a random value from 0 to 99:
id - Hash of the current block (calculated from all data included in the blocks)
Provably random, tamper-proof, and low-cost True Random Number Generator (TRNG)
The block data is used as input to generate each random number, confirming that the result is generated fairly and independently of the requester.
Every random result can be verified using cryptographic proofs.
You and your users receive unbiased randomization and are safeguarded from compromised third parties.
One way to explore a random number generator is to visualize the numbers it produces. Visualization is one way to get a rough idea of the generator's performance. The images below are parts of larger images created to test the quality of the two random number generators. The picture on the left is made using Blockchain TRNG SmartHoldem, which is a True Random Number Generator (TRNG), and the image on the right is created using the rand() function from PHP in Microsoft Windows, which is a Pseudo Random Number Generator (PRNG).
This visual comparison clearly shows how important random numbers are, especially if your app is a game or gambling site. As you can see, the image generated by the PHP/Windows pseudo-random number generator shows clear patterns compared to the image generated by the Blockchain TRNG SmartHoldem true random number generator. True Random Number Generation - Always Random!
Let's devise simple lottery rules: ticket numbers range from 0 to 99, the draw occurs every 2880 blocks, and the winner is the player who guessed the random ticket number.
Before the lottery began, Alice bought a ticket with the number 14, while Bob purchased a ticket with the number 21
When purchasing a ticket, each lottery participant makes a transaction on the SmartHoldem blockchain. The transaction is signed with a unique crypto signature; the ticket number is indicated in the note.
When transactions are added to the block, it receives a unique hash consisting of transactions, the hash of the previous block, and other data.
Every 8 seconds, delegates create a new block. Example block hash: bd082c73...960fbda8
The draw is scheduled in 2880 blocks.
For example, a block has been reached on which the lottery draw should take place d2c6f1ab...cae17f0e
We need to calculate the winning number in decimal notation (DEC) based on the block's hexadecimal (HEX) hash.
00 to 99 is sufficient for us:
In this case, the lottery winner is Alice.
Suppose Bob has a time machine. He knows the winning number 14, so he goes back in time and buys a ticket with that number.
“The result will be a completely different hash of the block being played because all hashes of transactions and blocks will change, and the number series will have new values.”
Thus, we get:
While waiting for the block to be created, other users make random transactions unrelated to the lottery, influencing the Merkle tree's final hash.
Use SmartHoldem blockchain entropy to generate a number series as a true random seed.
Default decimal values are available: 0..9, 0..99, 0..255, 0..999 и т.д. до 1.15*10^77 or
115 792 089 237 316 200 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000.
- Get a new hash. If you decide to use the concatenation of the block signer's delegate name (each round delegates are assigned by crypto random) + the block hash, you will get a new hash from them.
- Add crypto functions: crypto.randomInt, crypto.randomUUID, HMAC, Lamport signatures, hashing functions, ECDH, Scrypt.
- Create your own number generation rules using the true random entropy of the SmartHoldem blockchain.