The more I brainstorm blockchain game ideas the more I realize that this is the crux: A decentralized random number generator whose results are secret until the end of the game.
Imagine you want to play decentralized poker online. Do you want to trust the host of the game or do you want a provably fair game with no middle man? Obviously, decentralization demands that no one is a trusted party. Trust is transferred to smart-contracts.
This means there must be a way to randomly generate results. This by itself is easy; simply hash the next block on the blockchain. As long as you can trust the entity that created the block you're good.
However, keeping the random numbers a secret until the end of the game is another matter entirely. Back to the poker example, if you know which block was used to create the random numbers, you'll know what cards are in your hand, but you'll also know which cards are in everyone else's hands. In fact, you'd know the order of the entire deck. How do we stop this from happening?
I was talking to another developer about this. We thought maybe the answer is to be found in Monero privacy technology. If you use ring signatures (actually it's called a key shard) on each card, every player would have a piece of the key for every card. Therefore, you'd only know what a card was if you had ALL the keys. The client of the game would only share the keys when appropriate. This could work.
Other examples
What if I wanted to create a game that had fog of war? Fog of war means you can't see the whole map. It is the opposite of transparent. Again, you'd need a special privacy technology to implement this dynamic in a blockchain game.
In fact, when you think about it, any information that you want to keep secret from any player would require this kind of tech. This could will end up being a big deal in the future.
Cheating
The privacy aspects of the game would not be lifted until the game was over. This means anyone could cheat during the game and no one would know it until the end. I could claim I did 100 damage to you when my random number generator told me I did 50.
I don't think this would be that big of a problem, because obviously if you cheat it counts as an auto loss and a huge reputation burn, but it is something to think about. What if there was a bug that made it look like someone was cheating when they weren't? This would be bad :(
Patent Trolls
This is the only technology I can think of that I would be super annoyed if someone tried to patent it. A patent like this could make someone a billionaire if it was found to be the only viable way to create random numbers in a decentralized manner. Therefore, all game companies would have to pay an arm and a leg in order to even enter the space. This would be a huge stifle to innovation.
I have made the claim in the past that patents are irrelevant in a truly decentralized construct. For example, if I break patent law with a decentralized app, I can't really get sued unless I make money off of it. One can legally develop any software, using/selling it is another story.
Hopefully, the details of such an important technology do not meet the strict requirements of the patent office. Sometimes I wonder if it's even possible to patent any kind of truly decentralized technology. You certainly can't patent the blockchain. Being open source is what gives a decentralized app credibility in the first place.
Conclusion
As I forge ahead with my JavaScript studies these are the things I remain mindful of. Be on the lookout for technology like this. Not only can it legitimize decentralized gaming, but it can also legitimize privacy technology. When someone makes the claim that privacy is only used for criminal activity we'll all be able to point to projects like this and be like, "really?" Privacy is important. The benefits far outweigh the cost.
Return from Private RNG Is The Key To Blockchain Gaming to edicted's Web3 Blog