4 ms·
> 5. The "Smart Contract" code is completely trapped within the Eth system. I can't query a website and check data from there, nor can I generate random numbers
by croddin 10y ago
> 5. The "Smart Contract" code is completely trapped within the Eth system. I can't query a website and check data from there, nor can I generate random numbers, nor can I do anything that isn't explicitly on the blockchain. That directly implies that gambling apps and similar are completely deterministic and knowable. Effectively, gambling on Eth isn't a random chance with an edge to the house; it's a mathematical guarantee that the house wins, and you lose.
Wouldn't the proof of work hashes be a good distributed source of entropy?
- kefka 10y agoPossibly, but I can have my client delay-submit successful work as to game the system. And when Ethereum switches to Proof-of-Stake, bad shit will happen. (Mainly, its when you wager eth coin on the fact you have a correct-work. Its not hard to see the badness from that...).
- bryondowd 10y agoNot an expert, and this is limited in what you could use it for, but for gambling purposes, couldn't this be dealt with by using the next X hashes after the bet is placed, where X is a large enough number that the likelihood of the better being able to produce that many successful blocks in advance is nil. So, at the simplest, you take a bet, and then use the next two hashes for your random seed to get a result. Even if a miner found a solution for the next hash and withheld it long enough to make a bet, he wouldn't have enough information to do better than random chance. And as I understand it, the entire blockchain relies on the fact that one miner shouldn't be able to generate two blocks faster than the rest of the mining pool. Increasing from two grants even greater certainty. Of course, the trade off here is that you have to wait for X blocks to be generated after a random number is requested and before being able to use it. So, your gambler has to sit around a bit to find out if they win, rather than instant feedback. (Of course, for gambling, you can hide this with some pretty animations of a roulette wheel, dice, horses running, etc.)
- mhluongo 10y agoI believe that's open to tampering by miners (more easily than a sybil attack, IIRC).
- DennisP 10y agoYes, and there are gambling apps that use the block hashes. Miners have the option of throwing away blocks they don't like, but are likely to lose the block reward if they throw away a valid block hoping to find a better one. So as long as it's not a huge payoff, it works fine.