3 ms·
By having the users themselves provide the random input. For example there could be a two player game where each person provides a number and if the sum of thos
by charcircuit 6y ago
By having the users themselves provide the random input. For example there could be a two player game where each person provides a number and if the sum of those numbers is even player 1 wins and if it's odd player 2 wins. To prevent the second person who submits a number from cheating, both players instead commit to their number by first sending a hash of it. Once both people have submitted their hash, then they both reveal the number they committed to and those get added together. If you fail to reveal your number within a reasonable amount of time, then you lose.