I'm sorry, but I really am not understanding all of that the post
What about this (sort of based on that)
Each ticket is given a number, which equals (100/(S+1))*P, where S=Number of tickets sold and P=place which the ticket was sold, so first sold is 1, second is 2...The +1 is in there so the lowest and highest numbers will be evenly spaced from 0 and 100
Then, the winner is the person whose number is closest to the number formed by combining the last two digits of the most recent block's hash. If the number was closer to zero or 100 than the lowest ticket number, the next block will be used (or else first and last tickets would be more likely to win)
In the example you linked to, the numbers would be:
20 nikto
40 boba
60 spork
80 azrael
And the last two digits of the block would be 7 and 2, making the number 72, so azrael would win
This seems like it would be fair to me
There are too many odd cases for this to be verifiable. Also the block hashes are reported in hexadecimal. You are not going to get a number evenly distributed between 0 and 99.
My original idea was to use a third party as a random number source, which required the salt and the hash. If you can get a random number from a future source, like a block hash, then you don't need to keep the file contents secret. Thus all you really need here is to turn a block hash into a random number and then use that to select a ticket. In order for this to be provably fair it is absolutely necessary that you state the rules for doing this precisely and unambiguously before you know what the random number is.
Here is a straightforward plan. Make a list of tickets in a spreadsheet. If someone has more than one ticket, put their name in the spreadsheet twice. Give each line a number starting with 0. So, assuming boba has two tickets:
0 nikto
1 boba
2 boba
3 spork
4 azrael
Post the spreadsheet in this thread.
It turns out I can't resist a good math problem. I put together a Google Docs spreadsheet that turns block hashes into a random number, and then into a row selector:
https://docs.google.com/spreadsheet/pub?key=0AsBByTjGFrPUdFYwSVhJYmJRb2lqbEJRSmZBQTNhSWc&output=htmlIt is a small improvement on tescomatty's idea. I cut up the 256-bit hash into eight 32-bit chunks, XORed them together, then took the modulus of that and the number of entries to get a random number between 0 and the number of entries minus one. If anyone with a CS or cryptography background cares and wants to double-check my work, I would appreciate it.
When you post your spreadsheet, announce a block number a good 20 links higher than the newest one. When the block is generated, post its hash to the thread. PM me. I will update the spreadsheet with the hash, and it will spit out a number matching one of the entries in your spreadsheet.
If there is actual money at stake here and you are planning to run a fair and verifiable giveaway, it would also benefit you to post the address of the wallet you will be distributing the coins from.