Oracle (blockchain oracle) is a service that connects blockchain with data from external environment – decentralized applications, other blockchain, business platform, cloud providers, IoT devices, payment and corporate system. It is mainly used for the operation of smart contracts.
When a smart contract needs to obtain information from the outside environment, such as how much a token costs or what the price is per barrel of oil, it is the oracle who passes this data on to him.
The oracles check the condition of the execution of smart contracts and also provide them with the information they need to execute them. They are not part of the blockchain and therefore do not compromise its security. The network is now still decentralized, but has external data.
Blockchain mechanisms that use a centralized entity to deliver data to smart contract represent a single point of failure, thus thwarting the entire purpose of a decentralized application. If a single oracle goes offline, then the smart contract will not have access to the data needed to execute or will run incorrectly based on outdated data.
Even worse, if the oracle is damaged, then the data supplied in the chain may be incorrect and lead to smart contracts with very poor results. This is commonly referred to as a problem where bad inputs lead to bad outputs. In addition, because blockchain transactions are automated and unchanging, the outcome of a smart contract cannot be undone based on erroneous data, which means that user resources may be permanently lost.