There has been a lot of discussion about the impossibility to generate secure randomness inside ethereum smart contracts, and general consensus is that theoretically miners could easily manipulate the results. But maybe it's worth to perform a small reality check... here comes the Ethereum PRNG Challenge!
PRNG_Challenge: 0x4ed65e408439a7f6459b5cfbd364f373bd6ed5f7Balance of above contract is currently
10 ETH: when you send
0.1 ETH or more to it (with a gas limit of
100000, unused gas will be returned) a 256 bit random number generator is triggered, and if the generated value matches with a predefined lucky number the entire balance is paid back.
Let's see if someone manage to cash it out, of course there's always a very small probability of hitting the correct number out of pure luck (theoretically 1 out of 10^77 - the entire universe is estimated to contain about 10^80 atoms).
Here you can check the source code and interact with the contract:
PRNG_Challenge: 0x4ed65e408439a7f6459b5cfbd364f373bd6ed5f7https://live.ether.camp/account/4ed65e408439a7f6459b5cfbd364f373bd6ed5f7https://etherscan.io/address/0x4ed65e408439a7f6459b5cfbd364f373bd6ed5f7https://etherchain.org/account/0x4ed65e408439a7f6459b5cfbd364f373bd6ed5f7Interface:lucky_number(): returns the predefined lucky number.
last_number(): returns the last random number generated.
attempts(): returns the total number of attempts.
winner(): returns the winner address (if any).
Attempt(Participant, Number): event triggered at each attempt.
Winner(Winner_Address, Amount): event triggered in case of win.
Good luck!