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.
Shouldn't you apply modulus (number of tickets)? Why - 1?
Because modulus (number of tickets) has a chance of giving a 0, so this is countered by adding one to the final result. Granted, they could just give people ticket #0, but it might cause confusion and isn't very hard just add 1.
Without -1: Range of 0 - # Of Tickets - 1
With -1: Range of 1 - # Of Tickets
Sportsbet.io, have you decided whether you are going to use multiple block hashs, more digits or a combo of both?
I agree with adding 1 to the result of modulus. I don't agree with removing 1 from number of tickets for applying modulus.
That sort of guarantees the last ticket a zero chance of winning anything.
Adding one to the result gives 1 to 99. (
X % 100.