When a ticket's number is found to be the same as the random.org integer generated before iteration started, the address that the ticket was purchased from is extracted from the winning transaction and the jackpot contents are sent.
In my humble opinion the target number for winning should NEVER be known until all tickets are bought. For small jackpots/prizes its ok, but anything big, and it makes it way too easy to cheat. For anything big you have to make it such that even you can't make yourself win. People need to be able know for sure that they weren't cheated. It's possible, just trickier to do.
Yeah, I agree. An excerpt from the payout logic:
if($purchased_tickets == $total_tickets) {
//start random winner selection process
but as far as I can see any transparency I provide on the random number generation could be disbelieved by anyone with enough willpower
It's because it can't be checked. Anyone could say they are getting the number from random.org but there is no way to verify that. The person could be manually picking a number.
Some possible things you could use:
-an announced hash of a block hash or something in the future and use hash digits as random data
(only flaw is that blocks can be manipulated by a player with enough computing power to maybe give them an extra chance at what block is used by not submitting it - highly unlikely and hard to do)
-I use a sha256 hash of a block with a set date agreed upon before hand along with real world lottery numbers AFTER all the tickets are sold: sha256 (blockhash+megamillionsnumbers)
Doing this it's *impossible* to cheat!! To cheat they would have to cheat the mega millions lottery and only knowing what numbers they need a few hours ago!
-the main disadvantage is that the data has to be manually entered or automatically retrieved from a website and it's less flexible when you get your random data. For me, I can only do draws twice a week at most unless I use other lotteries too. It is the most reliable though and cheat-proof.
I've got a few ideas to play with, but I'll keep them to myself until they're more well-formed.
Also....I'm going to be using a corporate scale db platform utilized for 1bn+ entries that's redundant, hot-swappable, etc, so that the raffle can eventually operate in as fast-paced a way as it's designed.
Because you are doing the lottery off of your servers, your BIGGEST issues will probably be making sure data is never lost and people hacking your server or even seizures depending on where you live. Depending on the amounts, people will probably attempt stealing or manipulating your database. You probably already thought of that though...
Good thing I'm using a specialized DB platform that nobody except massive corporations uses. No injection vulnerabilities, collision issues, sharding in buckets, etc.
I think you could have an interesting thing here. It will take some work but it does have potential. When are you expecting a website showing what it does? I'd be interested in taking a sneak peak if you have one with tiny amounts or something! (As you can see, my main interest and focus is lotteries!
) I actually want a few honest lotteries around. It's good for the bitcoin gambling community to have honest operators. If all we had were scams, no one would play anymore! Good luck!
I'm expecting to have a site up in the next day or two, with an active beta running within the week. Gotta finish the codebase and run a stress test, buy a domain, and install/configure the app on my dedicated server. I've got a sneak peak, but it's useless to look at right now. Since my current server couldn't handle the load my app put on it, I shut down bitcoind and the raffle app for now. Sadly, real life has gotten in the way of messing around with the raffle over the last couple of days, and my immediate need for cash takes precedence over the raffle, but I'll be getting it all handled by this Monday.
As far as honest BTC service operators, it's a pretty clear choice for any competent developer to be honest. After all, our small service fee combined with donations from happy customers easily outweighs the payout from scamming a couple of people out of some small change. Besides, it's not as if the bitcoin community isn't tiny anyway, any bad apples get tossed in the garbage pretty quick.
So, long story short, I'll definitely keep you posted!