4 ms·
In code we trust, and code is law. The good thing smart contracts are inspectable, so there is at least the open source aspect to help mitigate concerns.
by kerng 6y ago
In code we trust, and code is law.
The good thing smart contracts are inspectable, so there is at least the open source aspect to help mitigate concerns.
- Jasper_ 6y agoHow do you perform validatable RNG in a smart contract, without an untrustable oracle service? The problem with smart contracts is that they can't deal with outside interfaces. The only gambling smart contract I'm aware of is the Mayweather/McGregor one, which broke because the API they used to report the win changed from reporting 'w' for win and 'l' for loss to 'W' for win and 'L' for loss, and nobody could update it. Thankfully the author was trustable, after all, and put a refund method in it, otherwise it that money would have been gone forever. [0] So, the use cases have been tried and they've all failed. [0] https://www.removeddit.com/r/ethtrader/comments/6w5wcn/important_update_mayweathermcgregor_smart_contract/ https://www.removeddit.com/r/ethtrader/comments/6w5wcn/impor...
- charcircuit 6y agoBy 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.
- this_user 6y ago> In code we trust, and code is law. Which means any and all bugs or exploits are also law. And we know for certain that there will be bugs and exploits, which is why smart contracts are such an exceedingly daft idea.
- charcircuit 6y agoThis is why contracts implement functionality so they can be paused or even upgraded. There are other things you can do to mitigate risk like adding tests, using static analyzers, having the code be audited, following best practices, etc.
- kerng 6y agoOn the bright side it might help get industry to more responsible software engineering practices again, rather then move fast and break things and have the users be the guinea pigs.