A necessary tool for blockchain implementation - oracle machine (Oracle)
The definition of blockchain in The Economist magazine: "Blockchain is a trust machine".
The biggest core innovation of the blockchain lies in the decentralized solution to the trust problem, without the need to trust and rely on third-party institutions for value transfer. Among them, smart contracts play an important role. It is a set of contracts defined in digital form, which helps contract participants to execute agreements to complete tasks, saving time and tedious steps.
But never expected. . . .
The high-end blockchain can't actively obtain real-world data! ! !

However, there are interaction requirements for external data in smart contracts. For example, some real-time price data such as stock or currency prices, weather forecasts, market forecasts and other data.
So, here comes theoracleWhat is an oracle?

What is an oracle?
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.

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 are the application scenarios of oracles?
At present, the application fields of oracles in the blockchain include gambling, stable currency, lending, financial derivatives, insurance, and prediction markets. At present, the more popular application scenarios are gambling, stable currency and lending.
>>>>1. Spinach (Bócǎi)
The spinach Dapp or spinach games in the blockchain all involve random numbers. The core of gambling applications is unpredictable and verifiable random numbers, which determine the final result of bets, but secure random numbers cannot be generated on a closed chain.

Most of the current spinach games generate random numbers on the chain, so it is easy to be predicted and cracked, resulting in asset theft. Previously, some gambling applications were hacked due to random number problems, such as dice games on EOS or FOMO3D on Ethereum. Because they did not meet the requirements for secure pseudo-random numbers in the smart contract/Dapp scenario: random and unpredictable. They use the seed (seed) generated by the information that is published on the chain, called by other contracts, and can be predicted, so that their random numbers can be predicted. For spinach games, if you want to get a safe random number, you can only get it from outside the chain through the oracle machine.
>>>>2. Stable currency
At present, oracle machines mainly serve encrypted asset stablecoins.

Cryptoasset stablecoins are based on cryptocurrency collateral. Instead of maintaining a one-to-one ratio, crypto-asset stablecoins attempt to peg their prices to fiat currencies by maintaining a higher collateral-to-stablecoin ratio. Examples include DAI and bitUSD. DAI is issued through over-collateralized assets, and its collateral is on-chain assets such as Ethereum.
Encrypted asset-type stablecoins have the need for information interaction outside the chain, and the oracle machine is required to obtain data such as the exchange rate of the stable currency itself and anchor assets in the external world in real time.
>>>>3. Borrowing
SALT Lending,Decentralized P2P lending platforms such as ETHlend allow anonymous users to borrow fiat or encrypted assets with encrypted assets on the blockchain.

Such applications need to use oracle machines to provide price data when loans are generated, and can monitor the margin ratio of encrypted collateral, issue warnings and trigger liquidation procedures when the margin is insufficient. At the same time, the lending platform can also use Oracle to import the social, credit and identity information of the borrower to determine different loan interest rates.
Which teams are developing oracles?
>>>> 1、Oraclize:
Oraclize is a project that provides centralized data transmission oracle services for Ethereum. It relies on Amazon AWS services and TLSNotary proof technology to provide oracle services.
In the blockchain environment, Oraclize returns the obtained information to the chain and guarantees that the data is the same as the data source, and users can grab the data by themselves. Oraclize does not interfere with the selection of information sources and the accuracy of the information sources themselves.
>>>> 2、Augur:
Unlike Oracle's centralization, Augur is a decentralized prediction market platform. The core of Augu is a prediction market, which mainly determines the outcome through a profit-driven voting mechanism.
Users can use digital currency to make predictions and bets, and rely on group wisdom to predict the development of events. Users can choose to create a prediction market around any future event, where participants can bet on the outcome of that event. Participants win or lose money based on the actual outcome of the created future event. The platform itself cannot verify what the real outcome of an event was, so Augur relies on users and a sophisticated outcome reporting system to encourage honest outcome reporting behavior. They can also be used as input sources for other applications, but their output results require a long delay and a lot of user participation.
>>>> 3、Chainlink:
Chainlink is the first decentralized oracle. Compared with the centralization of Oraclize, Chainlink is more in line with the principles of blockchain decentralization. Chainlink mainly provides oracle services to help smart contracts access key off-chain resources, website APIs, and traditional bank account payments.
Off-chain nodes provide data, and the on-chain part of chainlink will collect data request requirements, then collect answers from appropriate nodes, and feed back to the information requester after weighted conclusions are obtained. Chainlink also has a reputation evaluation system for nodes. Information demanders can choose nodes with a specific reputation level, and the reputation score of each node will be updated after each information feedback.
>>>> 4、DOS Network

DOS Network is a network that provides decentralized oracle services. It can connect smart contracts and the Internet world outside the chain, and at the same time provide unlimited and verifiable computing power for the blockchain. Dos Network monitors user data requests on the chain, monitors and receives data requests off the chain, and then randomly selects a group of nodes under the chain to provide data. Once the collected data passes the consensus of 51% of the nodes in the group, it is regarded as the "correct answer" , and finally off the chain, the obtained answer is fed back to the information requester on the chain. DOS has set up a reward mechanism for honest nodes: in addition to the data processing fees for nodes, 30% of the total supply of virtual mining rewards lasts for ten years.
DOS Network can support multiple chains in terms of performance, and the data results are close to real-time. At the same time, the network structure design of DOS Network fragmentation can process requests in parallel to achieve high performance and scalability. A layer 2 network solution that helps expand the processing capabilities and application scenarios of smart contracts.
DOS is similar to Chainlink, with many differences and optimizations. Chainlink aggregates and consensuses the results returned by each node on the blockchain, while DOS performs consensus on the results off the chain, which has better performance and scalability. Chainlink is based on the reputation system when selecting working nodes, while DOS selects working nodes completely randomly in a decentralized network, which has better ability to resist attacks, better security, and is more fair.
Several judgments and thoughts on oracles
1. In any case, the oracle market cannot get rid of its dependence on a few authoritative information sources. It just means that this dependence can be reduced as much as possible through procedural fairness, post-event accountability, and distributed fault tolerance.
2. At present, the solutions of various oracle projects have their own advantages and disadvantages.
In the short term: Although Oraclize is a centralized project, it has strong applicability, and users can randomly grab custom information. Augur can also be said to be simple and practical for predicting the direction of the market, but it may not be fast when it involves manual voting.
In the long run: Chainlink and DOS Network, the two decentralized oracle network selection schemes and the idea of comparing multiple information sources, will be more secure and reliable in terms of architecture.
(The pictures in this article are all from the Internet, and the copyright belongs to the original author)







