1

Let's say I'm designing a multiplayer game, where players can fight each other in different battles. As a result of each battle, players get a punctuation. Suppose I'm using a sidechain. Which should be the a property way to decentralize the game?

a) battles are computed in servers, and only the final punctuation for each player is stored in the smart contract of the sidechain

b) battles are computed in smart contracts, and all the other change in parameters of the game are computed also in smart contracts (in sidechain)

Finally, following plasma protocol, I persist compressed data to the ethereum mainnet with some regularity...

2

I'll go with a) battles are computed in servers and only the final results are stored in the smart contract. ;-)

Use the smart contract to record the facts that must be beyond repute. This will distill down to something like:

The authoritative server (Oracle) declared Alice beat Bob in match number n by a score of x to y resulting in Alice gaining something (such as points or funds held in escrow).

You may want to extend the contract's reach into gameplay itself, for example to create a provably fair betting game. "Battles" sounds compute-intense which is not well-suited to confirmation in the style of a blockchain. It also sounds somewhat subjective. For these reasons, I would incline to leave gameplay to a server cluster.

Extending this idea a little further, facts that must be beyond repute includes spendable tokens that players might be able to take with them, i.e. leave the game and spend elsewhere. This is not possible with a private chain, but it will work on mainnet. If tokenizing winnings is not the goal, you may find adding blockchain to your scorekeeping process complicates matters considerably for no worthwhile purpose.

Hope it helps.

  • Thanks for your response Rob. I understand what you say, battles could be too expensive to be computed on blockchain, but the solution with the server working as an authority which decides who is winning and who is losing, is something like an hybrid between centralization and decentralization. The fact is that, as you say in the last part of your comment, this battles affect the player punctuation, and so they can earn more or less tokens (which can be withdraw to the main blockchain). So I suppose I have to compromise the decentralization in order to allow compute-intense gaming. – Federico Caccia Oct 10 '18 at 3:42
1

I try to add a general consideration: when is it useful to write in blockchain and when is it useful to solve locally on the off chain server?

The answer is simple: every time the results of your elaboration has a significant economic value that could be possibly reverted and/or nullified or damaged by someone’s action in the future, you should definitively use blockchain.

The same if they should be the starting point for further high value elaboration in the future.

On the contrary, if your transaction is closed here and now, cannot be reverted or nullified or damaged by nature, you can still evaluate to use blockchain in the case you could need to maintain some track of the process to be checked in the future for any true reason.

If not, go off chain immediately.

In the case of your game, if you summarize the effects of all the game actions in the final result and the true economic value of the single action is negligible, you can go off chain.

On the other hand if the value of the game results could be huge, it can be useful to being able to show them all the single actions which bring the game to the result in order to nullify eventual claims.

So it is something that must be evaluated for the single case, does not exist any yes/no automatic rule!

This apply to the data you could plan to compress and send to blockchain, of course.

  • Thanks for your response Rick. Like you said, in this case, the value of the game results could be huge, since players can earn tokens when they win battles. So, computing them off chain, could create malicious combinations between players and servers. I don't know if we can call decentralized that kind of solution. – Federico Caccia Oct 10 '18 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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