BiB Exchange: The Oracle of Exploring Hidden Corners

CN
1 year ago

The future development direction of oracles will be influenced by the demand for blockchain and smart contract ecosystems, technological innovation, and regulatory environment.

Authored by: BiB Exchange

According to data from the BiB Exchange official website, on June 10, 2023, the price of LINK was 4.7 USDT, and by December 10, 2023, it had reached 17 USDT, a nearly 300% increase in six months! It is one of the projects in the top 15 by market value (currently ranked 12th), with one of the largest increases, far exceeding leading mainstream coins such as BTC, ETH, as well as L2 track, Litecoin, platform coins, and scalability projects.

www.bibvip.com

I. Definition of Oracles

Oracles are tools that bring real-world data into the blockchain, connecting the blockchain system with real-world data. Oracles extract data from the real world and introduce it to the blockchain for smart contracts to call and use. They enable the blockchain system to securely and reliably use external data, expanding the application scope of smart contracts.

Here, it is important to understand what a "smart contract" is. When we talk about smart contracts, we usually refer to narrow smart contracts, which are code segments run at specific addresses on the blockchain by programmers and developers, serving a function of invocation, allocation, or smart matching. The essence of smart contracts is the automatic execution of multi-party agreements upon meeting specific conditions.

However, due to the deterministic environment of the blockchain, uncertain events are not allowed to occur. In other words, smart contracts usually produce consistent results, so related virtual machines prohibit smart contracts from making network calls and performing I/O. Therefore, smart contracts can only access on-chain data and cannot actively obtain off-chain data, only passively receiving data. This is where oracles come in as the link between the real world and on-chain information.

The BiB Exchange asset management team believes that oracles, through their bridging role, empower smart contracts to use external data as input and execute logic based on this input, which is crucial for decentralized prediction markets that rely on external information. Oracles themselves are not the original providers of data, but rather an intermediary layer that queries, verifies, and authenticates external data sources. They filter and ensure the accuracy of data, then transmit the data to the blockchain in a trusted form. Oracles establish a bridge between on-chain smart contracts and off-chain data nodes to facilitate data transfer.

II. Use Cases of Oracles

Let's take an example. During the 2022 World Cup, Cosmo predicted that Argentina would win the World Cup, so he bet 10 ETH on Argentina to lift the trophy. In this scenario, decentralized prediction market applications would require oracles to confirm the result of the World Cup, with predictive factors coming from various off-chain sources such as betting odds from major online betting companies, sports lottery odds, and offline handicaps; on-chain factors include personnel configurations of the opposing teams, referees, coaches, and even the excitement levels of players like Messi, Martinez, Griezmann, and Mbappe to determine the final champion. It would also assess Cosmo's spending habits, savings situation, recent payment records, and other off-chain information to determine if Cosmo is eligible to make payments.

Oracles have wide applications in financial derivatives trading platforms, lending platforms, the Internet of Things (IoT), package tracking, stablecoins, gambling games, insurance, prediction markets, and more. The BiB Exchange team believes that especially in the DeFi field, stablecoins, decentralized leveraged trading projects, and others all require oracles to provide external data.

1. Oracles in the Gambling Industry

Most gambling games generate random numbers online, or more commonly control the probability of opponent odds through algorithms. Using oracles to accurately predict outcomes at this stage would reduce the randomness and appeal of gambling, harming the profitability of the gambling industry. Conversely, if the house uses opponent odds, ordinary players would find it difficult to compete with the predictions made by oracles, which would be unfair.

The core of gambling games is unpredictable and verifiable random numbers, which determine the final outcome of bets. However, it is impossible to generate random numbers on-chain, or the random numbers on-chain can be predicted and cracked. In such cases, oracles are needed to provide smart contracts with secure and unpredictable random numbers from external sources. Therefore, for gambling companies, oracles are both a blessing and a curse. When used effectively, they can analyze user consumption and betting habits through big data. Without the defensive technical means of oracles, assets could be stolen by network hackers.

2. Use Cases of Oracles on the Blockchain

Next, let's follow the perspective of the BiB Exchange team to understand the process of using oracles:

  1. Data Provision: Oracles obtain relevant data from external sources (such as price information sources, exchanges, etc.).
  2. Data Verification: Oracles typically use mechanisms to verify the authenticity and accuracy of the data they provide. This can include comparing multiple data sources, digital signatures, etc.
  3. Data Submission to the Blockchain: Once the data is verified, oracles submit this data to the Ethereum blockchain for use by smart contracts.
  4. Execution of Smart Contracts: Smart contracts execute corresponding operations based on the data provided by oracles, such as adjusting collateral ratios, updating the supply of stablecoins, etc.

Through this simple process, it is clear that oracles are widely used in DeFi projects. DeFi projects extensively use oracles to provide asset prices, collateral values, interest rate information, etc. Popular "price oracles" in decentralized finance include Chainlink Price Feeds, Compound Protocol's Open Price Feed tool, Uniswap's Time-Weighted Average Price (TWAP), and Maker Oracles.

Demand for MakerDAO

Oracles play three roles in MakerDAO: first, MakerDAO needs to periodically assess the value of collateral to ensure that it adequately supports the issuance of stablecoins. Oracles provide external data to help the system determine the real-time value of collateral.

Secondly, oracles are used to predict the price of the DAI stablecoin. They integrate data from multiple oracles to adjust the collateral ratio based on this data, control the issuance of DAI to maintain its soft peg to 1 USD.

Finally, oracles can provide data for various parameters of the system, such as stablecoin interest rates, minimum collateral requirements, etc. This helps adjust the system to adapt to market changes.

Oracles on Curve

Curve uses oracles to obtain external data to provide accurate price information, which affects the operation of the protocol and the earnings of liquidity providers. Curve uses a mechanism called the "oracle price feed mechanism," which is a process of obtaining asset prices through oracles. Some key aspects typically associated with the oracle price feed mechanism on Curve include a multi-source price feed combined with a weighting scheme, different weights for different data sources, a consensus mechanism to determine asset prices, and a mechanism for frequent updates.

III. Classification of Oracles

The classification of oracles is mainly based on the general standards of oracles. They are typically composed of on-chain smart contracts and some off-chain components. On-chain contracts receive data requests from other smart contracts and transmit these requests to off-chain components (referred to as oracle nodes). These oracle nodes can query data sources—such as using application programming interfaces (APIs)—and send transactions to store the requested data in the storage of smart contracts. Based on different classification criteria, the BiB Exchange asset management team classifies oracles into the following categories:

1. Classification Based on Key Data

Key differences mainly involve data sources, trust models, and system architectures. The following is a classification of the factors mentioned:

  • Data Sources: One of the key differences of oracles is the source of their data. Oracles may obtain information from one or multiple external data sources, which can include various data on the internet, such as weather, prices, event results, etc.
  • Trust Model: The trust model of oracles refers to the level of trust people have in the credibility and security of the data they provide. Centralized oracles are controlled by a single entity, while decentralized oracles enhance data reliability through multiple information sources and consensus mechanisms.
  • System Architecture: The system architecture of oracles describes their interaction with the blockchain and the external world. This includes three main models: immediate read, which involves real-time data retrieval; publish-subscribe, which involves subscribing to specific events and receiving notifications when they occur; request-response, which involves actively requesting data from oracles when needed and waiting for a response.

2. Degree of Centralization Classification

1) Centralized Oracles: Centralized oracles are controlled by a single entity responsible for aggregating off-chain information and updating oracle contract data as requested, which makes them efficient.

Risks of single points of failure: Oracle providers may have a "good reputation," but this does not rule out the possibility of human misconduct or hacking compromising the system.

Vulnerability of smart contracts to attacks: If oracles are compromised, smart contracts will execute based on incorrect data.

Poor incentive compatibility: The incentive design of centralized oracles is often imperfect, and incentive data may not be accurately transmitted.

A typical example of a centralized oracle service mechanism is Oraclize. Oraclize acts as an intermediary between smart contracts and external data sources. It retrieves various data from the internet, such as weather information, stock prices, sports match results, etc., which are required by smart contracts but cannot be directly obtained from the blockchain. Oraclize's oracle service is centralized, meaning that Oraclize is responsible for running and maintaining these services. This also means that the company has the ability to control and provide external data. It is based on Amazon AWS services and TLSNotary technology, providing a verifiable and honest oracle service.

2) Decentralized Oracles: Decentralized oracles aim to break the limitations of centralized oracles by eliminating single points of failure. Decentralized oracles attempt to ensure data correctness using different methods, including using proofs to verify the authenticity and integrity of returned information, and requiring multiple entities to collectively agree on the validity of off-chain data.

Avoidance of single points of failure: Decentralized oracle services consist of multiple participants in a peer-to-peer network. After reaching consensus among multiple participants, they send data to smart contracts, proving the authenticity and integrity of returned information, and requiring multiple entities to collectively agree on the validity of off-chain data.

Enhancement of data reliability, emphasizing Transport Layer Security (TLS) proof and Trusted Execution Environment (TEE) authentication. The former is used by oracle nodes to typically retrieve data from external data sources using secure HTTP connections based on the Transport Layer Security (TLS) protocol. Some decentralized oracles use authenticity proofs to verify Transport Layer Security sessions (i.e., confirming the exchange of information between nodes and specific servers) and confirm that the session content has not been altered.

Trusted Execution Environment (TEE) authentication: TEE is a sandboxed computing environment that is isolated from the operating processes of the host system. TEE ensures the integrity, confidentiality, and immutability of any application code or data stored/used in the computing environment. Users can also generate an authentication to prove that an application instance is running in a trusted execution environment.

Decentralized oracles adopt different incentive designs to avoid Byzantine behavior in oracle nodes.

3. Other Classification Methods for Oracles

1) Software Oracles

Process online data, analyze trends and patterns based on current historical data, and use machine learning, data mining, and other algorithmic technologies to improve prediction accuracy.

Continuously collect market information and input new data, as well as improve prediction algorithms, upgrade software, improve models, and the software itself to make prediction results more accurate.

2) Hardware Oracles

Process physical world data, such as computational oracles that execute computing tasks off-chain. This can be to improve efficiency, reduce the burden on the blockchain, or perform tasks that require a large amount of computation.

Use customized hardware circuits to perform pattern recognition and prediction using a connection method that simulates biological neural networks, such as sensor data.

Hardware systems are generally more rigid, making it difficult to modify and upgrade, and the performance and prediction capabilities are related to hardware performance.

3) Inbound and Outbound Oracles

Inbound: External data input; this refers to oracles retrieving external data and providing it for use by on-chain smart contracts. For example, obtaining real-time price data to adjust financial contracts.

Outbound: Data output; sending information from the blockchain to off-chain applications. This may involve transmitting the execution results of smart contracts to external systems, affecting real-world behavior.

4) Consensus-Based Oracles

Data from prediction markets; market-making oracles are composed of off-chain peer-to-peer node networks ("relayers" and "feeders") that submit collateral asset market prices and an on-chain "medianizer" contract to prevent market manipulation.

Schelling point mechanism; this can be an extension of the game theory concept in "BiB Exchange: A Comprehensive Revelation of the Game Phenomenon in the Cryptocurrency Industry," which assumes that multiple entities choose a solution to the same problem without any communication.

IV. Specific On-Chain Projects for Oracles

In the market, there are numerous blockchain oracle projects, and with the rise of DeFi in recent years, the term "oracle" has become more widely known. Below, the BiB Exchange asset management team will introduce the main oracle projects in the market:

1. Chainlink

Chainlink is a distributed oracle network that connects the blockchain with real-world data sources using off-chain nodes to provide reliable data for smart contracts. Chainlink uses multiple nodes to provide data, aggregate and verify data to ensure its reliability and security.

Everyone is familiar with the first decentralized oracle solution on Ethereum: Chainlink. Recently, Chainlink's staking program quickly raised $640 million. Its "v0.2" community staking mechanism was opened for early access at 12:00 PM Eastern Time, and approximately 32.8 million LINK tokens were staked in just 30 minutes. Six hours later, the community pool reached a new higher capacity of 40.875 million LINK tokens, and the portion reserved for the community was quickly occupied. The expanded staking pool capacity is 45 million LINK tokens, higher than the 25 million under v0.1, including the allocation of the community pool and separate node operator pools.

Why so much staking? Staking is part of the company's so-called "Economy 2.0," aimed at helping protect the security of the Chainlink system. Chainlink staking allows node operators (who help engineers access external data) and community members to support the performance of oracle services by staking LINK tokens. Participants can also earn rewards. This is also one of the reasons for the soaring price of the LINK token mentioned in the introduction.

2. Band Protocol

Band Protocol is a cross-chain oracle solution that allows blockchain smart contracts to access real-time data. It integrates multiple data sources and uses delegated nodes to provide, aggregate, and verify data to ensure high-quality data for smart contracts.

3. Pyth

Pyth is an oracle project launched by the Solana ecosystem, focusing on providing real-time financial market data. It collects, verifies, and transmits financial market data through special contracts (Oracle programs) on the Solana blockchain. Its goal is to provide low-latency and high-reliability real-time data.

4. Redstone

Redstone is a decentralized oracle project aimed at providing real-time and verifiable data for financial contracts on the blockchain. It ensures data reliability and security by using a decentralized node network to provide and verify data.

Here, the BiB Exchange asset management team has made a simple classification of oracles in the market:

V. Risks and Challenges of Oracles

The security incidents in DeFi projects emphasize the importance of decentralized oracles and also reveal the risks that centralized oracles may face. Although oracles have wide applications in the blockchain and smart contract fields, they also face some potential risks and challenges, which the BiB Exchange team believes mainly include the following aspects:

  1. Credibility of Data Sources: The reliability of oracles depends on the data sources from which they obtain information. If the data sources are not trustworthy, vulnerable to attacks, or easily manipulated, the information provided by oracles may be inaccurate or misleading.
  2. Manipulation Risk: Attackers may attempt to manipulate information by attacking the data sources of oracles or the oracles themselves, thereby affecting the execution of smart contracts. This could lead to unexpected contract execution and potential financial losses.
  3. Cost Issues: Some high-quality data sources may charge high fees, increasing the cost of using oracles. This may become a challenge for projects adopting oracles.
  4. Security and Privacy Issues: Some oracles may involve the transmission of sensitive information, making privacy and security critical concerns.
  5. Single Point of Failure: If an oracle is the sole data provider in a system, it may become a single point of failure. Once the oracle encounters issues, the entire system's functionality may be affected.
  6. Contract Security: If smart contracts overly rely on data provided by oracles and fail to handle exceptional situations properly, the contracts may be vulnerable to attacks. Engineers need to ensure that their contracts have sufficient robustness to handle different scenarios.

In the previous discussion about the use of oracles on CURVE, researcher Daniel Von Fange revealed on his Twitter that there is a risk of oracle manipulation on Curve, and this risk is difficult to detect during an attack. In detail, in most pools, an attacker can manipulate the price oracle to be 10 to 500 times higher than the normal price in just one block. This manipulation can be hidden, making it impossible to detect when viewing the pool.

Of course, the strategy to defend against Curve price oracle manipulation is as follows: First, Curve v1 pools have four factors: actual price, price oracle, lastprice, and EMA price. After a manipulation, a single transaction manipulating the priceoracle price can reset all of these to the same number.

The core attack problem is to align the actual price, fast oracle, and slow scale. The actual price is easy to control because it can be manipulated immediately. The attacker briefly raises the price and then restores it to normal in the next block, waiting for several blocks to attack until the falling price oracle encounters the rising pricescale. Maintaining the actual price at a high level for just one block is enough to disrupt the oracle, and the pricescale will follow.

In June 2019, Synthetix (a decentralized platform for issuing and trading synthetic assets, using on-chain assets as collateral to issue Synths) suffered a centralized oracle attack, losing over 30 million sETH tokens. The attack mainly involved:

  1. Synthetix relied on multiple centralized oracles to provide price information for assets such as Bitcoin, determining the exchange rates of Synths on the platform based on price data.
  2. The attacker manipulated one of the oracles, changing the price information of Bitcoin on the Synthetix platform.
  3. Based on the incorrect price information, the Synthetix platform allowed the attacker to exchange a large amount of sBTC (synthetic Bitcoin) with a very low amount of ETH as collateral.
  4. The attacker exchanged the acquired sBTC for real Bitcoin on external exchanges, earning a huge profit.

This attack exposed Synthetix's overreliance on centralized oracles and its offline reliance on a customized off-chain price feed mechanism. Ironically, in December 2019, after switching to a decentralized oracle mechanism, Synthetix suffered another attack, losing $2.6 million, due to price oracle manipulation. The specific operation of the attack was:

  1. Buy sMKR on Synthetics;
  2. Buy MKR on spot markets such as Bitfinex, Kucoin, and Uniswap to raise the price;
  3. Wait for the oracle price update on Synthetics;
  4. Short MKR on Synthetics;
  5. Sell MKR on spot markets to lower the price;
  6. Wait for the oracle price update on Synthetics, then go back to step one and repeat the process.

Attack Steps

Through the above steps, it is easy to see that even though Synthetix claims to use off-chain data, it actually still uses on-chain price data. The logic behind this operation is that attackers can manipulate the price of MKR on Synthetix by trading on Uniswap. The deep reason behind this is that the off-chain price feed that Synthetix relies on is actually based on the on-chain price of MKR, and MKR does not have enough liquidity for arbitrageurs to set the market price to the best state.

VI. Future Development of Oracles

As oracle technology continues to mature, there will be more successful DApps that interact with real-world data on the blockchain. The future development direction of oracles will be influenced by the needs of the blockchain and smart contract ecosystem, technological innovation, and regulatory environment, according to the BiB Exchange team. With the evolution of these factors, the functionality and performance of oracles are expected to continuously improve, providing more reliable, secure, and efficient external data support for blockchain applications.

Multi-modal Oracles: Oracles will not only be based on language for predictions but will also analyze various modalities of data such as images, videos, and sound for more comprehensive and accurate predictions. Oracles will not only provide prediction results but also explain their basis and reasoning chain, increasing credibility and interpretability.

Diverse Data Sources: To improve reliability and resistance to attacks, future oracles may focus more on diverse data sources. Integrating information from different sources, including multiple APIs and data providers, can reduce the risk of a single data source. Multi-dimensional predictions will no longer be based on predicting a single event but will also analyze the correlation between events for comprehensive predictions.

Continuous Upgrades of Contract Template Predictions: With the advancement of algorithms and computing power, the accuracy of oracles will continue to improve, and the prediction time range will also extend. Contract templates for specific industries or application scenarios may become more common to lower the technical barriers for contract developers, making it easier for more people to use oracle services.

Introduction of Off-chain Computing and AI: With the continuous development of technology, more advanced off-chain computing technologies may emerge, allowing oracles to handle complex computing tasks more effectively and provide more types of data. Oracles will have stronger natural language understanding and generation capabilities, enabling smoother and more human-like interactions with artificial intelligence.

Stronger Security Mechanisms: Future oracles may adopt more advanced encryption technologies and security protocols to resist evolving network attacks, ensure data integrity and reliability, and focus on solutions that are more user-friendly and protect more privacy data.

VII. Conclusion

In this article, the BiB Exchange asset management team mainly explained the basic analysis of the mechanism, significance, and underlying logic of oracles, without providing too much evaluation of specific oracle projects or future valuation analysis. However, it is easy to see that oracles currently play a crucial role in smart contracts, DeFi applications, and cryptocurrency trading. Compared to the thousands of blockchain projects in the L2 track, mature oracle projects are relatively insignificant, with perhaps only Chainlink gaining some market popularity. The BiB Exchange team believes that perhaps the projects of various future oracle giants are still in a closed room, without sunlight, moisture, and external nutrients. Once a corner of this room is opened, more oracle projects will emerge like mushrooms after rain. We believe that oracles will have outstanding performance in helping Web2 transition to the Web3 world.

References:

  1. https://ethereum.org/zh/developers/docs/oracles/
  2. https://zhuanlan.zhihu.com/p/52369816
  3. https://www.coindesk.com/tech/2023/12/08/
  4. https://redstone.finance/
  5. https://pyth.network/
  6. https://www.bandprotocol.com/
  7. https://chain.link/
  8. https://twitter.com/danielvf/status/1729966217710956991
  9. https://www.tuoluo.cn/article/detail-10034319.html
  10. https://learnblockchain.cn/article/5580

免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。

ad
出入金首选欧易,注册立返20%
Ad
Share To
APP

X

Telegram

Facebook

Reddit

CopyLink