4 ms·
The explanation of all the opcodes for the contact script does not list any IO operations for external (non-storage) data (at least none that I could see). Howe
by terhechte 13y ago
The explanation of all the opcodes for the contact script does not list any IO operations for external (non-storage) data (at least none that I could see). However, in the list of Ethereum examples, the following is given:
"Crop insurance. One can easily make a financial derivatives contract but using a data feed of the weather instead of any price index. If a farmer in Iowa purchases a derivative that pays out inversely based on the precipitation in Iowa, then if there is a drought, the farmer will automatically receive money and if there is enough rain the farmer will be happy because their crops would do well."
Does somebody know how the contract would be able to read a data feed? I did not find anything in the language spec. Such a feature would be really interesting. On the one hand it would allow for a ton of interesting options (binding contracts to stock markets, emails, political events) on the other hand how would a contract behave if the required data url is gone (i.e. the weather data feed changed from weather.php?v1 to /v1/weather). Whats more, wouldn't there be strong incentives for man in the middle attacks to deliver wrong data? This sounds like a very powerful yet dangerous feature, so I'd love to learn more about the spec and reasoning behind this.
- bertil 13y ago> binding contracts to stock markets, emails, political events) on the other hand how would a contract behave if the required data url is gone (i.e. the weather data feed changed from weather.php?v1 to /v1/weather Butekin’s answer to that appears to be that providing the information at the right format should also be an Ethereum contract: users (both participants of your option) would enter another secondary contract with a weather service and pay a small sum is the information is properly available. > wouldn't there be strong incentives for man in the middle attacks to deliver wrong data? Yes, but I’m guessing not more than now… Ethereum offers to automate and lower the cost of such contracts, i.e. replace back-ends. You can imagine testing services remain active on both sides, checking from a distinct source that payments match; that is already what is in place, it’s just a fairly boring activity at the moment.
- terhechte 13y agoThanks! So by that you mean the weather service would be a contract / company that would encode the current weather into the blockchain with a transaction? So effectively a server-sided solution that would use the blockchain as the data endpoint so that other contracts can access the data?
- mquandalle 13y agoThere will be no IO function like `http_get_content` because we can't securely rely on them. Instead the method will be to rely on a trusted entity (or a group of trusted entities) to sign an ethereum transaction containing some data that will be used by the contract. For instance you could take a look at Reality Keys, a "trusted data feeds" platform [1]. If you want to reduce the need to trust a single party you can also use a SchellingCoin system, described as a "decentralized data feed" in the ethereum white paper v2 [2]. [1] http://forum.ethereum.org/discussion/comment/180/#Comment_180 http://forum.ethereum.org/discussion/comment/180/#Comment_18... [2] http://blog.ethereum.org/2014/03/28/schellingcoin-a-minimal-trust-universal-data-feed/ http://blog.ethereum.org/2014/03/28/schellingcoin-a-minimal-...
- terhechte 13y agoThanks, that totally makes sense.
- nullc 13y agoYou cannot do external IO in a consensus system. (This is one reason why I think a lot of fancy contracts are best done using a quorum of external oracles, since you have no better security than that in anything that does external IO, and it's much more scalable (and works great in Bitcoin already))
- jaibot 13y ago"Quorum contracts" could also be a thing - contracts that exist solely to aggregate data from multiple sources, so you don't have to request data from each source every time you want to check something.
- nwh 13y agoHow do you verify that the information is correct independently?
- iambot 13y agosee @mquandalle's reply re schelling coins, blog post by @vbuterin here: http://blog.ethereum.org/2014/03/28/schellingcoin-a-minimal-trust-universal-data-feed/ http://blog.ethereum.org/2014/03/28/schellingcoin-a-minimal-...
- jamespitts 13y agoFor cases like this, a trusted, external system would post data into the contract.