11/15/2015 - BitLuck is deprecated and I've removed the public source for both security and licensing reasons. If you'd really like it for some reason, email me at [email protected]WARNING: A vulnerability has been pointed out by PhilG in this script and it should not be used. This was an example script I made when I was 15. Additionally, I don't remember anything about this and don't plan to fix it. Feel free to fork it and work on it if you'd like. I'm not even sure it works anymore.
I created a lottery script which automates the process of payments and payouts, and I thought I'd open-source it since I'm not using it anyway... if you like it, please think about donating to me, my donation address is in my signature.
I am posting in this forum, as that's where I posted my initial thread about BitLuck. Mods: feel free to move it.
Version 0.3 is hosted only on Github.
BitLuck on GithubYou can download v0.2
here.
If for some reason you still want v0.1, you can find it
here.
Changelog:
Version 0.2 - Added cost setting to waiting.html (used to be static 1 BTC.)
Version 0.1 - Initial Script
Requirements:
- PHP 5
- MySQLi for PHP
- cURL for PHP
- JSON for PHP
Installation instructions:
1. Create a database on your MySQL server and run lottery.sql on it.
2. Run "bitcoind" with either the -rpcuser and -rpcpass options, or with them specified in your bitcoin.conf
3. Type at the command prompt, to generate the lottery pool account (you don't need to do anything with the output): bitcoind getaccountaddress "Lottery Pool"
3. Edit config.inc.php, and update the $rpc_* variables to match your RCP server settings, the $sql_* variables to match your MySQL server settings, the owner's key, fee, draw time, and ticket cost.
4. Move give_prize.php outside of the webroot.
5. Setup cron, or a similar service to run give_prize.php at the time you wish the prize to be drawn.
6.
7. Profit!
Let me know how it goes, and if there are any bugs, I'll attempt to fix them. As this isn't an ongoing project, I'm not using Git or another source versioning system as there shouldn't be too many changes, only bug fixes.
DISCLAIMER: I offer no warranty, and if anything goes wrong, it's not my fault. Please also note that this is NOT an example of my
best work, rather a quick thing I hacked together in an hour or two when learning about the Bitcoin API.
I hope this helps someone. If you'd like to send a donation for my efforts, please use this address:
1B7aTxrcaEVopuqrqidTQMxE9mpDUZRwAb