Please describe your proposed solution.
The Open Source Cardano Lottery is a smart contract lottery built using plutus for the Cardano Blockchain. It is a non-custodial lottery where all interactions with the lottery are done directly with the smart contracts and do not require any 3rd party to manage and hold any lottery funds. Equally important is that the lotto administrator only has the ability to run the lottery and does not have access to the jackpot or treasury to prevent any unauthorized access.
The motivation for creating a blockchain lottery is to help provide fundraising alternatives for Green and Social Good Cardano blockchain projects. The reason for making this an open source project is that everyone can see the code and provide feedback, comments, suggestions and contributions which will make it a secure and trustworthy blockchain lottery.
Completed Items (0.1.0 Beta Release on May 6, 2022)
- Working state machine code
- Logic splitting between 2 validators by using thread tokens for communication
- PAB created from bash shell scripts
- Performance enhancements to fit the plutus code within the max 16KB TX size limits
- Documentation and video tutorials
Current Positive Impact as of Jun 10th, 2022
- 1000+ Github pageviews
- 150+ Unique visitors
- 150+ clones, 30+ unique clones
- 8 stars
- 4 forks
Lottery Design
- When a player purchases a lotto ticket, they will receive a lottery token with the token name being the hash of the number they have selected
- After the required amount of tickets have been purchased*, the lotto admin closes the lottery so no more lottery tickets can be purchased
- The players then reveal their numbers which is used to seed the random number generator
- When ½ of the purchased tickets** have been revealed, the lotto admin can then draw the winning numbers. The random winning number uses both the previous transaction id and the sum total of the revealed numbers as inputs.
- To claim a winning ticket, a player will then redeem their token which is a hash of the winning number
- 50% of jackpot rewards will go to the winner (less taxes and government fees) and the remaining jackpot will go to the sponsor (eg. the Cardano Green or Cardano Social Good Project)
- For every ticket purchased (configurable)
- X % goes to the sponsor
- Y % goes to the current lottery cycle jackpot
- Z % goes to the lottery treasury
- The lottery contract staking rewards goes to the lotto admin
* The number of tickets that need to be purchased must be an amount that is greater than the total value locked into the lotto smart contract. This is to disincentivize the lotto admin from purchasing all the tickets in a lottery cycle which they could then use to predict the winning number in advance.
** We need to ensure there is sufficient entropy for the random number generator by requiring ½ of all tickets purchased in a current lottery cycle to be revealed. This will also prevent the lotto admin from drawing the winning numbers with only a small number of revealed numbers which he could then use to predict the winning number in advance.
Please describe how your proposed solution will address the Challenge that you have submitted it in.
The Open Source Cardano Lottery uses a novel approach to lotteries making it entirely decentralized by only using blockchain smart contract interactions. This trustless model does not require “trusting” the lotto admin (or a 3rd party Oracle) to run and operate the lottery. The Open Source Cardano Lottery also contributes to the Cardano open source community and helps increase developer adoption, which is one of the strategic objectives of Fund 9.
What are the main risks that could prevent you from delivering the project successfully and please explain how you will mitigate each risk?
- Technical Risks
- Exceeding Plutus Script size limits
- Mitigation: Leverage Plutus V2 and CIP-33 (Reference scripts)
- Vulnerabilities / Loss of funds
- Mitigation: Engage with the developer community to review the open source code and obtain feedback from the beta releases
- Legal and Regulatory Risks
- Mitigation: A production launch of a Cardano blockchain lottery will require a separate legal entity with a gaming license in an appropriate jurisdiction