Blockchain are inherently public anyone can read transactions but this can be worrysome for decisons that depend upon simultaneous interaction between two parties. This problem is similar to two generals problem or fair exchange between two parties without trusted third party.
Here we are taking example of a simple game i.e Rock, Paper, Scissors. Where both parties have to give one answer (Along with staking some money) but it should simultaneus which is impossible. As one can read other's interaction and so the game can become unfair.
So we first take their answer and a truly random number hash them and put the hash on chain. Now they can't see each other's answer and can't cheat. Later we tell they send original data to verify hash. So if both send data the game will be fair. If one doesn't he'll be penalized (his staked amount will be given to other user) if he does this three times. This was done considering that people have other real world engagements too or other technical issuses.
Tracks Applied (4)
Polygon
Polygon
Filecoin
Replit
Technologies used
Discussion