Some explanation about Oracles from our architect Andrey Zamovsky

Inchain
2 min readSep 7, 2016

--

As most of you understand, there is no way for smart contract to fetch any information from outside of the blockchain where it operates. This limitation has been introduced intentionally, and let me explain why. Since every node executes every line of every smart contract, and anyone can submit any smart contract, the entire blockchain network can easily become a weapon of DDoS attack as soon as it allows interaction of smart contracts with external resources.

It is a problem because the code that handles insurance events should be triggered by an events in real world. The solution to this problem is called “Oracle”.

Oracle is a smart contract that contains information about the state of “external reality” (e.g. non-blockchain events).

There are 2 approaches to fill oracle with the information:
Using crowdsourced approach, where any participant of the network can submit the data and get some reward for doing that. (see “Prediction markets”)
Associate the oracle contract with some trusted party, by delegating private key to that party (can be several participants for backup purposes).

The first approach is more favorable by community, however decentralized prediction market is a very complex system by itself and they are currently at the early stages of testing.

The second is more similar to how SSL certificates work: as soon as the originator of the data have announced his public key, anyone can verify the validity of the submitted data.

For example if we wanted to set up an oracle that would report earthquakes (http://earthquake.usgs.gov/earthquakes/feed/), we would:
assign a keypair to http://earthquake.usgs.gov/
Ask USGS to publish their public key (ethereum address) on their website
Set up a special module on the backend that will be submitting every new item of the feed to the smart contract.

We believe that the second approach will still do the job and much easier to start with, so we are planning to go ahead with it.

--

--