Everyone is good with this method from DarkStar_?
1. Publish the list of tickets and who has which ticket, a bit before the actual draw. Make sure that tickets are numbered.
2. Wait for a specific block hash for the drawing. Once the block comes, take the last few digits of the block hash (maybe 7?) and convert it to a decimal, by using it as a hexadecimal. Next, use the number that you get and apply modulus (number of tickets - 1) to that number. You should get a number between 0 and the number of tickets, minus one. Add one to the number, and you have your first winner. You can get the other winners in other blocks, or if that takes too long, use the last 8 digits, than 9, e.t.c repeating the entire process I just outlined.
Here is an example of the method I outlined:
For this example, I will be using the block that was mined right before this post (block 426230). Normally, a block that hasn't been mined would be used, but for convenience, I will use an already mined one.
The has of the block 426230 is
Code:
000000000000000000dd8a7bb73190bd8574df5f18966347a2094049e28c8cab
The last 7 characters are 28c8cab, and when converted to a decimal gives 42765483. Here is my imaginary ticket list (published before the block is mined)
Code:
1: darkstar
2: person2
3: person3
4: person4
5: person5
42765483 % 4 gives 3. 3+1 = 4, so person 4 would have won the 1 BTC prize in this case.