Author

Topic: Creating a decentralized lottery object on top of Bitcoin: but how? (Read 338 times)

hero member
Activity: 770
Merit: 504
I had a dream last night where there was a digital lottery object that worked on top of the Bitcoin network.  The fixed portion was the odds and when it paid out, and there would need to be a new 'object' for each combination of these variables.  In reality, there would only be a few popular ones.  
  
Let's look at an example: A once-a-day lottery object paying out on 1/1,000,000 odds.  
  
This lottery game runs on top of the Bitcoin client with all involved paying into a certain Bitcoin address, and leaving a 'Winnings' address attached to their entry fee.  The only catch is that even though the odds of winning might be 1 in 1,000,000, we will have to price the entry fee slightly higher to create a *new* jackpot once the current one is won.  In this way, the only money necessary to fund the object is a one time donation to get it started.  
  
Players would pay something like 1.1 bits (110 satoshi) for a chance to win the jackpot (if it is at least a Bitcoin, this is an even money proposition).  I know these values aren't very high, but I'm keeping them small for purposes of illustration; in reality the market would determine which 'lottery objects' were exciting enough to fund and exist.  
  
All fees would go into an address owned by the lottery network itself, and players would also submit 'lucky numbers' to the network as well.  At a certain time interval, the lottery object would compare a hash of each player's "lucky numbers" to the most recent successful Bitcoin block, and if it was within a certain tolerance (determined by the odds) then those lucky numbers, and that player, would win the jackpot and get paid according to their submitted "Winnings address".  
  
So to recap:
  
1. Player submits: an entry fee, an address to send any winnings to, lucky numbers  
2. The network: takes all entry fees and holds them in trust, and awaits a predefined time interval to look at the most recent successful Bitcoin block hash.  For a once-a-day drawing, it might look at the first successful Bitcoin block after 00:00 hours, for example. 
3. The network calculates a hash of all lucky numbers and compares this to the hash of the chosen Bitcoin block - if the hash of the lucky numbers is within tolerances set by the chosen odds, the network pays out to the associated winner's address.  
  

 
  
The problem is I am not a cryptographer and I don't know if such an object could be created without the explicit help of something like Ethereum.  Also, I am imagining if it could, it would need its own separate network running and verifying it via a Proof (of work?  of stake?) to make it secure.  Perhaps this network could be incentivized via free tickets?  The strength of the lottery layer would scale with the associated jackpot - as the jackpot went higher, more computers would compete to earn free tickets for the drawing.  
  
Do you guys think this idea is feasible, mathematically?  I believe I have proposed a decentralized lottery that would return all winnings to participants with no third party profiting.
Jump to: