2

This question already has an answer here:

It is possible to generate truly (not pseudo) random number with specific range inside smart contacts

(for example I need random number between 1 and 60 000 )

Thx!

marked as duplicate by niksmac, eth Mar 28 '16 at 17:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

There is no way to do so. Suppose there exists a way to generate a truly random number in a contract, then two nodes/ miners will generate two different values, thus end up having two different blockchain states. No consensus can be achieved in such scenario.

  • There are some ways #1, #2, #3 – niksmac Mar 28 '16 at 12:53
  • @NikhilM op was asking about generating totally random numbers. Any solutions in your references can be easily biased. – Loi.Luu Mar 28 '16 at 14:56
  • 1
    I understand that, i just wanted to show you some possible ways since the question was already discussed in SE. – niksmac Mar 28 '16 at 15:44

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