Is Flare A Solution For Oracle?

In this article, I will attempt to discuss the current problems faced by the world of decentralized finance and how the Flare network, particularly its FTSO system, can help solve them. I will also focus on explaining the basics of Oracle systems and discuss their weaknesses to illustrate how the FTSO system addresses these shortcomings.

Updated 30/04/2024

1. Oracle

Ethereum was the first blockchain to introduce the concept of smart contracts. The Ethereum Virtual Machine (EVM), which is Turing complete, made this possible. This means that the EVM mechanism is capable of executing any algorithm, regardless of its complexity.

EVM smart contracts enable the encoding of logic in a decentralized network, which ensures transparency and verifiability of applications. As an end user, you have to trust the smart contract code and the network protocol to perform the intended function.

Blockchain Oracles — Chainlink model

Although smart contracts themselves were a significant step forward for cryptocurrencies, they wouldn’t be a complete solution without the ability to obtain data from the external world. This external data source is known as an oracle. The blockchain code remains on the blockchain and is designed to be secure and isolated. This isolation, however, prevents smart contracts from directly interacting with the external world, such as making API calls.

An Application Programming Interface (API) is a set of tools, protocols, and functions that provide an interface for programming applications. This interface enables communication between different software applications or components of information systems.

API allows developers to access the functionality and data provided by other applications or services without needing to know the internal workings of those applications. This enables developers to leverage the features of other applications within their own applications.

In blockchain, an oracle is a special type of network node that delivers information from external sources to smart contracts. The Oracle acts as an intermediary between the external world and the smart contract, providing information on which the contract can base its operations.

The information an oracle provides depends on the specific needs of the smart contract. This data can include market data, financial data, or any other external data that affects the contract’s operation. By feeding external data into smart contracts, oracles enable them to react to changes in the real world, making them more flexible and valuable. Many companies leverage oracle services within blockchain networks. These services provide smart contracts with vital data, such as cryptocurrency prices or other financial instrument information.

2. Oracle is an integral part of decentralized finance.

Decentralized finance (DeFi) is an entire ecosystem of financial applications built on blockchain technology. This system allows users to conduct financial transactions without relying on banks or other institutions. All activities, including signing binding agreements (smart contracts), can be done remotely using a smartphone. DeFi operates independently of the traditional banking system, enabling users to interact and exchange value directly with each other, without intermediaries.

Blockchain Oracle Input / Output Data

Oracles play a crucial role in the DeFi sector, bridging the real world with the blockchain world. To function and be valuable to people and organizations worldwide, DeFi applications require real-world information such as price data. Currently, the market capitalization of the top 100 DeFi projects (the total value of tokens they have issued) exceeds $120 billion (as of March 2023).

The DeFi market still relies heavily on solutions that are not fully decentralized and lack perfect security. Solving this problem through oracles is no easy feat, especially when building new solutions on top of existing architecture. In these cases, fundamentally changing the way things work becomes difficult.

As early as 2014, Vitalik Buterin identified the challenge of providing reliable market price information on the blockchain.

A key challenge for oracles lies in creating economic incentives for data providers. This ensures the prices they provide are accurate, while disincentivizing them from falsifying data. With billions of dollars flowing through the DeFi market, malicious actors pose a risk, aiming to exploit the system for personal gain. However, by financially incentivizing oracle providers to continuously deliver accurate data, the system discourages them from succumbing to the temptation of manipulation, as such actions would ultimately hurt their own financial well-being.

Commonly used and considered standard in DeFi, oracle providers don’t fully address the fundamental problem of trust due to their centralized data delivery system.

Recent history reveals numerous DeFi failures and attacks, often stemming from vulnerabilities in systems like oracles. Ethereum, the largest DeFi ecosystem, holds over 58% of the total market liquidity. The biggest DeFi attack in 2022, the Ronin bridge attack, targeted vulnerabilities in oracles, resulting in losses of 173,600 ETH and $25.5 million in USDC (valued at over $625 million at the time). Similarly, an attack on the Compound protocol, which relied on exchange APIs, led to roughly $22 million being drained.

2021–2022 Crypto thefts

Flash loan attacks often exploit the reliance of DeFi platforms on unreliable price oracles. Oracles are responsible for maintaining accurate price data for all cryptocurrencies on the platform, a challenge considering current standards. Secure but slow oracles are vulnerable to arbitrage, while fast but insecure oracles are susceptible to price manipulation. The latter is a major factor in flash loan attacks, which extracted a staggering $364 million from DeFi platforms in 2021 alone.

The Cream Finance attack exemplifies this. A series of flash loans exploited a vulnerability in how Cream calculated the “pricePerShare” variable for yUSD. This allowed the attacker to inflate the price of yUSD to double its value, sell shares, and escape with $130 million — all in a single night.

These two threats — inaccurate price oracles and poor-quality code — highlight the need for robust security measures. Decentralized price oracles can protect platforms from price manipulation by ensuring reliable price feeds. While code audits can identify vulnerabilities in smart contracts, they are not a foolproof solution. Nearly 30% of code-based attacks and a shocking 73% of flash loan attacks targeted audited platforms. This underscores the critical need for DeFi protocols managing vast amounts of user funds to adopt a multi-layered approach to platform security.

The value stolen from DeFi protocols

While exchange APIs themselves aren’t the root cause of the problem, the instability of the price data they provide can be concerning when dealing with large sums — millions or even billions of dollars — secured in positions or derivative instruments. As tokenization adoption grows, the need for a secure, accurate, decentralized, and trustless system for delivering real-world market prices becomes ever more critical. For large financial institutions considering technology adoption, real-time price data transfer to the blockchain will be essential for asset tokenization. In this scenario, a decentralized oracle solution perfectly complements decentralized finance.

3. Flare Network: FTSO Protocol

The Flare network proposes a decentralized price delivery solution on the blockchain. Leveraging key protocols like the State Connector and FTSO, it has the potential to achieve what Ethereum has not been able to do so far. These protocols are built into the Flare network’s layer 1, providing both blockchain-level security and access to value. This built-in value proposition means anyone can interact with them (e.g., through Dapps) without requiring special permissions. Permissionless access fosters an environment where anyone can build upon these protocols, which will ultimately drive future network effects.

Flare Time Series Oralce protocol

The Flare Time Series Oracle (FTSO) protocol plays a crucial role in delivering data and distributing rewards for the Flare network. The network’s creators even refer to it as the “heart” of the system.

Here’s a breakdown of how data delivery works on the Flare network: FTSO receives external data from external providers, commonly known as oracles in the blockchain world. These oracles exist off-chain, where they collect data like asset prices. They then deliver this data to FTSO on the Flare blockchain. FTSO verifies the accuracy of the data before making it available to network applications.

Advantages of FTSO protocol

4. Flare Network: Data Providers

Data providers (Signal Providers) are a critical element of the Flare Network, bridging the gap between the real world and the blockchain. These off-chain systems provide data to the Flare Time Series Oracle (FTSO) protocol, which then makes the data accessible to network applications. Signal Providers play a vital role in fostering a decentralized network, as smart contracts alone cannot interact with the world outside the blockchain. Currently, they focus on delivering reliable and accurate price data for supported tokens on the Flare network. However, their future scope extends to providing data for any real-world asset that becomes tokenized, encompassing a wide range of data types such as commodities, stocks, weather forecasts, or football match results.

To incentivize accurate data delivery, FTSO offers rewards in the form of Flare tokens (FLR) based on the quality of the provided data. Regular users can also participate by delegating their votes to chosen Signal Providers. Each FLR token represents one vote that can be assigned to a preferred Signal Provider. Vote delegation is a secure process, as users retain control over their FLR tokens and can withdraw their votes at any time without penalty.

Signal Providers deliver price data, such as currency pairs (e.g., FLR/XRP), to FTSO. The accuracy of their data determines their reward in FLR tokens. FTSO calculates accuracy by considering the weighted price of all signals for a specific asset within a defined timeframe. The weighting is based on the number of votes cast for each Signal Provider during voting cycles, which occur every 3 minutes (subject to change in the future version of the FTSO protocol, v2.0).

FTSO participants

This is a powerful mechanism that rewards signal providers for providing accurate data. Users who delegate their votes to signal providers can also achieve risk-free profits. While no FLR tokens can be lost if a vote doesn’t make it into the median, the user simply won’t receive a reward for that voting cycle.

Flare Time Series Oracle workflow

5. How Flare Solves the Oracle Problem

One of the problems in the blockchain world that the Flare Network tackles head-on is secure, reliable, and decentralized price delivery on the blockchain in a trustless manner. This challenge has remained unresolved since the inception of the Ethereum network, hindering the adoption and widespread utilization of real-world applications. Prior to the emergence of the Flare network, no fully decentralized, trustless Oracle system existed that relied on economic incentives to ensure data providers resist manipulation and are motivated to publish the most accurate information.

FTSO median price

The Flare network incentivizes data providers to deliver the most accurate real-world data, similar to how Proof of Work consensus rewards miners for securing the Bitcoin network. However, Flare’s model focuses on rewarding the delivery of accurate price data.

Furthermore, the Flare network offers a unique solution by enabling all users and token holders to delegate their token value to the most accurate price data providers and share in the profits. This approach stands apart from any other Oracle solution currently available.

Significantly, this entire process occurs at the base layer of the blockchain, eliminating the need for a separate Layer 2 protocol and its associated token. The FLR token, the native token of the Flare network’s base layer, serves multiple purposes: generating profits, granting governance rights, and acting as collateral (in the future — FAssets system).

By delegating their votes to the most accurate data providers, users can derive financial benefits and retain the flexibility to change or withdraw their votes. This system functions similarly to a liquid democracy, where rewards flow to the best and most honest price providers. Currently, over 100 independent entities participate in voting on the price of each asset, contributing to the solution’s high accuracy and decentralization. This feat is achieved by embedding the necessary protocols directly into the blockchain’s base layer and utilizing the native token as an incentive mechanism. Building a similar solution on a higher layer (Layer 2) of the Ethereum network would be hampered by limitations such as high gas fees, rendering it impractical.

Through its two integrated base layer protocols, FTSO and State Connector, the Flare Network tackles the Oracle problem across two data categories: probabilistic and deterministic data.

Probabilistic data refers to data that is uncertain or has a degree of randomness associated with it. This means that the data cannot be predicted with complete accuracy but rather with a certain degree of probability. Examples of probabilistic data include weather forecasts, stock market predictions, and medical diagnoses based on symptoms.

Deterministic data refers to data that is certain and predictable. This means that the data can be precisely predicted and calculated without any degree of randomness. Examples of deterministic data include mathematical equations, physical laws, and computer algorithms.

In summary, probabilistic data is uncertain and has a degree of randomness, while deterministic data is certain and predictable. When we ask a binary question of yes or no or one or zero, deterministic data allows for a precise answer.

6. Conclusion

Flare Network’s unique and groundbreaking approach to Oracle technology represents a significant advancement in the DeFi space. By providing a more secure, reliable, and efficient platform for executing smart contracts and processing data, Flare Network has the potential to significantly improve user experiences and increase adoption rates of DeFi applications.

Flare Network has the potential to be a game-changer in the world of DeFi. Its ability to enable interoperability and transactions between different blockchain networks through the use of its native token can enhance the adoption and integration of DeFi in various blockchain ecosystems.

Despite its well-thought-out network architecture, Flare Network still faces challenges in terms of broader adoption. One of these challenges is educating developers about the new paradigm now available on Flare and how they can leverage it to their advantage. Developers need to change their mindset from building products solely on one chain to building a much better product that can operate on multiple chains simultaneously. Most developers are effectively “locked in” to the existing model or are unaware of the possibilities offered by Flare.

As the DeFi market continues to evolve and mature, Flare Network’s approach to Oracle technology may serve as a model for other blockchain projects to follow. Flare Network’s approach tackles the shortcomings of current DeFi Oracle systems, thereby helping to build a more robust and resilient decentralized financial infrastructure that can meet the needs of users and developers.

I highly encourage you to explore the linked resources, which are largely the source materials for the above article.

Resoures:

Flare Time Series Oracle Recap: Decentralized prices
What Is an Oracle in Blockchain?
FTSO — Technical Documentation (flare.network)
Managing Delegations — Technical Documentation (flare.network)
DeFi Statistics [updated in 2023] (nansen.ai)
$22M Drained From Compound Contract That Was Hit for $80M Last Week (coindesk.com)
DeFi Hacks Are Stealing More Crypto Than Ever Before (chainalysis.com)
13 Biggest DeFi Hacks and Heists — Decrypt
Oracles in DeFi 101: A Deep Dive by Tellor | CoinMarketCap
Oracles: The Invisible Backbone Of DeFi And Applied Blockchain Apps (forbes.com)
Vitalik Buterin: 5 of the biggest challenges for cryptocurrency today — Decrypt

Leave a Reply

Your email address will not be published. Required fields are marked *