On-Chain vs Off-Chain Betting Fairness: Get the Best of Both Worlds at BlockStamp Games
Recently we launched the Rooms feature at BlockStamp Games.
Be sure to check it out if you haven’t already! There, you can:
- Play with your friends. That goes for more traditional group-based games like poker — as well as roulette! You can bet with your friends on the same spin.
- Profit from what we call the “win-win house edge.” It’s more of a success fee that you can share in. As an admin, you can enjoy 50% revenue share with BlockStamp.
To make both of these features possible in Rooms (they’re not available in the classic games), we’ve taken a different technical approach to making the games in Rooms fair.
In this article we’re going to taking a closer look at this new approach.
We’ve taken the fairness off-chain in BlockStamp Games Rooms.
In other words, we’re taking the “provably fair” approach to pseudorandom number generation that you can find at other online betting platforms.
(Note that ALL betting platforms do not take this approach. Just some of the more forward-looking ones that are making an effort to be transparent and fair with their users.)
We won’t get too technical in this article. But if you’re interested in getting into the weeds on this topic, this article is a great place to start.
Here’s a quick summary of how off-chain provable fairness works in BlockStamp Games Rooms.
First, keep in mind that the technical result of your bet in a BlockStamp Games Room is based on a calculated number.
This is just like in the classic versions of BlockStamp Games. Depending on which game you’re playing, our interface translates that calculated number into a game-specific outcome.
For example, let’s say you spin the roulette wheel. Our software translates this calculated number into a roulette number the ball lands on.
Second, you should know how this calculated number is actually calculated.
There are several “ingredients” here:
- A server seed. We generate this on our end but keep it a secret until after the bet is complete and you know if you won or lost.
- The SHA256 hashing function. A hashing function (there are quite a few — we chose SHA256) takes data of any size and converts it into data in a uniform format. Remember the Babel Fish from the Hitchhiker’s Guide to the Galaxy? It’s kind of like that except for data instead of a human language and the outcome takes a specific format instead of your native language ;)
- A server seed hash. This is what we get when we run the server seed through the SHA256 hashing function. It’s not a secret before the bet.
- A client seed. We generate a unique one for you before each bet.
- A nonce. This is a one-time-use number we generate randomly for you before each bet. It’s purpose? Introduce randomness. Not to be confused with a ponce :)
So before the bet, here’s what is not a secret (to you).
- The client seed.
- The nonce.
- The server seed hash.
- The SHA256 hashing function. This exists all the time, independently of you or us or anything else!
When you play (e.g. spin the roulette wheel) we hash:
- The server seed — still a secret!
- The client seed.
- The nonce.
And voila — there you have the calculated number that is the basis for your result.
Important: after you know the result, the server seed is no longer a secret!
Third, consider how we could theoretically cheat.
If we (or any other online betting platform using this approach, for that matter) wanted to cheat, we would tamper with the server seed to throw off the result of your roulette spin.
This manipulated server seed would be different from the one that was actually used to arrive at the result you get.
Fourth, know how you can verify that we didn’t cheat.
After you know the result and the server seed is no longer a secret, it is pretty easy to verify that it is the same one we used throughout the entire process.
Remember that the server seed hash was never a secret.
So you can simply run the server seed (no longer a secret!) through the SHA256 hashing function and compare it to the expected server seed hash (never a secret!).
If they are the same — then no cheating took place.
So that’s how it works behind the scenes. And here are the two main reasons we like the off-chain fairness approach for BlockStamp Games Rooms.
BlockStamp Games Rooms run faster with off-chain fairness.
If you’ve played some of our classic games, you know that you have to wait for up to one minute to get your results.
That’s because your results depend on the BlockStamp blockchain, which has a block time of around 60 seconds.
Provably fair off-chain results come much quicker and make the games more enjoyable when playing in groups — which of course is the main point here :)
BlockStamp Games Rooms can turn a profit for admins with off-chain fairness.
One of the unique aspects of the classic games at BlockStamp Games is that the only way to profit from the games is to play them. In other words, there are no fees involved at all.
Because these classic games are totally on-chain, winning bets are paid out of “flashmined” BST and losing bets result in “flashburied” BST. No oversupply or undersupply of BST will occur because the entire system runs closed-loop on the BlockStamp blockchain with absolutely fair odds. The statistical odds of losses cancel out the statistical odds of payouts over the long term. Check out our previous articles here and here for more background.
By taking the fairness off-chain with the approach based on client and server seeds, we have made it possible for the wins and losses to be distributed more flexibly — which is good news for Room administrators :)
That means if you administer a Room, you get a 50% revenue share of the “win-win house edge” mentioned above. There is no traditional-style house edge baked into Rooms odds or games.
The total “win-win house edge” is 1% success fee of all winnings in a room, with half going to the Room admin and half going to the BlockStamp project to cover the costs of guaranteeing all Rooms wins.
Note that wins and losses are not “flashmined” or “flashburied” in Rooms. Instead, the BST are kept stored in cold storage as per a traditional crypto betting platform model.
That’s why you won’t find lotto in BlockStamp Games Room :) The totally fair odds of winning a massive payout in lotto with off-chain fairness make it simply too risky for us to guarantee winnings. We’ll let the BlockStamp blockchain handle that in our classic on-chain lotto!
In conclusion, at BlockStamp Games you can now place your bets off-chain or on-chain. How you profit is up to you!
Make sure you’re part of the BlockStamp social community and feel free to ask any questions there!
About BlockStamp:
BlockStamp is a Bitcoin blockchain fork hosting an ecosystem of fair play apps, including a true-odds multiplayer crypto gambling platform, a decentralized marketplace listing optimizer, and a private messenger with sword-in-the-stone encryption (launching soon).