I have written a Bitcoin gambling site and am planning on the best approach to host it/manage it securely. The site is implemented in Java using the BitcoinJ API and servlets etc are handled via the Play framework.
Here is an overview of what the site does at high level:
- Communicates to a datastore where "receive/return addresses" inputed by user are stored.
- Creates a unique receive address for the user (also stores this).
- Stores the answers chosen by user.
- Checks for verified transactions and updates datastore with this info.
Finally, when the app has a return address to send winnings to and confirmed verified and confirmed winner, the winnings are sent out.
I am thinking about how to best host this application. Would the best way be to proceed to purchase a dedicated server and run the whole app on there? Are there better/more secure ways that this can be done (also cheaper methods i.e. shared hosting?).
Thanks for your help!
EDIT Potential alternative option:
- Lightweight app on web which communicates directly to a database.
- Database holds a big list of readily created "receive addresses" by a wallet held off server.
- Off server process runs on my PC continuously checking the database for "work".
This approach is probably a lot safer and would also remove the need for a dedicated server. The downsides would be having to run a PC 24-7 at home which constantly checks for work. The off server process would create more addresses when needed and add them to the database (remotely). It would also send out bitcoins to winners and transfer the bulk of BTC to an offline wallet.