Oracles, or why smart contracts still have not changed the world?
For those who are interested in the subject of smart contracts, the answer to the question asked in the title lies on the surface: today, contracts do not have a reliable and complete source of information about what is happening in the real world. As a result, there is a very bad situation: we can describe complex logic in a smart contract, and the blockchain will provide us with its unconditional execution. And here, it would seem, we are one step away from eliminating the need for a third party in concluding contracts - this is what was meant by the words “change the world” in the title. However, any logic that describes the processes of the real world, you need to know what is happening in this world. Thus, the last obstacle separates us from the “revolution of trust” in the form of the lack of information providers or oracles.as they are called in the world of smart contracts. The solution to this problem would give a huge impetus to the prevalence and applicability of smart contracts. Otherwise, this technology risks forever remaining only a platform for the implementation of ICO.
Abilities that do not find use turn into nothing.
Sten Nadolny
An oracle is a provider of information that, upon request of a contract, provides reliable data from the offline marketplace for the correct operation of the contract. The main requirements for the oracle - is the accuracy and completeness of the information provided. Here, confidence means the ability to confirm / check the validity of the data, and fullness means the ability to provide data on a wide range of events from the real world. We note separately that the oracle is not a source of information, it is its supplier to the blockchain.. Thus, the choice of the source of information is one of the key parameters of the oracle, because in order for the oracle to be reliable and complete, the source must also be reliable and complete (let's talk about the sources in the next section).
Let's start with the oracle credibility property. To date, there are two main approaches to achieving the reliability of oracles. The first is the consensus of oracles.. As the name suggests, this approach uses the consensus of several independent validators. The main problem of this approach (from the point of view of reliability) is the creation of a network of independent validators. On the one hand, if we choose / appoint consensus participants (oracles), they will be dependent on the selection / appointment mechanism. Thus, centralization will remain, although, of course, to a lesser extent and in a different guise. On the other hand, if anyone can become a participant in the consensus, then the system becomes vulnerable to a Sybil attack.. In addition, there is an opinion that compromising (hacking, bribing) several small participants in a consensus may be easier than compromising a single major validator, since for a major player security measures are much more serious and reputational costs are much higher.
Company Oraclize provides an alternative consensus oracles solution: the user chooses a source of information on the Internet. And to prove the correct operation of the oracle, TLSNotary- proofs are used. This is cryptographic evidence that the data obtained from the selected source is transferred to the smart contract unchanged.
At the moment, you can verify this evidence on the Internet usingnetwork monitor for Ethereum (at the time of writing this article is unstable). In the future, it is planned to implement the possibility of verifying TLSNotary evidence directly by contract in the Ethereum network.
It is important to note that both approaches have a problem of trusting the source / information of the information: both of them to some extent guarantee us the fairness of data transfer from the source to the contract, but do not guarantee the integrity of the source (even if we chose it).
In the beginning of this section we will touch on the topic of completeness of data provided by the oracle. Achieving completeness means expanding the range of information sources, and this entails even greater questions to the reliability of these data. Consider two simple examples: if your contract needs information on the current ETH / USD rate, then you can consider large cryptocurrency exchanges as sources, the consensus of which will be fairly reliable. And if the contract needs to know whether the lights are on in your bedroom, it will be extremely difficult to find independent eyewitnesses. You can use a physical source, for example, a camera in the bedroom, but if you wish, it is easy to fool it: put a bag on the camera and it will always be dark in your bedroom. In this way,
The most natural source of information is centralized . We are accustomed to this approach in everyday life: we will learn the news on our favorite site, the dollar rate - on the Central Bank’s site. Most of us blindly believe these centralized sources, and this belief is most often justified, because the reputational costs for such large companies exceed the potential benefits that can be gained by giving you false information. There are two "but." First, credibility: even when dealing with a reliable centralized source, we still operate with faith, not knowledge. Secondly, and more importantly, completeness: the use of a centralized source can be considered a reliable approach only for a narrow circle of resonant events.
The first way to get around the disadvantages of a centralized source is to use consensus sources . We have already discussed this approach above when we talked about the consensus of oracles. As in the case of oracles, this approach improves both the accuracy and completeness of the information provided, but its positive effect is limited and has its drawbacks (see the previous section).
Another approach to solving the problem of information sources is an indirect method . The idea is to extract information about the event of interest from indirect sources.
These sources will be different for each type of event: for temperature in Moscow - a photo from instagram with the corresponding geolocation and date, for the result of the match - posts in social networks with corresponding tags and date, etc. The successes of recent years in the field of machine learning will probably allow us to determine the outcomes of past events with acceptable accuracy from indirect sources. What machine learning models are applicable for this, what will be the accuracy, whether the indirect sources are independent - all these questions should be considered for each specific event separately, and the fact of their solvability will be a criterion for the applicability of the indirect method for this event.
For relatively simple tasks, such as determining the result of a match from a sufficient sample of the posts of sports fans, these questions seem to be solved. It is assumed that the contract will refer to the node on which the calculations are made (extract the forecast from indirect sources). The reliability of calculations is proposed to confirm cryptographically, as it is implemented, for example, in the project Golem .
This approach is the second step towards the completeness of oracles. This is not about the light in the bedroom, but about the weather, about the election results, about the success of the launch of the Falcon Heavy .
For a complete picture of the sources of information we will touch upon the subject of prediction markets such as Augur.. The market uses the "wisdom of the crowd" to predict future events. Users predict the possible outcome of these events by buying shares of remuneration for a correctly guessed result (the winners will divide the prize fund in proportion to the size of their rates). Thus, this approach implies an economic motivation for the participants in the prediction: the user receives a reward for a correct prediction, and in the case of an incorrect one loses the investment. The forecast in this case is the weighted average expectation of all users. The use of prediction markets rather greatly increases the completeness of the information provided, because anything can be predicted (if there are enough people), and the economic motivation of the prediction participants provides credibility.
However, not everything is as rosy as it may seem at first glance. First, the prediction is only the expectation of market participants (many examples of events can be cited, the occurrence of which no one expected). Secondly, in such a model, prediction manipulations are possible if the cost of changing the prediction to false is less than the profit from the incorrect operation of the contract. For example, if a contract assumes a large payment in the event of Event A, and the fact of the origin of this event determines the market of predictions with a small turnover of funds, then an attacker can falsify Event A by spending only a fraction of the profit gained on manipulating the prediction.
The importance of oracles for smart contract technology is hard to overestimate. Oracle is a provider of information from the source to the contract. And if the existing solutions today provide a fairly reliable transfer of this information, then the problem with its initial accuracy still remains unresolved. The creation / selection of reliable and complete sources of information is the last frontier that separates smart contracts from widespread dissemination. Given the active development of blockchain technologies, we can count on at least partially overcoming this milestone in the coming years.
Abilities that do not find use turn into nothing.
Sten Nadolny
Oracles
An oracle is a provider of information that, upon request of a contract, provides reliable data from the offline marketplace for the correct operation of the contract. The main requirements for the oracle - is the accuracy and completeness of the information provided. Here, confidence means the ability to confirm / check the validity of the data, and fullness means the ability to provide data on a wide range of events from the real world. We note separately that the oracle is not a source of information, it is its supplier to the blockchain.. Thus, the choice of the source of information is one of the key parameters of the oracle, because in order for the oracle to be reliable and complete, the source must also be reliable and complete (let's talk about the sources in the next section).
Let's start with the oracle credibility property. To date, there are two main approaches to achieving the reliability of oracles. The first is the consensus of oracles.. As the name suggests, this approach uses the consensus of several independent validators. The main problem of this approach (from the point of view of reliability) is the creation of a network of independent validators. On the one hand, if we choose / appoint consensus participants (oracles), they will be dependent on the selection / appointment mechanism. Thus, centralization will remain, although, of course, to a lesser extent and in a different guise. On the other hand, if anyone can become a participant in the consensus, then the system becomes vulnerable to a Sybil attack.. In addition, there is an opinion that compromising (hacking, bribing) several small participants in a consensus may be easier than compromising a single major validator, since for a major player security measures are much more serious and reputational costs are much higher.
Company Oraclize provides an alternative consensus oracles solution: the user chooses a source of information on the Internet. And to prove the correct operation of the oracle, TLSNotary- proofs are used. This is cryptographic evidence that the data obtained from the selected source is transferred to the smart contract unchanged.
At the moment, you can verify this evidence on the Internet usingnetwork monitor for Ethereum (at the time of writing this article is unstable). In the future, it is planned to implement the possibility of verifying TLSNotary evidence directly by contract in the Ethereum network.
It is important to note that both approaches have a problem of trusting the source / information of the information: both of them to some extent guarantee us the fairness of data transfer from the source to the contract, but do not guarantee the integrity of the source (even if we chose it).
Information sources
In the beginning of this section we will touch on the topic of completeness of data provided by the oracle. Achieving completeness means expanding the range of information sources, and this entails even greater questions to the reliability of these data. Consider two simple examples: if your contract needs information on the current ETH / USD rate, then you can consider large cryptocurrency exchanges as sources, the consensus of which will be fairly reliable. And if the contract needs to know whether the lights are on in your bedroom, it will be extremely difficult to find independent eyewitnesses. You can use a physical source, for example, a camera in the bedroom, but if you wish, it is easy to fool it: put a bag on the camera and it will always be dark in your bedroom. In this way,
The most natural source of information is centralized . We are accustomed to this approach in everyday life: we will learn the news on our favorite site, the dollar rate - on the Central Bank’s site. Most of us blindly believe these centralized sources, and this belief is most often justified, because the reputational costs for such large companies exceed the potential benefits that can be gained by giving you false information. There are two "but." First, credibility: even when dealing with a reliable centralized source, we still operate with faith, not knowledge. Secondly, and more importantly, completeness: the use of a centralized source can be considered a reliable approach only for a narrow circle of resonant events.
The first way to get around the disadvantages of a centralized source is to use consensus sources . We have already discussed this approach above when we talked about the consensus of oracles. As in the case of oracles, this approach improves both the accuracy and completeness of the information provided, but its positive effect is limited and has its drawbacks (see the previous section).
Another approach to solving the problem of information sources is an indirect method . The idea is to extract information about the event of interest from indirect sources.
These sources will be different for each type of event: for temperature in Moscow - a photo from instagram with the corresponding geolocation and date, for the result of the match - posts in social networks with corresponding tags and date, etc. The successes of recent years in the field of machine learning will probably allow us to determine the outcomes of past events with acceptable accuracy from indirect sources. What machine learning models are applicable for this, what will be the accuracy, whether the indirect sources are independent - all these questions should be considered for each specific event separately, and the fact of their solvability will be a criterion for the applicability of the indirect method for this event.
For relatively simple tasks, such as determining the result of a match from a sufficient sample of the posts of sports fans, these questions seem to be solved. It is assumed that the contract will refer to the node on which the calculations are made (extract the forecast from indirect sources). The reliability of calculations is proposed to confirm cryptographically, as it is implemented, for example, in the project Golem .
This approach is the second step towards the completeness of oracles. This is not about the light in the bedroom, but about the weather, about the election results, about the success of the launch of the Falcon Heavy .
For a complete picture of the sources of information we will touch upon the subject of prediction markets such as Augur.. The market uses the "wisdom of the crowd" to predict future events. Users predict the possible outcome of these events by buying shares of remuneration for a correctly guessed result (the winners will divide the prize fund in proportion to the size of their rates). Thus, this approach implies an economic motivation for the participants in the prediction: the user receives a reward for a correct prediction, and in the case of an incorrect one loses the investment. The forecast in this case is the weighted average expectation of all users. The use of prediction markets rather greatly increases the completeness of the information provided, because anything can be predicted (if there are enough people), and the economic motivation of the prediction participants provides credibility.
However, not everything is as rosy as it may seem at first glance. First, the prediction is only the expectation of market participants (many examples of events can be cited, the occurrence of which no one expected). Secondly, in such a model, prediction manipulations are possible if the cost of changing the prediction to false is less than the profit from the incorrect operation of the contract. For example, if a contract assumes a large payment in the event of Event A, and the fact of the origin of this event determines the market of predictions with a small turnover of funds, then an attacker can falsify Event A by spending only a fraction of the profit gained on manipulating the prediction.
Conclusion
The importance of oracles for smart contract technology is hard to overestimate. Oracle is a provider of information from the source to the contract. And if the existing solutions today provide a fairly reliable transfer of this information, then the problem with its initial accuracy still remains unresolved. The creation / selection of reliable and complete sources of information is the last frontier that separates smart contracts from widespread dissemination. Given the active development of blockchain technologies, we can count on at least partially overcoming this milestone in the coming years.