What's needed to host a competitive game site

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?

Robert

Posted 2014-01-12T20:06:04.310

Reputation: 13

Obtaining the legal permits for operating a gambling site sounds more expensive than actually developing such a site. – CodesInChaos – 2014-01-12T21:07:46.310

1The 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. – CodesInChaos – 2014-01-12T21:10:11.210

@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 – 2014-01-12T21:12:46.633

@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. – CodesInChaos – 2014-01-12T21:21:28.210

@CodesInChaos what do you mean? To misrepresent your strength you have to lose games, i.e. pay. If it can be balanced out (which you might be suggesting it can't?) the optimal strategy is to play players near your level and play legitimately. – kaoD – 2014-01-12T21:31:24.870

@CodesInChaos Regarding obtaining legal permits for operating a gambling site, as far as I know you don't need any permits. Bitcoin is not a FIAT money, there are no gambling regulations on it what so ever, thus no gambling license is required (assuming the site doesn't accept FIAT money). – User2344452 – 2014-01-12T23:10:42.673

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 – 2014-01-13T02:05:13.503

I guess it could work as long as users are forced to go thru a series of matches vs. computer to assess their strength, you use a kind of handicap, either monetary (so a pro vs. a noobie has the noobie risking more) or as is done in shogi (Japanese chess) where the stronger player has some of their pieces removed. Of course, strength assessment should be updated after each game (a la Yahoo Games) and the initial assessment process must be long and tedious enough to disuade creating sock puppets for easy wins. – Joe Pineda – 2014-01-13T05:51:45.707

I only used chess as an example. But yes, it's not a trivial task to assess the players' ability to make it fair play. The whole point of making it a competitive game is to disassociate the site from making payments (and thus, risk) and only take a comission. @JoePineda that's a good idea. Matching players with a similar percentage of "won" games could be an alternative (faking that would imply having risked money and so, it'd naturally disuade malicious users to do it). – Robert – 2014-01-13T06:12:49.733

Aditionally, the "mechanics" of the game would have to be NP-hard (such as Tetris') so that there is no shortcut or smart algorithm that will solve them swiftly. Making it impossible to cheat. – Robert – 2014-01-13T06:18:05.957

The other idea just struck me is hosting a site to play a virtual version of a trading card game, like Yugi-oh or Magic-the-Gathering. Either you get a license for those or you design your own cards, with a game-play similar to those. You could then let the players play for free, charging a small fee for users exchanging cards or sell them directly some new ones your designers have created. In these games there's a lot of random (easier for newbies), and if you're willing to pay enough you can get powerful cards. – Joe Pineda – 2014-01-13T12:54:18.390

Answers

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.

kaoD

Posted 2014-01-12T20:06:04.310

Reputation: 978

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 – 2014-01-13T05:58:15.950

@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 – 2014-01-13T11:19:25.640

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 – 2014-01-13T13:03:40.177

An example: http://dogespin.l8.lv/?r=dogecoin_roulette#provablyfair

– Joe Pineda – 2014-01-13T13:03:56.867