----------------------------------------------------
At the start of the round, have the server create a seed, and display that seed hashed to the public. At the end of the round, generate a roll using the round's total amount of tickets hashed as the client seed, and the nonce being the lottery round number.
Define t by taking that roll number and multiplying by one million (t = roll#*1000000). Define n by taking t and performing a modulo operation with the round's ticket count, and adding one (n = (t%tktcount) + 1). And there you have it, the winning ticket is the nth ticket acquired in the round.
Finally, to make it truly provably fair, make a spreadsheet of sorts (google docs?) which shows each user id and the number of tickets purchased in order from the start of the round to the end (See this link: https://docs.google.com/spreadsheets/d/16FCMiXgVXI9unoFMm2qgCoK7gGA5BaZqth2BCoddT7k/edit?usp=sharing) - Use multiple entries for each purchase as necessary (Shown in the spreadsheet). This spreadsheet is updated automatically after someone earns/buys a lottery ticket, and there is a link on the lottery page where users can view the spreadsheet at all times.
Users can verify the winner after the round by doing the roll formula and checking it against the spreadsheet.
Let me know if you have any questions, or if I missed anything.
Jake
Edit: Grammar
WTF? not even newbie but brand new user talking about the system.... Are you actually part of the freebitco.in staff or just have found that that it works that way?