I'm reading through the accepted answer to this question on securely creating random numbers for multiplayer blockchain-based casino games. I don't understand the reason for step 4: "Users send their hash to the contract, along with ether greater than or equal in value to the value of the random number."
Why should the amount they send have to be greater than or equal to the value of their random number?
Is there anything wrong with each player simply sending in their "bet" (i.e. the amount they choose to gamble), and forfeiting it if they refuse to reveal their N? The amount they gamble can serve as their security deposit: they simply drop out of the game and stand no chance of winning the jackpot (consisting of the sum total of all players' bets) if they don't reveal their N.
N, then they also leak some information about whichNthey chose, namely that it is less than the amount of ether they sent. So if there were a rule "send an amount of ether greater than your random number" why wouldn't they always send the max value ofNto avoid leaking any information? Or better yet, as I'm suggesting, why don't they just send the amount of ether that they want to bet on the game, an amount that is completely 100% independent of theNthey choose? – jcarpenter2 Apr 18 '18 at 02:35" This is where the trade-offs come in. The last person to reveal their N has a choice whether to reveal or to not reveal. This essentially gives them a double chance at winning. Enter enough times, and you get a new choice for each entry. Hint: Miners chose the order of transactions in a block. In order to discourage this, users must put up a large security deposit, equal to the value they would gain by manipulating the random number. This could be a problem for many users, especially for large jackpots, even with game-theoretic optimizations."
– AnAllergyToAnalogy Apr 18 '18 at 02:49Nthat they choose. And again, unless they simply bet the max possible value ofN, they actually do leak some information about their random number. – jcarpenter2 Apr 18 '18 at 03:17Nis your contribution to the random seed, and has no connection with your probability of winning (except by ensuring a truly random PRNG seed). – jcarpenter2 Apr 18 '18 at 03:27