# Using Ethereum Blocks to Ensure Fair Draws at lotodobicho.com

Ethereum is a blockchain network, and like all blockchains, it is composed of a sequence of blocks. Each block contains a set of transactions and associated information. In the case of Ethereum, a new block is added to the chain approximately every 16 seconds. This means that every 16-second interval, all transactions that occurred during this period are verified, validated, and added to the network in the form of a new block.

Each Ethereum block has an associated timestamp, which marks the exact time it was created. In a draw, a specific moment is chosen, the draw timestamp. To generate the prizes, we use information from the Ethereum blocks that are immediately before and after this draw timestamp.

• Previous Block: It is the block whose timestamp is the most recent, but still before the draw timestamp.
• Next Block: It is the block whose timestamp is right after the draw.

The function uses the hashes of these two blocks. By combining these two hash sequences, and through mathematical processes, the function calculates the prizes.

The choice to use the blocks immediately before and after the draw timestamp ensures that the prize generation process is based on data that cannot be predicted or manipulated, ensuring the integrity and fairness of the draw.

The function that extracts the winning numbers is like a mathematical algorithm that uses these hashes to generate a series of prizes. It does this in the following way:

1. Hash Combination: It takes two hashes, one from the current block and one from the previous block, and combines them.
2. Transformation: Transforms this combination into a new unique sequence (a new hash) using a mathematical formula (SHA-512).
3. Number Extraction: From this new hash, it extracts five specific character sequences.
```    [0, 1, 2, 3, 4].reduce((acum, index) => {
const draw_hash = generateHash(hash, prev_hash);
const stripped: string = draw_hash.substr(13 * index, 13);
const val: number = parseInt(stripped, 16) / Math.pow(2, 52);
const num: number = Math.floor(val * 10000);