Why Blockchain Oracles Aren't Just Fortune Tellers with a Tech Upgrade

Explore the pivotal role of blockchain oracles in modern smart contracts. Dive into how they bridge real-world data with blockchain technology, ensuring secure, autonomous operations.

Why Blockchain Oracles Aren't Just Fortune Tellers with a Tech Upgrade

We all know by now that, in today's digital age, blockchain is transforming how contracts are executed. But some don't know how these contracts connect with real-world data remains a challenge oracles are designed to meet.

Join us in this article as we explore blockchain oracles, how they work, their potential use cases, and the role of Bitfinity in facilitating ongoing innovations like Lendfinity oracles to expand this space.

What Are Blockchain Oracles?

To understand oracles, it is important that we first recap on smart contracts. In simple terms, smart contracts are automated programs that operate on a blockchain. They execute a predetermined set of actions automatically when certain conditions are met, without the need for any intermediary.

How to deploy a Solidity Smart Contract to the Bitfinity EVM
In this Article we are going to talk about how to create a simple dapp and deploy this dapp on the Bitfinity EVM. For the sake of this Article, we will be deploying an NFT Market place. In order to follow this article and implement one yourself, we have created
Blockchain oracles are third-party mechanisms that connect blockchains and the external world, providing smart contracts with necessary external information. This enables smart contracts to make informed decisions and execute actions based on external information. 

Despite all these capabilities, smart contracts suffer a certain problem- the oracle problem…

The Problem of the Oracle

The oracle problem refers to the limitations of smart contracts to access data outside their native blockchain environment (on-chain), which denies them interaction with or access to data from the real world (off-chain). This is a problem that arises due to the isolated nature of blockchains.

Although this limitation allows blockchains their security and efficiency, addressing it is a necessity if smart contracts want to achieve their full potential. This is what blockchain oracles are made for...

To understand this better, let us take the Mary and James bet scenario.

Mary and James want to bet on the outcome of a soccer game. Mary bets $30 on team A and James bets $30 on team B, and the total $60 is held in escrow by a smart contract. At the end of the game, how does the smart contract know who to release the funds to?
The answer is that an oracle mechanism is required to fetch accurate match outcomes off-chain and convey them to the blockchain.

Now that we have understood what oracles are and their problems, let us take a look at how they work....

How Do Blockchain Oracles Work?

The functionality of a blockchain oracle involves the following step-by-step process:

  1. Data Collection: This is where the oracle gathers information from various off-chain sources depending on the information a developer wants. Data sources can come from either hardware or software.
  2. Data Processing: After collecting data, the oracle transforms it into a blockchain-compatible format, to allow easy reading during smart contract execution.
  3. Data Validation: This is where oracles employ cryptographic techniques to access and verify the purity of the external data. This step is crucial because external data might be manipulated or false, which could pose potential risks to the blockchain's integrity.
  4. Transmission to Smart Contracts: Once the data has been processed and validated, it is relayed to the associated blockchain smart contract in a coded message.
  5. Execution: Once the smart contracts have successfully read the transmitted information, they can now execute the set conditions based on real-time external events.

This workflow process allows smart contracts to interact with data such as weather conditions, asset price fluctuations, and flight status, opening doors for application of blockchain in various fields (as we will see later). But first, let us look at the types of blockchain oracles, where there are many from...

Types of Blockchain Oracles

Blockchain oracles vary in their functions and the types of external interactions they facilitate. Some of the common types are the following:

Centralized and Decentralized Oracles

Centralized oracles operate under the control of a single entity and serve as the sole provider of data for smart contracts. This centralization creates a point of failure, where if the oracle is compromised, the smart contract's security and trust is also at risk.

On the other hand, decentralized oracles, or in most cases referred to as DONs (decentralized oracle networks), aim to address the limitations of centralized oracles. They utilize multiple independent node operators and data sources to create end-to-end decentralization.

This helps eliminate the control of a single entity hence enhancing the security and reliability of data provided to smart contracts. Chainlink is a notable example of a DON.

Input and Output Oracles

Input oracles fetch data from real-world sources and deliver it to blockchain networks, where it can be used by smart contracts.

On the other hand, output oracles send data from the blockchain to the external world. This enables smart contracts to send commands to various external systems. For instance, they can trigger the unlocking of a smart lock on a rental unit when an on-chain payment is confirmed.

Cross-Chain Oracles

Cross-chain oracles facilitate data and asset transfers between different blockchains. This helps enhance interoperability and expand the capabilities of smart contracts beyond their native environments, which is very important if we want to attain the end-goal of all interoperability.

Understanding Cross-Chain Technology: Importance and Benefits for Blockchain Interoperability
Join us in this article as we uncover the cross-chain technology; a game-changer in blockchain’s interoperability, its application, challenges, and the benefits it holds for the broader blockchain community.

Compute-Enabled Oracles

These oracles provide secure off-chain computation for tasks that are complex to perform on-chain. This includes running smart contracts based on specific set conditions, generating zero-knowledge proofs for data privacy, or providing verifiable randomness for gaming applications. It is a new model of oracles mostly being utilized by Layer 2 solutions.

Redefining Bitcoin Layer-2: How Bitfinity Applies It to Bitcoin
This article explores how Bitfinity implements bitcoin functionality as a sidechain using the Internet Computer (ICP) protocol’s powerful threshold cryptography capabilities.

Hardware and Software Oracles

Hardware oracles fetch information from the physical world. This data can come from various sources like electronic sensors or barcode scanners. Essentially, they translate real-world events into digital values that smart contracts can process and act upon.

Meanwhile, software oracles fetch data from digital sources. These sources can be websites, servers, or databases. They are mostly used to track variables such as the price of an asset, real-life events, or even web service prices.

Practical Use Cases of Blockchain Oracles

Due to their capabilities, oracles have broadened their use cases across various sectors, some of which include:

Decentralized Finance DeFi

Oracles allow smart contracts in the DeFi ecosystem to access financial data about various assets and markets. For instance, software oracles provide accurate and reliable price evaluation to decentralized exchanges during asset swaps and help decentralized lending platforms keep track of crypto collateral and loans.

The Role of Infinity Swap in Decentralized Lending: How it will Disrupt Traditional Banking
InfinitySwap, a decentralized exchange (DEX) powered by Chain Key technology, offers the best of both worlds - the benefits of decentralized blockchain technology combined with the efficiency and speed of centralized platforms.

Similarly, synthetic asset platforms depend on price oracles to peg the value of tokens to real-world assets which can be used in various places like stock markets. For example, the Mirrored Google (mGOOGL), a synthetic asset, tracks the price of the Google stock with references from prices provided by a decentralized network of oracles.

Chainlink Decentralized Oracle Networks in DeFi

Supply Chain Management

In supply chain management, oracles function similarly to GPS devices, tracking the status of transactions, commodities, and data updates. Whenever there's a significant change, the oracle updates the smart contracts. A good example is the Oracle Supply Chain Management.

Prediction Markets

Also, the new hyped up prediction markets make use of oracles, as users bet on future events and need 'real' info to settle these bets. The accuracy and reliability of these bets depend on the data provided by oracles derived from the game scores. For example, the Augur prediction market platform uses an oracle to get this correct external data.

Dynamic NFTs and Gaming

Oracles also enable the creation of dynamic NFTs (non-fungible tokens), which are a new type of NFTs that change based on real-world events like the time of day. This dynamism can generate more utility for the collection which benefits the artist. To find out who benefits also from NFTs take a look at our previous article.

Who Benefits Most from the Adoption of NFTs?
Explore the transformative role of NFTs in various industries including gaming, art, and real estate. Discover how these unique digital assets are shaping the future of digital ownership.

Also, compute-enabled oracles help generate verifiable randomness for gaming applications, enhancing user engagement.

Enterprises

Cross-chain oracles also provide a secure connection to enterprises, which enables them to interact with various blockchain networks. This connection allows enterprises to read/write to any blockchain and distribute assets and data across chains and counterparties using the same oracle network.

Sustainability Initiatives

Sustainable initiatives are using oracles to aid their work for example in environmental conservation and could be used to supply environmental data to smart contracts that help them incentivize and track green practices. A manner where oracles facilitate more effective and verifiable green initiatives.

Currently, oracles are also in support of many new forms of carbon credits to counter the impacts of climate change.

We Can’t Spell Blockchain Without CO2: Leveraging Blockchain Technology for Climate Action
Discover the transformative role of blockchain in tackling climate change. This article explores how blockchain can enhance carbon accounting, renewable energy trading, and supply chain transparency…

Although oracles play a key role in broadening the use of smart contracts, they also are not infallible, and come with several problems you should be aware of...

Problems Associated with Oracles

Oracles often rely on third-party data feeds, which can be 'easily' manipulated or hacked. For instance, data owners might provide inaccurate data to influence smart contracts in their favor.

Also, the introduction of external third parties might expose the entire blockchain to hackers, which brings security concerns on all the protocols relying on the correct information.

As an example we can remember Rho Markets, which was a liquidity layer and lending protocol on Scroll, that was drained of over $7.6 million worth of USD and USDT after hackers gained access to the protocol's blockchain oracle.

On the other hand, since multiple parties have to agree on the outcome in decentralized oracles, the consensus problem arises which refers to the challenge of getting all nodes to agree on a single data value or course of action. Something familiar with 'normal' decentralized practices. Want to know how Bitfinity comes to consensus? Read our article here.

Proof-of-Useful-Work is Vastly Superior to Other Consensus Mechanisms
The Internet Computer utilizes a consensus protocol called Proof-of-Useful-Work (PoUW), which is a highly advanced mechanism that is far more efficient than the consensus methods used by other first-layer blockchain networks today.

Lastly, since oracles need to interact with real-world data, compliance with regulations is a must. This adds a layer of complexity to their operation and also may limit their usage if they are denied access to this data.

A Look into Blockchain Oracles on the ICP

As the Web3 space continues to evolve, there is a growing movement towards creating a more secure DeFi ecosystem by challenging the conventional reliance on blockchain oracles. Therefore, we must understand how oracles work on the Internet Computer, the protocol where Bitfinity is running on.

Article.md
GitHub Gist: instantly share code, notes, and snippets.

Lendfinity’s Oracles are Live!

Lendfinity, a Dapp in the Bitfinity ecosystem, is excited to announce the successful integration of Oracles, a significant milestone in its development. This integration makes the product fully operational and ready for deployment on the mainnet, emphasizing the commitment to providing a robust and decentralized lending protocol on Bitfinity’s Network.

How to Deploy Oracles on Bitfinity Network?

Here's a step-by-step guide to deploying oracles:

  1. Fork Oracular, Bitfinity's SDK for creating oracle canisters.
  2. Deploy a price feed smart contract for each token pair using Remix IDE. Record the deployed contract addresses.
  3. Create an oracle script for each token pair to set up the oracles. Use getReserves() from PancakePair.sol to calculate the price.
  4. Create a master script to call all individual oracle creation scripts.
  5. Update canister.rs to handle calling getReserves and calculate the price based on the current pair.
  6. Add necessary error handling in error.rs.
  7. Update provider.rs to log the signer's address for debugging.
  8. Fix the typo from Int to Uint in provider.rs and canister.rs.
  9. Build and run the canister using the provided build and deploy scripts. Create the oracles by running the master deploy script.
  10. Retrieve the signer's address from the logs and fund it to enable the oracles to function properly.

A detailed description can be found here.

Lendfinity’s Oracles are Live!
Lendfinity is thrilled to announce the successful integration of Oracles, marking a significant milestone in its development. With this…

Conclusion

As blockchain keeps getting more efficient, the gaps between on-chain and off-chain need to be filled. With the integration of oracles that play a pivotal role in bridging this gap, ongoing innovations find new ways to make this applicable.

As we continue to witness advancements in this area, the potential for blockchain to fundamentally alter industries and improve operational efficiencies is immense, promising a future where blockchain oracles are the glue that integrate our digital and physical worlds.

Connect with Bitfinity Network

Bitfinity Wallet | Bitfinity Network | Twitter | Telegram | Discord | Github

*Important Disclaimer: The information provided on this website is for general informational purposes only and should not be considered financial or investment advice. While we strive for accuracy, Bitfinity makes no representations or warranties regarding the completeness, accuracy, or reliability of the content and is not responsible for any errors or omissions, or for any outcomes resulting from the use of this information. The content may include opinions and forward-looking statements that involve risks and uncertainties, and any reliance on this information is at your own risk.

External links are provided for convenience, and we recommend verifying information before taking any action. Bitfinity is not liable for any direct or indirect losses or damages arising from the use of this information.