Why Smart Contracts Needs the Real World Data — Oracle Solutions

What Happens Without External Data?

Miyoko Shimura
Coinmonks
Published in
5 min readNov 29, 2023

--

Smart contracts are programs stored on a blockchain that run automatically when certain conditions are met.

Way back in 1994, Nick Szabo made an interesting connection — he realized smart contracts could work well like vending machines. [1] When you put money into a vending machine and punch a button, out comes your snack automatically. No human needed.

The machine includes all the necessary logic: receive cash, register button press, release item. These set conditions trigger an automated transaction between two entities.

Decentralized Applications

By using smart contracts, decentralized applications (dApps) are aiming to change industries. Decentralized applications get attention because they can resist censorship, enhance security, enable coordination without middlemen.

Examples of dApps: OpenSea, Steemit, Pancake Swap, Uniswap, 1 Inch

The programming logic on blockchains makes dApps useful in theory, but blockchains are inherently closed systems to keep data secure.

Smart contracts can only use data that already exists on that blockchain.

Without external data coming from the huge pools in the real world, dApps functions remain severely limited.

What Happens Without External Data?

If dApps are not able to access reliable external data flows, their capabilities remain severely limited because:

🏦 DeFi relies on real-time price data for managing loans and preventing losses

🚚 Supply trackers require actual GPS sensor data from ships

💚 Insurance can can instantly pay out by detecting hurricane damage data from weather station

In short, dApps disconnected from external data remain isolated islands with less value in terms of real world applications. In order to link up isolated dApps to the broader data economy, we need middleware that enables decentralized applications to replicate and exceed what Web2 apps can achieve.

Here, oracles can be the bridge that brings in the essential off-chain data flows.

What is an Oracle?

An oracle is a service that provides external data to blockchains and smart contracts. Blockchains have no inherent way to connect to off-chain data sources.

Oracles serve like bridges that bring in outside information from the real world. This could be weather data, prices from financial markets, sports scores, sensor readings from a shipment delivery, and much more.

By securely feeding in real-world data feeds, oracles enable decentralized applications to respond to events, execute conditional logic, settle complex financial contracts, trigger payments, send notifications, and do almost anything centralized platforms can achieve.

Why “Oracle”?

The term comes from the mythological concept — Ancient Greeks relied on mythical oracles as mediators between the human world and the gods/divine forces.

Blockchains rely on digital “oracles” to incorporate essential real-world information that blockchains otherwise can’t access on their own.

Photo by Etienne Dayer on Unsplash

Role of Oracles

When a smart contract combines its blockchain data and logic with the outside data supplied by oracles, it becomes a “hybrid smart contract”.

Hybrid contracts allow dApps to provide practical solutions and impacts people’s lives. These hybrid contracts mixing on and off-chain elements enable dApps to deliver immensely more practical solutions for finance, insurance, supply chains, gaming and more.

Let’s suppose. You’re developing a financial application that requires real-time stock prices for accurate portfolio valuation. You want your smart contract to autonomously fetch the current value of a specific stock. 📈

Instead of using a centralized solution with potential vulnerabilities and avoiding dependence on a single stock market API, you can choose to get data from decentralized sources like a Decentralized Oracle Network (DON).

Chainlink — A Leading Decentralized Oracle

https://chain.link/

YouTube: What Is Chainlink? By Chainlink

One notable example of a decentralized oracle is Chainlink. This is a framework for decentralized oracle networks (DONs), getting data in from multiple sources across multiple oracles.

Chainlink enables secure interactions between Ethereum projects and diverse off-chain data sources. Its native LINK token built on the Ethereum platform adheres seamlessly to the platform’s protocols.

There are other service such as: API3, Band Protocol, Tellor, DOS Network, Decentralized Information Asset, Universal Market Access, XYO Network, iExec RLC, Nest Protocol [3] (URLs retrieved in November, 2023)

From 101blockchains [3]

Use-case: Sports Star’s dNFT

From Chainlink [4]

A sports star’s dynamic NFT card can update in real-time to reflect their latest stats like goals scored, touchdowns thrown, homeruns hit based on live data feeds from an oracle service. [4]

Oracles can source real-life performance data to determine the value of cards to change the state of the card. Sounds interesting?

Conclusion

Incorporating real-world data through oracles can maximize the capabilities of smart contracts and decentralized applications (dApps). Without external data, dApps are confined and less functional.

Decentralized oracles are bridging role of such networks, providing secure off-chain data sources. Oracles enable blockchains to dynamically update in real-time based on stats, creating data-driven consensus.

References

[1] https://ethereum.org/en/developers/docs/smart-contracts/#a-digital-vending-machine

[2] https://101blockchains.com/top-blockchain-oracles

[3] https://chain.link/education-hub/dynamic-nft-use-cases

[4] https://chain.link/education-hub/dynamic-nft-use-cases

Author

Miyoko Shimura has over 8 years of engineering experience within R&D and manufacturing in the scientific measurement, bringing together analytical perspectives.

DLT Mentor at German think-tank Frankfurt School Blockchain Center and Technical Editor at Coinmonks. For further updates please follow me on LinkedIn or Twitter 🌏

Portfolio https://linktr.ee/miyokoshimura

--

--

Miyoko Shimura
Coinmonks

Friendly Tech Guidance 💛 | DLT Mentor at Frankfurt School Blockchain Center | ECOTA Fellow 🌳 BS in Computer Science from US