What is Neo3’s built-in Oracle and how does it work?

NeoLine
4 min readDec 18, 2020

This article is written from the users’ perspective. It involves less technical terms and may be inappropriate in some descriptions. If you find an incorrect description, please leave a message on the official account.

Oracle: Many people who hear it the first time may think it is used to predict the market or maybe something relates to Oracle company and Oracle database. In fact, it has nothing to do with the above relationship.

The word originally comes from ancient Greek religion, meaning “prophets, prophecies”. People did not have enough knowledge and experience to make precise decisions in ancient times, so they resorted to the message from mythology to understand phenomenon beyond their knowledge. In the computer field, Oracle is an abstract computer. It can solve problems that the Turing machine cannot solve through calculation, such as getting solutions from the external data.

The detailed explanation is: The main function of Oracle is to sign information into the blockchain to complete the data exchange between the blockchain and the external environment. It allows certain smart contracts to react to an uncertain environment. It is the only way for smart contracts to communicate with the outside information, and also for blockchain to interact with external data.

Why does the blockchain need to use Oracles to interact with the external world?

The blockchain is a certain and closed system. Only the data on the chain can be obtained quickly, but external data cannot be obtained. Therefore, the blockchain is separated from the external environment. In addition, the smart contract must have a consistent result no matter when, where, and when it runs, so the Virtual Machine (VM) cannot let the smart contract runs a network call, otherwise, the result is uncertain.

In other words, the smart contract cannot perform I/O (Input/Output), meaning that it cannot actively obtain external data. It can only use Oracles as a data information bridge to link the blockchain with the external data. Oracles provide creditable data for smart contracts, such as flight information, gold prices, etc., so that logical judgment can be executed based on real-world data when the smart contract conducts.

Note: Here is a precondition, a trusted data source. In the Oracle network, if Oracle nodes are not trusted, it will directly affect the trust problem of the final result. Therefore, in a decentralized way, each node can request independently without interfering with each other, and finally, reach a consensus on the result. This way can prevent centralized parties from manipulating the request result, improve the credibility of the final response result, and then provide real and effective information and data for the blockchain.

Let’s take an example

Suppose we are on an isolated island and know nothing about the world, but every day some fishermen commute in-and-out the island. They also deliver some information outside the island, so we can understand what is going on around the world.

In this example, the isolated island is the blockchain; we are smart contracts; fishermen are Oracles. We can only get external news through fishermen, so the credible source from fishermen plays a crucial role in our judgment.

Therefore, there is usually not only a fisherman, but many fishermen are going in and out of the island, so we can judge the information comprehensively and avoid being blocked. This example may not be accurate, but it can explain the role played by Oracle, as the link between the blockchain and the external environment and the tool for data exchange.

How does Oracle solve the data transmission problem?

When a smart contract needs specific data to execute, it will pass the request to multiple nodes on the chain, that is, the Oracle contract. It will search for the required data (more precisely, the external data is given to the Oracle contract on the chain) and work with other nodes to determine the credibility of the search result. Then pass the data to the smart contract.

Oracle implementation in Neo3

There are two forms of Oracle:

One is to establish a trusted communication channel between the execution environment and the data source in the external environment. The reliable data source sends the data to the Oracle system in the execution environment, which then sends the data to Blockchain. After passing the Remote Attestation, the program in the execution environment will be conducted strictly according to the set logic, to ensure the data obtained through this Oracle is credible.

The other one is based on consensus. Consensus nodes judge whether the data from the external environment is reliable by performing consensus verification on specific data. This is also one of the topics currently being undertaken by Neo3.

In addition, in order to ensure the operation of the Oracle network in a decentralized environment, a set of strategies is required to regulate the operation rules and the values in the operation process (such as basic Oracle request fees). In the Neo3 development environment, the solution for Oracle is to develop a local contract to formulate regulation and key values in the request process to ensure consistent information among all nodes.

For more details, please go to Github to view open discussions on Oracle’s strategy.

https://github.com/neo-project/neo/issues/1277

--

--

NeoLine

NeoLine mobile is an easy-to-use mobile gateway to the Neo smart economy。