Oracle

As we already learned, identical Ethereum smart contracts are executed on nodes worldwide. What we have not emphasized yet is that all these nodes take the same set of inputs and should yield the same outputs. This is called determinism. Ethereum relies on this determinism since, in order to verify the validity of smart contracts and transactions, mining nodes have to yield the same results while running the same code with the same inputs.

This determinism raises a challenge. On one side, Ethereum is a generic platform that can be used to transfer any digital or digitized assets. Its smart contracts require data or inputs from external sources such as the internet, for example, stock prices, macroeconomic or microeconomic indices, and so on. Without access to these sources of information, use cases for smart contracts will be restricted to only a tiny fraction of their potential. On the other side, even with a tiny time difference, nodes may retrieve different information from an external source. With different inputs, nodes will end up with different outputs. Consequently, the determinism property does not hold. As a result, smart contracts are not permitted to call an internet URL or directly pull data from an external source. To address the paradox, the concept of the oracle is implemented.

According to Merriam-Webster, one of the definitions of oracle is a shrine in which a deity reveals hidden knowledge or the divine purpose through such a person. In the blockchain world, an oracle refers to the third-party or decentralized data feed services that provide external data. Oracles provide interfaces from the real world to the digital world. Oracle data is not part of the blockchain. It is saved off-chain.

There are different types of oracle. Two of them are software oracles and hardware oracles:

  • Software oracles: Normally refer to easily accessible online information such as stock index close prices, FX rates, economic news or weather forecasts, and so on. Software oracles are useful since they provide smart contracts with wide varieties and up-to-date information.
  • Hardware oracles: Normally refers to scanned information such as UPS delivery scanning, registered mail scanning, or supplier goods delivery scanning. This feed can be useful to activate a smart contract that is triggered upon an event's occurrence.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset