What Are Oracles and Where to Find Off-chain Data on Tezos?

What Are Oracles and Where to Find Off-chain Data on Tezos?

On tzstats, the price of tez at the time of writing is $1.025; on tztkt, it is $1.03; on QuipuSwap, it is $1.007. So how much is it really worth? We'll have to ask an oracle!

Let’s find out what blockchain oracles are for, how they work, and which smart contracts on Tezos have off-chain data.

What Oracles Are For

Blockchain protocols are disconnected from the rest of the internet. Smart contracts cannot simply obtain off-chain data: quotes from centralized exchanges, the air temperature in New York, or the number of likes on a Twitter post. You need to use a particular service called an oracle to find out this information.

Oracles are algorithms that collect off-chain data and transmit it to smart contracts at the request of users or applications. For example, an algorithmic stablecoin contract uses an oracle to obtain the tez price at a major exchange and uses it to calculate the backing percentage of the users’ storage.

In addition, oracles verify data. Quotations on different exchanges vary, so oracles often gather data from several exchanges and compare them. If one source’s answer is too different from the rest, the oracle will discard it as bogus to avoid attempts at manipulation.

Oracles can also be used for off-chain random number generation based on hardware solutions. Did you know that Cloudflare uses a lava lamp cabinet for this?

How Oracles Work

Centralized oracles work simply: the software receives and writes the data into the contract itself. Blockchain applications access the contract for data. Developers have to trust the integrity of the centralized oracle.

Decentralized oracles do not require any trust. They work like this:

  1. Several nodes, owned by different people or companies, are connected to the oracle contract.
  2. The user asks the oracle for the tez price on Binance.
  3. The oracle transmits the request to the nodes.
  4. Each node receives data from Binance and passes it to the oracle.
  5. The oracle verifies the data and adds it to the contract.
  6. The user gets the price.

Oracles can use the same principle to send on-chain data off-chain.

What Oracle Contracts There Are on Tezos

Several oracles are running on Tezos: Ubinetic, Kaiko, and Harbinger.

Ubinetic is a Compass Security-audited oracle solution based on Android key certification and embedded hardware security modules. In general, the nodes work on smartphones, the data is key-signed, and the oracle response cannot be tampered with. The source code and instructions for use are in the Ubinetic repository on Github and take prices from the Ubinetic Index Oracle contract.

Kaiko is a provider of cryptocurrency market data. In June 2020, the platform announced that it would post tez price streams for a network oracle on the Tezos blockchain. Kaiko records historical and current XTZ/USD and XTZ/CHF exchange rates into each new Tezos block once every minute and writes them into a Kaiko smart contract.

B9 lab is a provider that allows you to query an external data source using Harbinger. Harbinger is a price oracle for digital assets. It provides a set of tools and reference contracts. Several contracts running in the mainnet constantly update the prices of popular cryptocurrencies. For example, Harbinger Normalizer stores prices of tez, BTC, ETH, LINK, BAT, and others.

Subscribe and never miss updates from the world of Tezos:

  1. Telegram channel
  2. Facebook
  3. Twitter in Russian and Ukrainian
  4. Twitter in English
  5. YouTube channel
  6. Instagram
  7. LinkedIn
  8. hub at ForkLog

next

Tezos Economy in Novemeber: Not So Bad Considering the Tez Price

Read similar posts

What Are Meta Transactions Without Fees?

What Are Meta Transactions Without Fees?

On the Way to 1 000 000 TPS: the History of Tezos Updates

On the Way to 1 000 000 TPS: the History of Tezos Updates

Bonus Lesson on Blockchain Indexers: How to Make a Simple Token Tracker

Bonus Lesson on Blockchain Indexers: How to Make a Simple Token Tracker

Read our blog and never miss news about TezosRead Blog

Community