r/ethereum•
ineptech

Newbie question - how does ethereum code access outside resources?

I have read and (hopefully) understood the whitepaper and a few other sources, but I don't get how external resources are accessed. Like, there are numerous examples in the whitepaper of derivatives contracts, and hedging and so forth. If I wanted to make a contract that offers hedging by promising for a price of P to pay out O if the price of a stock is less than X on date D, it would also have to specify the method to be used in finding out that stock's price, presumably by calling some API, right?

Here's what I don't understand:

a) Wouldn't this result in every Ethereum miner on earth hitting that API more or less simultaneously on the day the contract ends, in order to determine whether or not it pays out? This is obviously problematic for whoever runs the API, whether its the person who wrote the contract or some other third party.

b) Is it therefore impossible for Ethereum contracts to sell access to information? Like, if I have some info that I think is valuable, let's say I've installed a digital rain gauge on my roof and I want to make a contract that says "Pay me P ether and I will send you the rainfall in inches for the previous month." Well, the code for the contract is by definition public, including whatever API I use to look up the rainfall, which means anyone who wants it could simply access the API directly and not pay me, right?

Thanks in advance!

Posted Jul 31, 2015, 11:34 PM UTC

109
Loading comments…