3 ms·
An actual casino without the need for a central authority can be implemented on smart contracts, and is the only real application of smart contracts that I see
by SuchAnonMuchWow 5y ago
An actual casino without the need for a central authority can be implemented on smart contracts, and is the only real application of smart contracts that I see that is better than a centralized solution.
- mypastself 5y agoAs far as I understand it, producing entropy, which is needed for fair distribution of odds in games of chance, is not achievable directly on the blockchain. Instead, the job of producing non-deterministic inputs is offloaded to an off-chain source, an oracle, which still requires some degree of trust in an external entity. My information might be out of date, though, and some implementations might have resolved this issue without destroying the integrity of the entire system. And I will concede that gambling seems to be the most popular use of the tech so far.
- SuchAnonMuchWow 5y agoYou can just make the participants of a bet provide each a random number, and xor their results. If even one of them picked a real random number, the result will be random. This is the basis of most distributed random number selection algorithm, which existed since a lot before blockchains. In a smart contract, it could look like something like that: 1- each person which want to participate in the bet pick a random number, then send: their bet (0 or 1), the hash of the random number, and of course money to bet. 2- after some specified time, the first phase finish and no new person can bet. now everyone has to send their actual random number to the smart contract 3- after some specified time again, every random number gathered which had the correct hash are xored. If the popcount of the result is even, 0 win. otherwise 1 win. Everyone who send their random number and guessed correctly get a share of the total amount. edit: note that I'm not overly familiar with smart contracts, so if this cannot work I would love to be explained why.
- hiq 5y agoWith your scheme, on Ethereum at least, miners have an advantage since they choose which transactions to include in a block they mine. So a miner would only process the random numbers sent in 2. if it results in a win for them. Of course there is more than one miner etc., but having a positive expected outcome is enough to be worth it to play.