{"id":12466,"date":"2022-07-12T12:30:00","date_gmt":"2022-07-12T12:30:00","guid":{"rendered":"https:\/\/hederav2stg.wpenginepowered.com\/learning\/blockchain-oracle\/"},"modified":"2025-12-04T22:16:52","modified_gmt":"2025-12-04T22:16:52","slug":"blockchain-oracle","status":"publish","type":"learning","link":"https:\/\/hedera.com\/learning\/blockchain-oracle\/","title":{"rendered":"Blockchain Oracle: How Smart Contracts Talk to the World"},"content":{"rendered":"<p dir=\"ltr\">Blockchain oracles are an essential component of decentralized finance. Although smart contracts are self-executing, they typically need information from outside the chain. Blockchain oracles supply that information.<\/p>\n<p dir=\"ltr\">As computer code living on the blockchain, smart contracts are designed to be immutable in a trustless environment. Once they go live, the terms of the contract, which is the same as saying the coding of the contract, cannot be changed. That makes sense. If you signed a contract to buy a car, you wouldn&#8217;t want the dealership calling the next day to say they updated the contract and the car now costs $10,000 more. The terms of a smart contract must be immutable for the contract to have any meaning.<\/p>\n<p dir=\"ltr\">Smart contracts also are self-executing through automated processes. Once certain conditions have been met, they trigger the next step in the contract. It&#8217;s often referred to as &#8220;If &#8230; then&#8221; logic. But how does the smart contract know if conditions have been met? A <strong>blockchain oracle<\/strong> tells it. And how does the smart contract tell another party to, for example, send payment on a peer-to-peer network to a contract holder. It uses an oracle. <\/p>\n<p dir=\"ltr\">Let\u2019s take the example of a smart contract used for betting on soccer. Without access to a real-time data source for soccer scores, this smart contract cannot function. Furthermore, if the smart contract receives incorrect data, the wrong people might receive payouts. Because the blockchain is immutable, those trustless transfers of assets could not be reversed.<\/p>\n<h3 dir=\"ltr\">What is a blockchain oracle?<\/h3>\n<p dir=\"ltr\">A &#8220;blockchain oracle&#8221; is a method of feeding information into a smart contract. (The term &#8220;oracle&#8221; has its roots in ancient Greece, where certain individuals, usually women, were given that title. They were believed to have the power to channel messages from the gods to mortals.) Now, oracle providers channel messages from data sources to <a href=\"https:\/\/hedera.com\/learning\/smart-contracts\/what-are-smart-contracts\" target=\"_blank\">smart contracts<\/a>. Smart contract developers leverage oracles to bring a contract to life.<\/p>\n<p dir=\"ltr\">However, an oracle must maintain accuracy through robust data validation processes. Oracles sometimes need to reconcile different sources of information and feed them into a smart contract. With only one chance to get things right on an immutable distributed ledger, users must have confidence in the data integrity.<\/p>\n<p dir=\"ltr\">Let\u2019s go back to our example of a smart contract for betting on soccer. An application programming interface, or API, is software that enables one computer or program to communicate with another computer or program. Sound familiar? Dozens of APIs might be used to supply soccer scores for different applications. An oracle, which itself is an API, would take these data feeds and compare the scores from each source. That oracle-API calls the smart contract to give it the correct score so the right bettors can be paid off.<\/p>\n<h3>The oracle problem<\/h3>\n<p dir=\"ltr\">The blockchain agrees upon data values through consensus and cryptographic proofs. Determinism enables individual nodes to reach a consensus. A blockchain oracle can connect a <a href=\"https:\/\/ethereum.org\/en\/developers\/docs\/dapps\/#definition-of-a-dapp\" target=\"_blank\">deterministic blockchain<\/a> with off-chain data. In other words, an off-chain oracle will gather information and report it on-chain for secure transactions. This is why oracles are often referred to as middleware in the cryptocurrency world.<\/p>\n<p dir=\"ltr\">However, there is something called the oracle problem. The whole point of smart contracts and tokenization in <a href=\"https:\/\/hedera.com\/learning\/decentralized-finance\/what-is-decentralized-finance\" target=\"_blank\">decentralized finance<\/a> is that they are decentralized. They don&#8217;t require third parties to slow things down, exert undue influence, and inflate costs. But the use of oracles \u2014 centralized sources of information \u2014 can be a point of failure.<\/p>\n<p dir=\"ltr\">However, oracle solutions like <a href=\"https:\/\/chain.link\/\" target=\"_blank\">Chainlink<\/a> can prevent oracles from nullifying the advantages of decentralization while addressing the security risks associated with external data. Chainlink has become the standard for decentralized oracles. It is an open-source effort to provide tamper-proof inputs and outputs to support smart contracts on blockchain networks.<\/p>\n<h3 dir=\"ltr\">How are oracles used in smart contracts?<\/h3>\n<p dir=\"ltr\">By looking at the most common types of oracles, we can better understand how they work with smart contracts in a trustless environment.<\/p>\n<h3 dir=\"ltr\">Hardware oracles<\/h3>\n<p dir=\"ltr\">Hardware oracles are physical sensors with API capability. Take the example of hurricane insurance on a smart contract. The insurance provider might use physical sensors to measure wind speed. If the sensors record speed of a certain intensity, the hardware oracle notifies the smart contract. The smart contract executes the terms and notifies another oracle to send the policyholder a check.<\/p>\n<h3 dir=\"ltr\">Software oracles<\/h3>\n<p dir=\"ltr\">Software oracles collect data from third-party sources, including public APIs and financial markets. For example, for flight delay insurance, the data source could feed information on flight status to the smart contract. If the policyholder\u2019s flight is delayed, the computer code on the smart contract will execute a compensation transaction.<\/p>\n<h3 dir=\"ltr\">Consensus oracles<\/h3>\n<p dir=\"ltr\">Consensus oracles use aggregated data from various oracles with proprietary methods to verify data accuracy and legitimacy. These act as decentralized oracles, or at least represent a move toward decentralization through consensus. They compile and analyze multiple data sources, like price feeds from financial markets, to reach one validated data point.<\/p>\n<h3 dir=\"ltr\">Cross-chain oracles<\/h3>\n<p dir=\"ltr\">Cross-chain oracles enable<a href=\"https:\/\/hedera.com\/learning\/what-is-asset-tokenization\" target=\"_blank\"> tokenization<\/a> and allow for interoperability between data and assets moving between blockchain networks. For instance, you could use data on one blockchain to trigger specific automated processes on another blockchain. Also, cross-chain oracles allow you to bridge assets for use outside their native blockchain.<\/p>\n<h3 dir=\"ltr\">Inbound oracles<\/h3>\n<p dir=\"ltr\">Inbound oracles transmit data from external sources to smart contracts. These work when a smart contract needs external data \u2014 like weather data, supply chain tracking updates, and other reports of real-world events \u2014 to trigger the correct response.<\/p>\n<h3 dir=\"ltr\">Outbound oracles<\/h3>\n<p dir=\"ltr\">Outbound oracles allow smart contracts to send information to off-chain sources. For instance, if funds need to be deposited to an address, a smart contract could send data through an outbound oracle to a mechanism that will make it happen.<\/p>\n<h3 dir=\"ltr\">Computation oracles<\/h3>\n<p dir=\"ltr\">Oracle computation uses decentralized oracle networks (known as DONs) to execute off-chain computation for smart contracts. It is much less expensive to crunch data off the blockchain than on it, so computation oracles increase the scalability of smart contracts. This type of oracle can help to create trust-minimization guarantees as they remain anchored to blockchain technology.<\/p>\n<h3 dir=\"ltr\">Common oracle set-ups<\/h3>\n<p dir=\"ltr\">The three main ways to set up an oracle solution are usually categorized as immediate-read, publish-subscribe, and request-response.<\/p>\n<ul>\n<li dir=\"ltr\">\n<p dir=\"ltr\"><strong>Immediate-read<\/strong> oracles provide data that is usually desirable for a fast, prompt decision. This type of information is often required on a last-minute, just-in-time basis.<\/p>\n<\/li>\n<li dir=\"ltr\">\n<p dir=\"ltr\"><strong>Publish-subscribe<\/strong> oracles offer a broadcast service to provide information that may frequently vary. Much like an RSS feed, the oracle updates with new information and \u201cflag signals\u201d indicating new information is available to those who are \u201csubscribed.\u201d<\/p>\n<\/li>\n<li dir=\"ltr\">\n<p dir=\"ltr\"><strong>Request-response<\/strong> oracles are used for all-encompassing and expansive datasets that are too large to store on a smart contract. These are often used when only a small part of the overall dataset is used at any given time.<\/p>\n<\/li>\n<\/ul>\n<h3 dir=\"ltr\"><\/h3>\n<h3 dir=\"ltr\">Building bridges<\/h3>\n<p dir=\"ltr\">Hedera is uniquely positioned to lead the way on oracle development and utilization. Its<a href=\"https:\/\/hedera.com\/blog\/introduction-solidity-smart-contracts\" target=\"_blank\"> Ethereum Virtual Machine (EVM) smart contracts<\/a>, easy-to-use native tokenization and consensus service APIs enable developers to create real-time web3 applications and ecosystems that will drive the future of the internet.<\/p>\n<p dir=\"ltr\">The HBAR Foundation, an organization that supports the development of Hedera\u2019s ecosystem, partnered with the Pyth Network to integrate Pyth Price Feeds into the Hedera network. This enables DeFi builders to easily access more than 400 real-time price feeds across crypto, equities, commodities, foreign exchange, and exchange-traded funds (ETFs). Developers can use the price feeds to help them build secure and efficient DeFi apps. In addition, developers and Hedera users can leverage Pyth Price Feeds\u2019 Pull Oracle design and its continuous, low-latency access to the most up-to-date prices.<\/p>\n<p dir=\"ltr\">Chainlink, the dominant oracle network and a member of Hedera&#8217;s Governing Council, grants HBAR foundation developers access to Chainlink (LINK) data feeds and the Chainlink Contractor-Controlled Insurance Program (CCIP). Thus, HBAR developers can launch the oracle\u2019s data feeds immediately on Hedera\u2019s testnet as they create dApps (decentralized applications) on Hedera\u2019s native platform.<\/p>\n<p dir=\"ltr\">Chainlink also has launched an effort to blend<a href=\"https:\/\/www.forbes.com\/sites\/lawrencewintermeyer\/2024\/11\/07\/big-financial-institutions-solve-a-31-trillion-problem-with-ai-and-blockchain\/\" target=\"_blank\"> oracles, blockchain technology, and artificial intelligence<\/a> to provide real-time, standardized data on corporate activity.<\/p>\n<p>Learn more about\u00a0<a href=\"https:\/\/hedera.com\/getting-started\" target=\"_blank\">getting started<\/a> building applications and ecosystems for the next generation of the web.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Blockchain oracles are an essential component of decentralized finance. Although smart contracts are self-executing, they typically need information from outside the chain. Blockchain oracles supply that information. As computer code living on the blockchain, smart contracts are designed to be immutable in a trustless environment. Once they go live, the terms of the contract, which [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"template":"","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"tags":[34],"class_list":["post-12466","learning","type-learning","status-publish","hentry","tag-decentralized-finance"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Blockchain Oracle: How Smart Contracts Talk to the World | Hedera<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hedera.com\/learning\/blockchain-oracle\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Blockchain Oracle: How Smart Contracts Talk to the World | Hedera\" \/>\n<meta property=\"og:description\" content=\"Blockchain oracles are an essential component of decentralized finance. Although smart contracts are self-executing, they typically need information from outside the chain. Blockchain oracles supply that information. As computer code living on the blockchain, smart contracts are designed to be immutable in a trustless environment. Once they go live, the terms of the contract, which [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hedera.com\/learning\/blockchain-oracle\/\" \/>\n<meta property=\"og:site_name\" content=\"Hedera\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-04T22:16:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hedera.com\/wp-content\/uploads\/2025\/12\/HH60178_OGHederaSite_V2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hedera.com\/learning\/blockchain-oracle\/\",\"url\":\"https:\/\/hedera.com\/learning\/blockchain-oracle\/\",\"name\":\"Blockchain Oracle: How Smart Contracts Talk to the World | Hedera\",\"isPartOf\":{\"@id\":\"https:\/\/hedera.com\/#website\"},\"datePublished\":\"2022-07-12T12:30:00+00:00\",\"dateModified\":\"2025-12-04T22:16:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/hedera.com\/learning\/blockchain-oracle\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hedera.com\/learning\/blockchain-oracle\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hedera.com\/learning\/blockchain-oracle\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hedera.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blockchain Oracle: How Smart Contracts Talk to the World\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hedera.com\/#website\",\"url\":\"https:\/\/hedera.com\/\",\"name\":\"Hedera\",\"description\":\"Hello future\",\"publisher\":{\"@id\":\"https:\/\/hedera.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hedera.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/hedera.com\/#organization\",\"name\":\"Hedera\",\"url\":\"https:\/\/hedera.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hedera.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/hedera.com\/wp-content\/uploads\/2025\/09\/hedera_logo.png\",\"contentUrl\":\"https:\/\/hedera.com\/wp-content\/uploads\/2025\/09\/hedera_logo.png\",\"width\":500,\"height\":375,\"caption\":\"Hedera\"},\"image\":{\"@id\":\"https:\/\/hedera.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Blockchain Oracle: How Smart Contracts Talk to the World | Hedera","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hedera.com\/learning\/blockchain-oracle\/","og_locale":"en_US","og_type":"article","og_title":"Blockchain Oracle: How Smart Contracts Talk to the World | Hedera","og_description":"Blockchain oracles are an essential component of decentralized finance. Although smart contracts are self-executing, they typically need information from outside the chain. Blockchain oracles supply that information. As computer code living on the blockchain, smart contracts are designed to be immutable in a trustless environment. Once they go live, the terms of the contract, which [&hellip;]","og_url":"https:\/\/hedera.com\/learning\/blockchain-oracle\/","og_site_name":"Hedera","article_modified_time":"2025-12-04T22:16:52+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/hedera.com\/wp-content\/uploads\/2025\/12\/HH60178_OGHederaSite_V2.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/hedera.com\/learning\/blockchain-oracle\/","url":"https:\/\/hedera.com\/learning\/blockchain-oracle\/","name":"Blockchain Oracle: How Smart Contracts Talk to the World | Hedera","isPartOf":{"@id":"https:\/\/hedera.com\/#website"},"datePublished":"2022-07-12T12:30:00+00:00","dateModified":"2025-12-04T22:16:52+00:00","breadcrumb":{"@id":"https:\/\/hedera.com\/learning\/blockchain-oracle\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hedera.com\/learning\/blockchain-oracle\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hedera.com\/learning\/blockchain-oracle\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hedera.com\/"},{"@type":"ListItem","position":2,"name":"Blockchain Oracle: How Smart Contracts Talk to the World"}]},{"@type":"WebSite","@id":"https:\/\/hedera.com\/#website","url":"https:\/\/hedera.com\/","name":"Hedera","description":"Hello future","publisher":{"@id":"https:\/\/hedera.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hedera.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hedera.com\/#organization","name":"Hedera","url":"https:\/\/hedera.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hedera.com\/#\/schema\/logo\/image\/","url":"https:\/\/hedera.com\/wp-content\/uploads\/2025\/09\/hedera_logo.png","contentUrl":"https:\/\/hedera.com\/wp-content\/uploads\/2025\/09\/hedera_logo.png","width":500,"height":375,"caption":"Hedera"},"image":{"@id":"https:\/\/hedera.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/learning\/12466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/learning"}],"about":[{"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/types\/learning"}],"author":[{"embeddable":true,"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/users\/4"}],"version-history":[{"count":0,"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/learning\/12466\/revisions"}],"wp:attachment":[{"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/media?parent=12466"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/tags?post=12466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}