
Editor's Note: This article comes fromChain news (ID: chainnewscom)Editor's Note: This article comes from
Chain news (ID: chainnewscom)
Chain news (ID: chainnewscom)
, content discussion: Wu Weilong (Genaro CTO), Li Hua, content arrangement: Li Hua, reproduced by Odaily with authorization.
Like any computer system, the job of a blockchain is to process data.
There are two sources of data, one is on the blockchain itself, such as the amount of ETH in an account; the other is not on the blockchain itself, such as the price of ETH. How does a blockchain system obtain data outside of itself? It can be through the oracle machine (Oracle): when the contract needs some data outside the chain, it goes to the oracle machine to get the data, and then tells the data to the contract.
From this point of view, the oracle machine is very important. Without it, the development of the blockchain will be limited to the use of a little bit of asset data on the chain, which obviously does not meet our expectations for it. However, the important things are not necessarily the key things that affect the development of the system. For example, oxygen may be the most important thing for humans, but it hardly poses a problem that bothers us.
Let’s compare the internet with the blockchain. Obviously, the data sources of the Internet are almost only "off-net" (corresponding to off-chain), and it also has the problem of "on-line" (corresponding to on-chain) data, but why has it not encountered the oracle problem?

The reason is not that applications on the Internet can read data from outside the network, but applications on the blockchain must read in a consistent data outside the chain through the oracle for consensus requirements—in fact, any on-chain Applications can easily write an oracle for themselves as an interface for off-chain data. The key question is whether users trust the data provided by the oracle.
The root cause is that the traditional Internet is a centralized structure. In this system, users have to trust the data provided by this organization when they choose the centralized organization. The trust in the data is transferred to the trust in the center. The "Internet" is done by the centralized server itself. Of course, users can also choose not to trust.
The embodiment of the oracle machine problem is that it is not difficult to use the oracle machine to upload data to the chain. Simple read and write operations can "feed" an off-chain data to the contract on the chain; but it is difficult to produce trust. Through the design of technology and mechanism, the data provided by itself can meet the needs of users for trust.
Therefore, from a functional point of view, the oracle machine solves the data problem, but in essence, the oracle machine needs to solve the trust problem. This is why the Internet does not have the problem of "data access to the Internet", but the blockchain has the problem of "data uploading to the chain".
When the blockchain develops to the point where it is necessary to use off-chain data to explore and implement applications in more directions, the oracle machine must be able to meet its requirements for "trusted data". Therefore, in our discussion on the topic of "blockchain infrastructure", we chose oracles as one of them.
secondary title
1. The design idea of the oracle
When we know that the core of the oracle machine is to solve the trust problem, we can understand that the main difference in the design ideas of various oracle machines lies in the difference in their "trust production mechanism".
According to different sources of trust, today's mainstream oracles can be divided into the following three categories:
1. Data provided by a trusted center, such as Provable (formerly Oraclize).
2. Data is provided by distributed nodes, such as Chainlink.
3. Data is provided by a trusted alliance, such as Maker's oracle.
Before introducing the specific implementation of different types of oracle machines, the following points need to be noted, or are worthy of our thinking and discussion:
The role of the oracle machine is not to provide "real data", but to provide "credible data". "Reality" is a subjective concept, and it is also a concept that is difficult to evaluate. There may be no tool in the world that can guarantee the output of "truth", and it is not realistic to let the oracle machine complete such a function. We cannot design a mechanism to ensure authenticity, but we can design mechanisms to increase credibility. If the oracle machine is required to provide truth, it is easy to fall into the theory that the oracle machine is useless and the blockchain is useless, because they really cannot meet our requirements for truth.
Different application scenarios have different sources/supports of trust. In other words, it cannot be considered that the trust achieved by a certain trust production mechanism is optimal, while the trust achieved by certain mechanisms is not good.
In this way, when we observe the oracle project, the important focus can be on how it generates trust and whether the trust it provides can meet the needs of the application scenarios it serves.
Another important issue involved in the design of the oracle machine is the issue of the data source, that is, where the data provider in the oracle machine obtains the data from. It can be divided into two types, one is to obtain data from a single data source, and the other is to obtain data from multiple data sources.
secondary title
2. The specific implementation of the oracle machine

Let's start with the source of trust and look at the specific implementation of different types of oracles.
The oracle machine is an important infrastructure of the blockchain, but the oracle machine is not a "magic" technology. What it does is actually give the data outside the chain to the application on the chain. No matter what the oracle machine is, it is just Different implementations of data providers.
We can imagine a small town with a big clock showing the time (data source) and a blind man (blockchain application) living in the town. The blind man wants to know the time, but he cannot see the big clock, so someone must tell him the time displayed on the dial. This person is the oracle.
1. Data provided by a trusted center
If there were 10 blind people living in a small town and time was of the essence to them, oracles could become a business. Every time a blind person asks this person about the time, he has to give him 1 yuan. If 10 blind people ask him 10 times a day, he can earn 100 yuan a day.
If this person sees the time of the big clock by himself and then tells the blind person, we call this method the data provided by a trusted center. In this case, blind people choose this person on the basis that they can trust that this person will not deceive them, so this person needs to prove that he is trustworthy.
The trust guarantee of a type of centralized oracle machine is "authenticity proof technology", such as Provable. It uses the TLSNotary algorithm (https://tlsnotary.org/TLSNotary.pdf), which can provide an unmodified proof for each returned result, which means that it can show that the data provided to the contract is the data source The correct data at a certain point in time.
Town Crier also belongs to this type of oracle machine. It uses the Intel SGX (Software Guard Extensions) architecture to prevent data from being tampered with by running code in a black box-like environment. It is a hardware-based trust provision method.
This type of oracle has its own weaknesses, including technical problems, such as the shortcomings of the TLSNotary algorithm itself; single point failure problems; data source risk problems, etc., but they also have the advantages of low cost, high efficiency, etc., and the authenticity proves Technology is also constantly evolving.
Although they are centralized, because such oracle machines are commercialized, they do and only do the work of providing data, and the security of data is directly related to their own development, so their inaction and evil motives are quite different. small.
In addition to the oracle that provides trust through technology, there is another type of oracle that is a trusted center: just imagine, what would happen if the big clock in the town added a timekeeping function? The blind man went to the big clock and pressed a button, and the big clock told him the current time directly.
When the blockchain needs certain types of data from an authoritative institution (such as a national agency, bank, etc.), it may be a good way for the institution to build an oracle to provide the data. At this time, what matters is not the technology of the oracle machine, but whether the data source itself is willing to open the interface. The source of trust is also not the design of the oracle, but the institution itself.
This is a way to inherit trust from off-chain to on-chain, and it believes in the trust brought by the traditional trust production mechanism. Although it is highly centralized, it has positive and important significance at least in a long historical period, such as in lending and commercial lending scenarios. Remember, blockchain is not meant to negate all other ways of generating trust.
Taking national institutions as an example, it is easy to understand the characteristics of this type of oracle, but there may also be commercial data sources and oracles in this category, which serve a specific data demand, and this data is often a large number of special The calculation results of the data, and only professional institutions have the ability to give such data results.
2. Data provided by distributed nodes
The oracle machine needs to solve the problem of trust. The oracle machine with data provided by the trusted center proves/guarantees its own credibility through technology, while the oracle machine with data provided by distributed nodes guarantees its own reliability through the design of the mechanism. letter. The latter are also often referred to as decentralized oracles and decentralized oracle networks.

Let's go back to town. The decentralized oracle network means that all people in the town can participate in telling the time. When the blind ask the time, these participants/nodes will tell a statistician the time they see, and the statistician will give him the most people. Tell the blind man that time.
It is not difficult to find that the design idea of this oracle machine is consistent with the distributed idea of the blockchain, so it will not add new types of trust to applications on the blockchain; without adding new types of trust, things will The complexity will not increase. But this method also has limitations. For example, it is relatively expensive because it needs to pay a large number of participants; it requires a network scale, and the number and quality of participants are related to the credibility of the data.
Chainlink is an oracle of this type. As shown in the figure below, the distributed oracle node/oracle service provider obtains data from decentralized data sources and submits the data to Chainlink’s on-chain aggregation contract (in the medium and long-term strategy, it will be changed to off-chain aggregation to save gas Fee cost), the contract calculates the data result through the algorithm, and sends the result to the blockchain application that requests the data.
In Chainlink, buyers of oracle service first specify their own service level, and then Chainlink matches them with oracle nodes, including the quality and quantity of nodes.
For example, if the buyer's contract is a $100,000 DeFi market, then 5 oracle nodes may need to be selected to form the network; if the contract grows into a $1 million market, 15 oracle nodes may need to be selected. It can be considered that the way Chainlink works is to provide users with a customized dynamic oracle network based on their needs.
In addition to the dedicated oracle projects mentioned above, prediction markets, such as Augur, can also serve as a class of decentralized oracles, since their predictions can be used as input data for blockchain contracts. Every participant in the prediction is an oracle node, and these participants are also the data source itself.
The oracle function provided by the prediction market may not be replaced by other types of oracle machines, because of the uniqueness of its data sources, such as not relying on any centralized trust, such as providing data expressing emotions and knowledge, etc., the prediction market In the future, it may have its unique oracle application scenarios. But its weakness is also prominent. It has a high dependence on the number of nodes that make up the oracle network, and its efficiency in providing data is low.
3. Data provided by trusted alliances
If an application or a certain type of application has high-frequency and high-quality requirements for off-chain data, and the oracles on the market cannot meet the requirements, for example, the security is not high enough, and the cost performance is not good enough, these applications may need a dedicated The oracle machine for its own special needs service, and the way of providing data by the trusted alliance is a design idea suitable for this scenario.
Compared with the previous two types of oracle machines, the trust composition of this type of oracle machine is relatively complex, including trust in the mechanism design of the system; trust in nodes, which largely stems from the stakeholder identity of the node itself and Institutional reputation of the node itself; trust in the Maker who selects the node and the Maker's own mechanism.
The trust in the alliance (nodes and node selection mechanism) has the color of centralization, but it is precisely this kind of centralization that can generate "cost-effective" trust in specific scenarios, so in practical applications, this type of oracle machine may It is a practical way to upload data to the chain, especially in the early stage of the development of the blockchain industry and the commercial oracle machine is not yet mature enough.
Maker's oracle machine is dominated by Maker, but because it can meet the demand for trusted data in the DeFi field, some other contracts are also using this oracle machine. We can also imagine a trusted alliance oracle service provided by a third party, which is an oracle network composed of trusted institutions/nodes in the DeFi field, providing professional data services for distributed finance. If the blockchain generates the next type of new application scenarios, then it may also be necessary to create an alliance-style oracle service composed of trusted nodes in that field.
secondary title
3. Development path
The more the blockchain develops, the stronger the demand for off-chain data will be, and the importance of oracles will become more prominent. But as discussed above, a bigger possibility in the oracle field is a market where multiple forms coexist. We can think that from centralized to federated to distributed, it is the granularity of data providers from large to small, and different granularities determine their different attributes, which also determine their respective suitable service scenarios.
Although the oracle machine can also be composed of a distributed node network, our perspectives on blockchain and oracle machines and the standards for evaluating them are different: what the blockchain does is exploratory work, and it is more It is to ask "is this problem suitable for me to solve"; while the oracle machine does functional work, it is more to ask "how can I solve this problem".