One of the most important problems that any lottery in the world needs to solve is that procedure or algorithm that obtains in each draw the winning numbers. In our case, as a virtual lottery, our team of experts has designed a completely secure algorithm to generate the seed string from which the 5 4-digit numbers are extracted.
For this we use an independent and worldwide known issuer as BITCOIN. It is known that approximately every 5 to 20 minutes a new block is generated for the Bitcoin chain. Each block is associated with a HASH that uniquely identifies it.
Each draw, una vez evaluado, genera un hash particular, una vez obtenido los premios que usaremos para obtener los del siguiente sorteo.
En este ejemplo utilizamos el hash del anterior sorteo:
d57cbd9ef56e9 bc773c9ad93a2 131d2e3ab64ac f54ed1466da21 efdd145b24328
cbd85971335a9 26ab9f3fd66a1 5c334 973984f a7dbdbacfa668 8b8078a9a65d
For nuestro sorteo, the first block that was generated had this Hash:
Concatenamos ambos hash y le aplicamos la funcion criptografica sha512. De esta manera obtenemos 512 caracteres hexadecimales
53a88ea66279e edacb1a4015b8 a9fc7a59c577f 3425161127a2f 8eb2db0dab68b
5be60cb29b167 ec1df53e5c273 f9b6eba002467 f13005f2800f0 446fed038a7
Los dividimos en subcadenas de 13 caracteres e seleccionamos las cinco primeras cadenas (una para cada premio). A cada cadena le aplicamos la siguiente formula para obtener el premio:
const valor = parseInt(cadena, 16) / Math.pow(2, 52)
const premio = Math. floor(valor * 10000)
For nuestro ejemplo los 5 premios obtenidos son:
3267 9284 6640 2036 5574
The sixth position, or the sixth prize, is called Modern, so the (M)
It's value is the thousandth part of the sum of the five prizes obtained with the hash. In the example above, the sum of the first 5 prizes of the Beast Game is 26801, so the Modern will be 6801.
In seventh place, or seventh prize, is the so-called Rio. Its value is obtained by multiplying the first prize by the second prize obtained through the hash, without taking into account the three numbers to the right, and considering only the hundredth of the number obtained
In our example, the Rio would be 330
3267 x 9284 = 30,330,828
The eighth number is the Salted, (S). Its value is the group number corresponding to the result of multiplying the 1st prize ten by 4. Thus, in the example:
67 x 4 = 268 - Monkey, group 17
The Hash of the block chosen for the drawing of the winning numbers will be the first one obtained from the exact hour, minute and second after the official time of the draw. This can take between 1 and 20 minutes, depending on the complexity of the block.
It is impossible to deduce before the draw time what the winning numbers will be, because to get the hash by BITCOIN requires a computation power of thousands of servers that simultaneously solve the final hash.