Talk about what is an oracle
When it comes to this oracle, the first reaction of many people may be to predict the market and judge the rise and fall of the currency price.
In fact, the oracle machine is not a machine for predicting the future. The oracle machine is an intermediate interface used to serve the blockchain network, and it provides data services to the project party.
So what exactly is this oracle? Prophecy In the Internet field, the oracle machine, also known as the oracle machine, is an abstract computer used to study decisive issues. In the blockchain report issued by the People's Bank of China, the oracle machine is defined as follows: information outside the blockchain The mechanism of writing into the blockchain is generally called an oracle. The function of the oracle is to write external information into the blockchain to complete the data exchange between the blockchain and the real world.
For example, suppose the "data source" in the real world and the "data interface" in the blockchain are two countries that use different languages, and the oracle machine is the translator in the middle. Through the oracle machine smart contract, it is possible to communicate with off-chain data without barriers.
In the actual use of smart contracts, the oracle machine is required to verify the data. Because the blockchain is also a consensus-based system, the running smart contracts must also be deterministic programs. The step of data verification by the oracle machine is to conform to the consensus mechanism, so that the final data fed back to the smart contract is also "deterministic".
The operating principle of the oracle machine: When a smart contract on the blockchain has data interaction needs, the oracle machine will help the smart contract collect external data outside the chain after receiving the demand, and then feed the acquired data back to the chain after verification Smart contracts on .
Why do blockchains need oracles?
Because smart contracts and decentralized applications (Dapps) on the blockchain have interactive requirements for external data.
The blockchain is a closed environment, and the chain cannot actively obtain real-world data outside the chain. The main reason is that the blockchain cannot actively initiate a Network call (network call) and the smart contract on the chain receives data passively. Secondly, the smart contract is not actually "smart", it is only a program that reaches the trigger state when the corresponding conditions are met. At the same time, the final execution of the smart contract requires the signing of the private key of the contract participants, and the smart contract itself cannot be automatically executed.
When the triggering conditions of the smart contract depend on the information outside the blockchain, the information needs to be written into the records in the blockchain first. At this time, it is necessary to provide information outside the blockchain through the oracle machine.
Let me give you an easy-to-understand example. Let’s say I’m locked in a small dark room. I know almost nothing about what’s going on in the outside world. I don’t know if there is anyone outside. People outside tell me at the door, so I can know the changes outside.
The smart contract is like the "I" in this example. It cannot actively seek information from the outside no matter when and where, but can only send information or data to it from the outside. And the oracle machine is the person who sends messages and data from the outside after receiving my request at the door.
Maybe you will ask again why the data cannot be directly imported and received on the chain? Mainly because of the consensus mechanism of the blockchain.
The blockchain is a consensus-based network, and the running smart contracts must also be deterministic programs. After each transaction and block is processed, each node must reach the same state. But the data itself is complex and diverse, which is why the oracle machine, in order to fit the consensus mechanism of the blockchain, has a step of data verification in addition to data collection before feeding back the final "certainty" information to the smart contract.
What is the use of oracles?
The triggering and operation of smart contracts cannot be without data sources, and oracles serve as intermediate data agents to provide data for smart contracts. These oracle machines are the only way for smart contracts to interact with the outside world. If there is no oracle machine, the practicability of smart contracts will be greatly reduced.
What does the oracle do?
1. The oracle provides the necessary conditions for the smart contract to run when the terms of the contract are met. These conditions can be anything related to the smart contract: temperature data, payment completion, price changes, etc.;
2. Establish a credible data network between the blockchain and the Internet, break the shackles of smart contracts to obtain data, and make it have the ability to access Internet data under the condition of ensuring credibility;
3. In order to ensure the authenticity and credibility of the obtained data, the oracle machine needs to provide a variety of encryption proof methods to build a trusted environment;
4. Oracles have the potential to reduce a lot of the wasteful work surrounding the enforcement of traditional written contracts;
5. Based on the potential of the blockchain, it can reduce bloated bureaucracy by forcing everything to be completely transparent and anonymous.
Smart contracts cannot actively obtain real-world data, that is, they cannot directly import Internet data, nor can they call external network APIs by law enforcement, and any commercial application will inevitably interact with the real world, especially Internet data. This is why the oracle was born. With the continuous improvement of the blockchain network and the continuous development and refinement of real application scenarios, more and more detailed smart contract types and new oracle machine structures will be produced in the future. These will jointly build a more practical and easy-to-use blockchain underlying structure, deepen the integration between the Internet and blockchain, and make communication more convenient and simple.


