Blockchain Oracles Explained — A Simple Guide on How to Get Data on the Blockchain

METAGAMEHUB DAO
7 min readNov 11, 2021

Written by Robin Prock & Lukas Philipp

Let’s start with a brief story, so you understand oracles right away: In 1862, a race began in the United States. Two railroads — Union Pacific and Central Pacific — were to connect the East and West Coast. Central came from the west, Union from the east. It was a tough race.

Indians scalped workers, a flood destroyed entire lines, and Union built tracks on ice in the winter; and had to lay them again in the spring… yet: by 1869, the connection was ready — or thereabouts.

For like two petulant children, Union and Central had built past each other; several kilometers led to nowhere, which later had to be united by a connecting line. What was the reason for this?

Envy and greed, of course, but above all: Union and Central were two closed systems. They were blind and deaf to each other.

In the same way, blockchains and outside data (weather, election results, etc) are blind and deaf to each other — they need a connecting line: oracles.

That’s why you’ll learn in this article:

  • What blockchain oracles are,
  • What types of oracles exist,
  • Where you can use oracles
  • And (as an example) how the MGH DAO feeds NFT valuation data into smart contracts.

What are Blockchain Oracles — How Data Gets onto the Blockchain

Oracles are a bridge converting off-chain data into on-chain data. What do these two terms mean?

  • Off-chain data: This is data stored outside the blockchain — election results, the weather, the outcome of the World Cup… This data comes from the outside, from the “centralized” world.
  • On-chain data: This is data stored on the blockchain. For example: Did this public address sign its transaction with its private key? Can the smart contract perform the desired transaction? What are the gas fees on Ethereum? The blockchain can quickly establish consensus on this — i.e., simply agree on this data.

Oracles, then, are a bridge that brings data onto the Blockchain. Importantly, just as weather reports don’t make the weather, oracles don’t make the data. They merely transport it.

Alright, but who needs the data? Smart Contracts.

These are self-executing contracts that act like if-then functions: IF x happens, THEN y follows. An example:

You borrow the Stablecoin Dai on the lending protocol Aave by depositing Ether as collateral. Everything is fine so far, but suddenly a frosty crypto winter hits the market — your Ether rapidly lose in value, your loan is no longer covered and you are liquidated:

Aave therefore automatically sells your Ether to close the loan. But how does Aave know what the price of Ether is?

Through an oracle: it gives the price to the smart contract that sells your collateral.

But what kind of oracles are there? After all, the Greeks didn’t just have the Oracle of Delphi either.

True. Oracles come like a color palette in different gradations — from centralized to decentralized. Let’s take a look at that now:

What Types of Blockchain Oracles Are There?

Before we get into the nitty-gritty, here is the framework on how oracles are built:

  • Inbound vs. Outbound Oracles: inbound oracles bring data to the blockchain — outbound oracles route it from the blockchain to the “real” world.
  • Software vs. Hardware Oracles: software oracles pull data from servers, databases, price feeds — hardware oracles from sensors, barcodes, etc…

But now to the finer points:

1. Centralized Oracles

Here only one central party provides the data. This is fast and efficient but has one problem: garbage in, garbage out. If the smart contract gets the wrong data, it also sends the wrong results. How can this happen?

Centralized oracles are vulnerable — they could be malicious, hacked, or fail like a car in the middle of nowhere in a horror movie.

Therefore, think of centralized oracles like a running back in football: he has the ball (data) firmly in his hand, sprinting to the end zone (smart contract), the touchdown is near…but there is always the risk that an opposing player will knock him down and brutally throw him to the ground.

2. Distributed Multi-Sig Oracles

Here you have multiple central parties — maybe three, five, seven… The improvement? It’s the majority rule that determines what the better data is. An example:

Five Oracles have to feed into the blockchain which country won the last World Cup.

(I don’t know what for, but let’s just assume it).

Four node operators say France, one Croatia — four against one vote. Therefore, the smart contract is activated with France, not Croatia.

3. Delegated Proof-of-stake Oracles (DPos Oracle).

These oracles work like contracts in ancient times: you have to provide a hostage to keep your end. What does that mean?

A node (data provider) stakes a certain number of coins or tokens (the hostage) to be allowed to deliver data. So, the node operator has an expensive incentive to provide the correct data.

If the node sends the wrong information, some of the staked coins or tokens will be slashed.

4. Decentralized Oracle

Decentralized Oracles are an open network of independent data providers that seek consensus — i.e.: they agree on the right outcome. Similar to a blockchain.

Decentralized oracle network for ETH / USD powered by Chainlink

Feel free to check out more decentralized oracle networks powered by Chainlink here.

Those were roughly the main types of oracles. But where are they needed? Where can you use them? Where do they improve your life?

Where Can You Use Blockchain Oracles?

  • Decentralized Finance: protocols like Synthetix, Aave or Maker need data from outside. What is the price of gold? Or Ether? This data comes via oracles.
  • Supply chains: Did the tanker deliver the roses from Colombia to New York? A hardware Oracle could answer that: an employee scans the container with the roses, feeds the data into a smart contract, and thus activates the next step — the delivery is there, the truck can pick it up.
  • On-chain audits: stablecoins should be transparently backed 1:1, otherwise they would have a trust issue. How might Oracles help here? An independent auditor checks the assets and feeds the results into an oracle: Yes, the stablecoin is covered — or not. This could automatically trigger a smart contract to issue more stablecoins or to buy some back.
  • Betting: Who will be World Champion? Who will knock out his opponent in the next UFC fight? You can bet on that in a betting protocol (like Augur). Via an Oracle, the protocol knows who has won; and the smart contract automatically pays you your winnings — or not.

These were only four examples. The possibilities are far from exhausted and many will still arise when blockchain technology gradually becomes mainstream in many industries. And therefore, also need blockchain oracles.

So, let’s play through one more example at the end, and that’s MGH — a protocol that, together with Chainlink, will feed NFT price data into smart contracts.

How the MGH Protocol Feeds NFT Prices into Smart Contracts

An exceptional use case of MGH (MetaGameHub DAO) is to fairly price NFTs. So far, their valuation is more opaque than John Carpenter’s “Fog of Horror.” You’re relying on feelings, hype, and FOMO — not reliable, verifiable data. Suboptimal!

In contrast, MGH has developed an AI-driven algorithm that analyzes NFTs using trading and sentiment data, thereby blowing away the fog like an autumn storm.

MGH wants to make this NFT data available to other developers and games so they can use it in their smart contracts: for example, you can lend NFTs or use them to collateralize a loan (like Aave on NFTs).

But how does MGH get the algorithm data onto the blockchain?

For that, MGH partners with Chainlink — the largest blockchain oracle — and runs a Chainlink Node.

What it is?

The Chainlink Node is the link between the NFT data and the smart contracts. It is connected to the algorithm via API and forwards the data directly to the smart contracts. This way, anyone can get NFT valuations from MGH if they want to buy them.

The revolutionary part?

Finally, developers can exploit reliable NFT pricing data to merge decentralized finance and NFTs in new protocols like merging cola and orange soda in a Mezzo Mix.

How can you stay up to date and keep in touch with MGH?

About MGH

MGH is an Ethereum-based protocol allowing its users a.) to mint NPTs to gain exposure to the NFT space, b.) stake their NFTs to earn network rewards passively, and c.) get a fair price for their NFT via the MGH pricing algorithm and oracle.

With these three use cases, MGH aims to make the NFT space more transparent (fairer prices), accessible for investors with smaller pockets (via NPTs), and combines DeFi and NFTs via staking NFTs to make a passive income.

In short: MetaGameHub DAO is the convergence of DeFi, NFTs, the metaverse, oracles, and AI-supported valuation tools.

--

--

METAGAMEHUB DAO

MetaGameHub DAO combines Utility, Governance & Data in one holistic Ecosystem to allow transparent NFT Valuation and Curation within the Metaverse