Author

Topic: Sum of all satoshis transactioned in the last block(s) (Read 848 times)

legendary
Activity: 1122
Merit: 1017
ASMR El Salvador
To have a more random number you can multiply it by the number of seconds in between blocks.
But I agree, block hash may be a better choice.
You don't even need to truncate it, just convert to decimal and do H mod N, with H being the hash of the block created - closing of the game - converted to decimal and N the number of participants of the list of participants by arrival, and you get a random pick, giving you the position of the winner in that list with H mod N.

You just have to rule in advance which block will close the contest, than do this simple calculations, and voila!

Or, of course, you could use a maximum number of participants if you wanted, and expect for the next block created after such last participation, to be able to tell the random pick.
donator
Activity: 1218
Merit: 1079
Gerald Davis
Even if the miner doesn't cheat S isn't evenly distributed.  Far easier to just just the least significant 8 digits of the block hash.
Jan
legendary
Activity: 1043
Merit: 1002
S is not random. The miner can basically choose any value he wishes.
legendary
Activity: 1122
Merit: 1017
ASMR El Salvador
S mod N, where S is the sum of all satoshis transactioned in the last block(s) and N the number of participants of a contest during that block(s) creation can be used as extraction number for a list of participations.
'S' is quite an unpredictable number that no one knows in advance and can rules out the possibility of cheating about the random pick of winner.
Jump to: