Is the way Minereum Lucky Draw game works really safe 100% onchain RNG and verifiable on smart contract?

They claim yes but I would like to know expert technical answer for this, if so, isn't this a major breakthrough in generating random numbers on the blockchain without oracles?

More details: https://www.minereum.com/v2/luckydraw

They say:

The Random Number Generation is totally decentralized and fair, the source code can be verified here. The random numbers are generated based on the blockhash of the second block after purchase. There is an interval of 3 blocks between buying a ticket and playing to be able to guarantee complete unpredictable randomness 100% on-chain.

  • No, because what they claim is "Provavly Fair, Secure & Safe Random Number Generation 100% on-chain without the use of any oracles. Minereum Lucky Draw is a blockchain experiment to prove that 100% Safe onchain randomness is possible."this is quite a big statement, the link you posted actually states it is not 100% safe to use blockhash. So my question is still open
    – Manu
    Sep 19, 2020 at 11:13
  • @Manu In the link provided there's no proof of any of their statements. Looking at the code in Etherscan they use blockhash in the same way as in the question pointed by Morten. It is not 100% safe, miners still have leverage because they can select a block that works for them and drop transaction that they don't like.
    – Ismael
    Sep 19, 2020 at 22:11
  • @Ismael, you are wrong, read my answer. To be honest it is actually 200% safe. Have a look with some attention and you will find out the way they are doing it is actually genius
    – Resten
    Sep 20, 2020 at 19:17
  • @Resten Please justify why it can't be taken advantage of by miners. I added a couple of attack from the top of my head to your answer.
    – Ismael
    Sep 20, 2020 at 19:45
  • @Ismael, miners cant take any advantage see my comment on the reply, it is impossible.
    – Resten
    Sep 20, 2020 at 20:27

1 Answer 1


The way they are doing it is indeed a breakthrough in my view, it is the first time I actually see a 100% safe way to generate random numbers on a smart contract without oracles.

EDIT: And by the way, oracles are not even 100% safe because you are always trusting third parties.

How they do it:

  1. First you need to buy a ticket
  2. You can only use your ticket after 3 ethereum blocks
  3. When you use your ticket the random numbers are generated based on the blockhash of the 2ND block

This is actually genius, as there is no way for anyone to guess the blockhash because it is always a blockhash of the FUTURE! (the RNG are generated based on the blockhash AFTER you purchase the tickets)

EDIT2: Miners can't even check on invalid transactions because the blockhash is always done based on a future blockhash (after they pay the eth), the only downside of this method is that the tickets expire after 256 blocks due to ethereum limitations on caching the blockhashes, but 256 blocks is actually a good amount of time for the player to redeem the tickets (it's almost 1 hour), as a player you just have to make sure you play the tickets before they expire.

100% safe in my opinion and source code is good, couldn't find a flaw

  • A miner can still manipulate the result. For example by delaying so you can't redeem before the 256 blocks, or they will force you to pay more in gas. Since they generate a block they can determine before the block is solved whether they will win or not and search for another block in they not.
    – Ismael
    Sep 20, 2020 at 19:45
  • The miner cannot manipulate the result, zero chance, it is impossible with this method. Look, think about it: 1. You buy a ticket (you transfer your eth, the eth is already gone from you), this is the block 1 of the RNG journey. 2. You can only use your ticket AFTER 3 blocks - 3. After 3 blocks when you use your tickets it will generate the random numbers based on the blockhash of BLOCK 2. BLOCK 2 is AFTER your block 1, in order for the miner to be able to manipulate the RNG the blockhash would have to be from Block 1 OR before, but in this case it is AFTER. Zero chance for manipulation.
    – Resten
    Sep 20, 2020 at 20:22
  • @Ismael, And if I am wrong and you are right, go head and hack it... the current pool is almost 4.5 eth hehe
    – Resten
    Sep 20, 2020 at 20:24
  • @Ismael, the magic here is that the RNG is always generated based on block 2 and you can only use it after block 3. No matter in what block you use the tickets after block 3 to trigger the RNG it will always generate them based on Block 2. Block 2 is always unpredictable on the moment you are purchasing the tickets, thus 100% safe RNG onchain without oracles, they are correct.
    – Resten
    Sep 20, 2020 at 20:40
  • The miners generate blocks so they can check if you will win, and discard that block so you will not win. Probability is low but it is not zero, a miner may decide to attack depending on the total reward. Another attack is take advantage of short forks, they are pretty common. Send a bet wait three blocks if they don't win publish a block with higher pow.
    – Ismael
    Sep 20, 2020 at 20:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.