Hacker News new | ask | show | jobs
by ranguna 1295 days ago
I'm currently working on a multiplayer game and I really really wanted to do this, but even if it works in principal, it fails in practice.

On step 3, this exchange does not happen exactly at the same time. If I'm playing with someone and we reach step 3, I could intentionaly hold myself from sending my data over, wait for the other player to send their data, and if their data wins against my (unsent) data, then I can simply choose not to send my data over (abort), forcing a tie.

This is easy enough to detect and you could just ban people that do this repetidly, but these people would just create new accounts whenever they get banned.

Hence, a cheater can either force a tie or win.

If you go down the rabbit whole on how you could theoricaly do this exchange fairly, you'll discover that this is provably impossible if you do not control the computational power of all parties (if you did, you could employ a time-locked puzzle with proof of work, for example).

This is known as a fair exchange with a fail-stop or secure-with-abort model.

See: http://www.cs.utexas.edu/~shmat/courses/cs395t_fall04/pagnia...

https://crypto.stackexchange.com/a/25458

https://crypto.stackexchange.com/a/26624

https://crypto.stackexchange.com/questions/8333/is-there-a-w...

http://www.iacr.org/archive/eurocrypt2010/66320221/66320221....

2 comments

Good point. Honestly, I think that it won't happen often. Who would wan't to sacrifice all fun to have bunch of blocked accounts with a few wins?
It could potentially happen all the time if your game is played with high stakes. But yeah, for you average casual game it's a non issue.
Hmm, "exchange is at least as hard as consensus". Guess you need to run your game on a blockchain? :)
Yeah blockchain could work as a trustable 3rd party impossible to manipulate. Although I'm not sure there's any blockchain out there capable of handling realtime games, but can work for other types of games for sure.