π©How Are Winners Determined?
Last updated
Last updated
Lottery uses works as follows:
After the on-going lottery round expires, two block numbers are selected: the latest one on the chain is obtained (Block A) and a future yet-to-be-produced block (Block B).
A third random number, β is selected as a salt.
Block A and the salt s are chained together and hashed with SHA-3 to get a digest D.
The digest D is put on-chain and the round for the lottery is closed to prohibit the purchase of new tickets.
After Block B is mined, both Block A and the salt are uploaded to a random number contract, which verifies that the digest matches the uploaded block number and salt in step 3.
The random number contract verifies that the digest matches the uploaded block number and salt and then takes the block hash and salt corresponding to the block number and does a SHA hash to calculate the final lottery result.