1

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.

jcarpenter2
  • 141
  • 4

1 Answers1

1

Because the number needs to be hidden from other players. If the amount they sent in was equal to their number, then anyone could just read the transactions and take advantage of that fact.

AnAllergyToAnalogy
  • 3,553
  • 11
  • 23
  • That's obvious. As an extension of that logic, if they send an amount less than the max value of N, then they also leak some information about which N they 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 of N to 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 the N they choose? – jcarpenter2 Apr 18 '18 at 02:35
  • In the notes of the orignial answer:

    " 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:49
  • Yes, I don't understand that part at all. :) I'm confused, - I don't understand the need to put in an additional security deposit beyond your bet. If the jackpot only consists of the players' bets, their very bet already meets the answer's "users must put up a large security deposit, equal to the value they would gain by manipulating the random number" criterion, in a fair game, doesn't it? – jcarpenter2 Apr 18 '18 at 02:59
  • Because if you could pay any amount, then presumably you'd just pay as close to 0 as allowed, then bet 100000's of times (once for each number), and you'd be gauranteed to have picked the winning number as one of them – AnAllergyToAnalogy Apr 18 '18 at 03:04
  • I still don't understand. Let's put this into the context of a dumb lottery game. The rules are: 1) Players can place bets over a certain time period (say 1 day). The jackpot is the sum of all bets - no more, no less. 2) At the end of the betting time period, a winner is chosen. The probability that you are the winner is (your bet amount) / (jackpot). There's nothing to be gained there from betting lots of times separately. Similarly in a game of poker, there's nothing to be gained statistically by playing many hands at once. – jcarpenter2 Apr 18 '18 at 03:13
  • If it were like the State Lottery though, with a large fixed jackpot and cheap tickets, THEN you would have something to gain by buying many tickets, but even in that case I don't see the benefit over charging a fixed price for each ticket based on the probability that it's a winning ticket exactly like they do at the state lottery, of making each player bet an amount that's larger than the random N that they choose. And again, unless they simply bet the max possible value of N, they actually do leak some information about their random number. – jcarpenter2 Apr 18 '18 at 03:17
  • To clarify, in your system, does it cost all players the same amount to bet any number, or is the amount they bet increased relative to the number they pick? – AnAllergyToAnalogy Apr 18 '18 at 03:18
  • In my system, all tickets cost the same amount and are identical. The number N is 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
  • This may be a question for https://math.stackexchange.com/ – AnAllergyToAnalogy Apr 18 '18 at 03:31
  • (When I said "in a game of poker...playing many hands at once", that would actually mean "having a team of people, each playing one hand"... To have knowledge about more than 1 hand at a time in a game of Poker would give you an advantage. This raises some interesting questions about whether and how it is feasible to create a multiplayer online poker game for real money... if you could join 2 seats at once around the same table, you would have a real advantage...) – jcarpenter2 Apr 18 '18 at 03:44
  • i believe that's why in poker you always burn cards and also have the blinds. but im not a gambler... – AnAllergyToAnalogy Apr 18 '18 at 03:54