The applications of Smart contracts are by default somewhat limited due to restrictions in relating with off chain data as a security measure. Oracles step in to provide a connection to external data. This connection helps to provide added functionality or usability to smart contracts.
In ancient folklore as well as in some societies till date, the mention of the world Oracle relates to the supernatural. An oracle from that perspective is a priest or priestess who serves as a medium through which advice or prophecy was sought from the 'gods'. Think of them like the mouthpiece of the 'gods' serving as a bridge between the 'gods' and mankind.
The oracles of the world of crypto currency or crypto verse in this light bear some similarities with their forebears in the 'spiritual' realm or dimension. They serve as a bridge to provide verified information or data to smart contracts on a block chain. The bridging function is important as by default smart contracts do not access off chain data i.e. data from external sources or from outside the block chain network.
A hypothetical example of an Oracle in action
Let me attempt to illustrate the function of an oracle with the example below.
A country has just experienced widespread destruction due to flooding as a result of heavy rainfall and winds. However not all locations in the said country were affected as some areas were spared. The Government opens a portal on a blockchain network for applications from affected persons and decides that for ease of distribution it is going to use smart contracts. This is where an orcale comes in as not all applicants will be eligible based on their location. It will serve as a bridge between the smart contract and external data sources on the areas affected by the flooding.
In this sense it acts as a 'medium' of sorts as it tells the smart contract who is eligible to receive the government aid from amongst the applicants based on verified data as to their location of residence whether they indeed live in locations affected by the flooding disaster.
Are all coins available today oracles?
The answer is no. There are only a couple of coins at present that can serve the function of oracles. Majority of them run on the ethereum block chain. Some common coins which are oracles are listed below.
DIA
LINK
BAND
REP
BRG
ORAI
It should be noted that from among the few coins listed above, BRG is distinct in the sense that it runs on the TRON block chain.
Risks associated with Oracle use
There exists a potential risk with the use of oracles, the proper execution of a smart contract that depends entirely on the data provided by the Oracle. In other words such smart contract is only as good as the Oracle feeding it with data or information.
Another potential challenge is the exploitation of the data feed between the Oracle and the smart contract. If any attempt at doing this succeeds, data can be manipulated by the attacker to suit whatever purpose he desires.
Shukran
Danke
Merci
Gracias
ขอบคุณ
ধন্যবাদ
Спасибо
for reading.