top of page

Understanding How Oracles Validate Data

  • Writer: kris baerwald
    kris baerwald
  • Jul 24
  • 2 min read
High angle view of a digital representation of blockchain transactions

Oracles validate data before sending it to a blockchain through a combination of processes to ensure accuracy, reliability, and security.


Step-by-Step example using Chainlink, validating ETH/USD price data


  1. Data Source Selection:

    • Chainlink’s computers are configured to fetch ETH/USD price data from multiple trusted sources, such as centralized exchanges like Coinbase, Binance, Kraken and market aggregators like CoinGecko and CoinMarketCap.


  2. Data Retrieval by Nodes:

    • Multiple independent Chainlink computers (e.g., 21 computers for a typical Chainlink Price Feed) query the APIs of these websites simultaneously to retrieve the latest ETH/USD price.

    • For instance, Node A might fetch $2,500 from Coinbase, Node B gets $2,498 from Binance, and Node C gets $2,502 from Kraken.


  3. Data Authentication:

    • Each node verifies these websites are who they say they are, by using cryptographic methods, such as checking the sites certificate or API keys provided by that site or business. This ensures the data comes from the legitimate source and hasn’t been manipulated during transmission.


  4. Data Aggregation and Consensus:

    • The Chainlink computers/nodes then submit their retrieved prices to a Chainlink smart contract on the Ethereum blockchain.

    • The smart contract uses a process to calculate the final price.

    • For example:

      • Node A: $2,500

      • Node B: $2,498

      • Node C: $2,502

      • Node D: $2,600 (may be an outlier due to a faulty API call)

    • The median price (e.g., $2,500) is selected, filtering out outliers like Node D’s $2,600.


  5. Data Freshness Check:

    • The Chainlink computers and the smart contract verify that the data is recent, based on predefined parameters, such as "the price must be from within the last 60 seconds".

    • If a computer submits stale data it’s rejected by the smart contract.


  6. Node Reputation and Weighting:

    • Chainlink tracks the historical performance of its own computers. Those computers with a proven track record of providing accurate and timely data may have their submissions weighted more heavily in some configurations.

    • If a node/computer consistently submits incorrect data, like Node D, its reputation score may decrease and reducing its influence in future aggregations.


  7. On-Chain Submission:

    • The smart contract finalizes the validated price ($2,500) and signs it with a cryptographic signature to ensure integrity.

    • This price is then stored in a different contract, let's call it the "Chainlink ETH/USD Price Feed" on the Ethereum blockchain.


  8. Smart Contract Consumption:

    • Now a DeFi lending protocol can query the Chainlink ETH/USD Price Feed contract on the Ethereum blockchain to retrieve the validated price.


  9. Security and Monitoring:

    • Chainlink’s network continuously monitors its computers for uptime and accuracy. If a node behaves maliciously or fails to provide data, it may be penalized or removed from the network.

    • The Price Feed contract also includes deviation thresholds (e.g., only update the price if it changes by more than 0.5%) to prevent unnecessary updates and save gas costs.


Real-World Context


This process is actively used by DeFi protocols like Aave, Compound, or Synthetix, which rely on Chainlink Price Feeds to secure billions of dollars in value. For instance, Aave uses Chainlink’s ETH/USD feed to ensure loans are not undercollateralized, protecting the protocol from market volatility or manipulation attempts.



Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

Support our cause

Leave a one-time donation

Donate in the name of
Donation
$2
$5
$10
  • Facebook
  • Instagram
  • X
  • TikTok

(Coming Soon)

Stay Updated on Crypto

© 2035 by crypto in the real world . Powered and secured by Wix 

bottom of page