1

Let's say I wanted to host a site in which

  • users create their own accounts
  • they deposit bitcoins in said accounts
  • a commission of, say, 0.05% is kept of all the bitcoins that are deposited in the site
  • users play a competitive game with each other (e.g. chess, or others for more players) for a bet
  • the winner gets the full bet
  • each user can withdraw their bitcoins any time they want

This, I figure, would be quite hard to get right due to all of the different aspects involved, such as user trust, security and technicalities.

My questions are:

  • How do current betting sites handle the deposits/withdrawals of bitcoins, and how do they keep a commission out of it?

  • Any small site could rely on trust and do this in a manual fashion, but I'd assume any professional site does not handle this manually. So, is there an existing library (I'll use Node.js, in case it matters) or third-party service for this? And should the bitcoins be stored in a conventional offline wallet(s)?

  • And last, is there a way to "prove" that the games are fair in order to establish trust? Are there any legal requirements regarding to this?

11
  • Obtaining the legal permits for operating a gambling site sounds more expensive than actually developing such a site. Jan 12, 2014 at 21:07
  • 1
    The whole idea is weird too. Sounds like an exercise in sandbagging. The stronger player will win on average, so games will only happen if one of the players is misinformed about the other player's strength. For many games cheating is possible (e.g. for chess, computers are much stronger than humans) which causes further difficulties. Jan 12, 2014 at 21:10
  • @CodesInChaos just like in betting games: twice the strength, double (or square) the payout. Think of it as probabilities. You could risk playing stronger players (say they could win you 75% of games) just to be paid more.
    – kaoD
    Jan 12, 2014 at 21:12
  • @kaoD That doesn't change the main issue: Players who don't try to misrepresent their strength will pay to players who do. It's a competition of who cheats hardest, not who plays best. Jan 12, 2014 at 21:21
  • 1
    @BabyPuncher I don't think it's that easy. In my country there are gambling regulations regardless of the medium of exchange. As long as it has value, it's taxable. A country might even forbid gambling in non-fiat to avoid tax evasion.
    – kaoD
    Jan 13, 2014 at 2:05

1 Answer 1

0

How do current betting sites handle the deposits/withdrawals of bitcoins, and how do they keep a comission out of it?

Just like any other payment: you track the blockchain and keep balances in your server database.

  • You can charge the commission on deposit (e.g. 0.5% fee, when depositing 10BTC just credit 9.95BTC)
  • You can charge per game (e.g. when each player bets 5BTC in a 2 player game = 10BTC, only pay the winner 4.95 from their rival) and keep 0.05 (0.5%).
  • In betting games you can also schew the long-term statistics against you so the house has an edge (just like casino roulettes have 0, and some even 00).

Any small site could rely on trust and do this in a manual fashion, but I'd assume any professional site does not handle this manually. So, is there an existing library (I'll use Node.js, in case it matters) or third-party service for this? And should the bitcoins be stored in a conventional offline wallet(s)?

This would work just like any other business, just browse this site. You can rely on external businesses to do this for you, or create the system yourself (leveraging libraries or not, you must listen to the blockchain events and act accordingly).

And last, is there a way to "prove" that the games are fair in order to establish trust?

If games are deterministic (like chess) the issue boils down to trust between users (is this guy going to cheat me using a chess engine?) since you couldn't influence the outcome anyways.

If games are based on chance, either the users must have faith in you or you have to provide a way for the user to verify you're not cheating him. How such a scheme could be implemented depends on the detailed mechanics of the game (you could even leverage Bitcoin's blockchain for this).

Are there any legal requirements regarding to this?

Dealing with the legal system is the hard part here. Just like any other legal matter... it depends on your jurisdiction! In my country you have to be audited before running a betting business.

4
  • Thank you very much for this thorough answer! Would tracking the blockchain and keeping the balances in the server database manually be too primitive? Considering I do not expect the site to become huge. The only downside to this I see is that there would be a delay between a deposit or a withdraw to be reflected as I would have to verify the transaction myself.
    – Robert
    Jan 13, 2014 at 5:58
  • @Robert there's nothing inherently wrong with that approach. The problem is there are hundreds of edge cases dealing with the blockchain (e.g. chain reorganizations) and a huge cost to run the payment infrastructure.
    – kaoD
    Jan 13, 2014 at 11:19
  • The way I've seen a lot of crypto-coin roulettes work is: they pre-generate the next pseudo-random selection of roulette, hash it, add a salt, then publish it BEFORE your bet. Once you place your bet and push the "Go" button, the pseudo-random number and the salt are revealed, so you can validate it against the published result. It'd be feasible, though computationally VERY expensive, for the virtual croupier to select a diff. number (to make you lose) then find a salt so that the published hash is the same, that's what creates a bit of trust.
    – Joe Pineda
    Jan 13, 2014 at 13:03
  • An example: dogespin.l8.lv/?r=dogecoin_roulette#provablyfair
    – Joe Pineda
    Jan 13, 2014 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.