Security Tokens and Stablecoins Quick Start Guide
上QQ阅读APP看书,第一时间看更新

Oracle

Ethereum smart contracts are executed on nodes worldwide. To yield the same outcomes, nodes have to take the same set of inputs. This is called determinism. Ethereum relies on the determinism property validating smart contract outputs. That is, validating nodes have to yield the same results while running the same code. In this sense, the determinism property plays a key role in enabling nodes reaching a consensus.

Maintaining determinism can be a challenging task. On the one side, Ethereum is a general-purpose platform. Its smart contracts require data or inputs from external sources such as the internet. Without access to these sources of information, use cases for smart contracts will be restrictive. On the other side, even with a tiny time difference, validating 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. For avoiding the issue, smart contracts are not permitted to call an internet URL or pull data from an external source directly. To resolve the paradox, Ethereum relies on Oracle.

A definition of Oracle is as follows:

" A shrine in which a deity reveals hidden knowledge or the divine purpose through such a person."
                                                                                                              – Merriam-Webster

In blockchain, oracle refers to the third-party or decentralized data feed services that provide external data. Oracle provides interfaces from the real world to the digital world. Oracle data is not part of blockchain and is available off-chain.

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

  • Software oracles: This normally refers to easily accessible online information such as stock index prices, FX rates, economic news, weather forecasts, and so on. Software oracles are useful since they provide smart contracts with a wide range of information and up-to-date data.
  • Hardware oracles: This normally refers to scanned information such as UPS delivery scanning, registered mail scanning, supplier goods delivery scanning, and so on. This feed can be useful to activate a smart contract acting on an event's occurrence.