LThe protocols of the blockchain and Smart contract they are limited to only obtaining information and accessing data that is within the same network. This limitation has led developers to create oracles. These are, in a nutshell, a service that sends and verifies real-world information that is relevant to a blockchain or smart contract. All this in the form of electronic data that can be assimilated by the networks that support them.
In this sense we can say that the oracles are pieces of code that serve as a bridge between the real world and that represented by the blockchain and its protocols. A bridge that allows blockchains and smart contracts to interact with the real world.
Functions of an oracle
An oracle has as its main function, be a service through which a blockchain or a smart contract is nourished by information external to the blockchain on which it is executed. Information that can trigger a specific action within it according to a certain schedule.
And it is that through the oracle real data is obtained from different websites that reveal sports results. In addition, the oracle collects and verifies the information from various web pages to create a consensus and give an accurate result that cannot be manipulated. So oracles are a type of data source that inform the network of events that happened abroad. With this they allow that in this case, the smart contract can be activated to release the funds after the predetermined conditions of the agreement are met. With this, the potential of smart contracts extends to the real world.
Examples of using an oracle
Surely you are wondering right now What use can an oracle have? Well, to tell the truth, they are very useful, and to learn a little about this, let's look at the following example.
Let's imagine that two people make a bet on a soccer game. In this bet, Pedro bets on team A winning and Juan on team B. Both define the agreement, the conditions and the money of the bet. Then they send the funds to the smart contract that contains all these parameters and conditions. While the game is going on, the oracle will obtain the information of the game until its end, at which time it analyzes all the conditions, and then releases the funds to the winner of the bet.
The example above is that of a bet, but the system can also be replicated to other aspects. And all this without the intermediation of a centralized platform that can be hacked, deceive its clients or censor itself.
Types of Oracles
This type of oracle are the ones that handle information online. Known as software oracles, They can extract and order information online such as weather, temperature, product prices, flight schedules, among others. All these data are then sent to the smart contract for which they were programmed. All this with the purpose of said smart contract can carry out the corresponding actions for which it was programmed.
Unlike software, hardware oracles, they can track real world objects. This is because some smart contracts require information from the real world. For example, the arrival of a bus, a boat, or tracking the movement of a car when it reaches a certain place or crosses a barrier. These hardware devices provide users with the ability to monitor entire supply chains through a blockchain.
Thus these oracles include IoT sensors, RFID or barcode readers. The information they capture is brought to a blockchain-based delivery system, giving users a complete set of information.
Incoming and Outgoing
The incoming oracles, are those They provide information from abroad to the blockchain or smart contract. They are widely used by companies and companies that want to automate different actions that depend on the introduction of information.
Furthermore, the outgoing oracles, are those that give the network the possibility of sending data to the real world. For example, in smart home technology, these types of oracles are very common, since they allow, for example, opening a smart home lock once it is verified that the entry has been authorized by a private key and valid cryptographic signature.
As we mentioned in our example, there are oracles that are based on consensus to ensure reliable information that cannot be manipulated. These oracles are ideal for monitoring financial markets, as they collect information from many places to provide correct information. Since using a single data source could be unreliable and insecure.
While the Ethereum network is currently the leading blockchain for the use, implementation, and execution of smart contracts, Bitcoin also has the ability to use oracles. A good example of this is the project developed by the Massachusetts Institute of Technology (MIT), in which he uses oracles and smart contract in the network Lightning Network (LN) Bitcoin. The name of the project is bed, and they can review their source code from their website on GitHub.
The objective of this research project is to program transactions from the execution of the smart contract. A capacity that will allow scalability to be provided to the network and explore the capabilities and potential of this type of contract.
The work is in the hands of Tadge Dryja of MIT. This project uses a simple oracle through which certain functionalities of smart contracts could be added to transactions made on the Bitcoin network. All this without posing a risk to the privacy and security of the Bitcoin network. In this way, information can be transmitted for the execution of a certain contract according to the data received.
Characteristics of blockchain oracles
- Privacy. The oracles cannot know if a smart contract has been started or if their information has been included in a blockchain. So a protocol is used that mixes the information supplied by the oracle before including it in the chain. Thus, the identity of the users is kept private and they are kept away from prying eyes.
- Connectivity. Oracles allow smart contracts to connect off-chain with data providers, web APIs, IoT, payment systems, business backends, and other blockchains.
- Centralized service. The oracles obtain information from trusted centralized services. So it is required to trust that the service is sending the correct data. And although this is a problem that could not be eradicated, if solutions have been implemented to mitigate this fact,
- Monetization. The oracles have not been reasonably monetized. So in order to see the massive adoption of this type of tool, it is necessary that there be some type of incentive or reward for its operators.