Why your Decentralized Application Needs a Decentralized Oracle

Victor Bonhomme
Jun 27, 2019 · 7 min read
If you’re building a decentralized application on Ethereum, trying to solve a real-world problem, chances are you’ll need to connect to the real world…

Today, Web 3.0 brings a new paradigm to the world. Thanks to blockchain and smart contracts, people can now have total trust in the execution of a piece of code. That’s a big deal. Some go as far as to say that “code is law”. The dream of a world without a central authority where interactions can go without middlemen becomes a reality, and decentralized applications (dapps) embody this new shift.

If earning some RLC while learning about decentralized oracles is something that interests you, make sure to check out our dev training program.

As a developer discovering the wonderland of Ethereum, your first thought when implementing a payable function in solidity with two lines of code may be “wow, that’s slick!”. And you’d be right. After trying to grasp the whole new world of possibilities that are opening up to you, the next step would be to code a smart contract that solves a real-world problem. Let’s suppose you decide to create a stablecoin. The smart contract would take the price of ETH/USD from CoinMarketCap, before then issuing your new stablecoin based on the given exchange rate. Simple enough? Wait, not so fast. You can’t query the Web 2.0 using solidity smart contract programming language. “Huh?”. No that’s right, there is no wget function in solidity. In fact, blockchains are totally siloed from the internet!

So on the one hand, you discover this new world, the Web 3.0, that offers trusted code executions. And on the other hand, you have the traditional Web 2.0, a goldmine with terabytes of valuable data.

What if you could connect these two worlds? Opening up to a whole new variety of impactful dapps…

Connecting Web 2.0 and Web 3.0

The good news is that such a bridge mechanism exists, and it is called an oracle.

What is an Oracle?

When we think about Oracle, it often evokes the thought of a happy old lady in the Matrix saga, who smokes cigarettes, bakes cookies and can tell the future. She turns out to be nothing more than a computer program integrated into the Matrix’s crucible.

In the context of Web 3.0, an oracle is a program that acts as a bridge between blockchains and the internet. It relays requests coming from the blockchain, fetches the needed data, before bringing it back to the smart contract that initiated the request. It is the simplest way to work around the connectivity limitation of Ethereum. But yet may still have some limitations.

Vulnerabilities of existing oracles

A chain is only as strong as its weakest link. Therefore, if one link is compromised, it breaks the entire chain of trust. Even if a blockchain such as Ethereum offers a very high level of trust in the execution of a smart contract, the oracle acting as a relayer could potentially tamper or interfere with the data destined to the requestor smart contract. So what happens if the Oracle is compromised?

To solve this weakness, we need to ensure that not a single party is in control of the oracle, so we don’t have to trust a centralized intermediary with the sensitive task to repatriate the data into Ethereum.

Meet with iExec DOracle, a Decentralized Oracle for Ethereum

iExec DOracle relies on the iExec cloud executing the off-chain logic before returning certified results to the blockchain. Certification is achieved using an on chain consensus (iExec’s PoCo consensus protocol) in order to ensure that the results of a DOracle execution can be trusted for the on-chain settlement of off-chain events.

Query the Web 2.0 from you smart contract in a trustless way using iExec DOracle

Addressing the connectivity limitations of the Ethereum Blockchain was a natural fit for the iExec platform, given its team research and experience in cloud computing and blockchain. Introduced with the release of iExec V3 in May 2019, the “iExec DOracle” is actually based on the iExec tech that the team has been working on over the past two years. As an Ethereum developer, if you want to build the next generation of impactful dapps, that address real-world problems,

the truth is, you’ll certainly need a way to connect your dapp to the Web 2.0.

In this case, the iExec DOracle removes each step of the sometimes painful process of maintaining an oracle:

  1. On-demand machine provisioning on the iExec decentralized cloud! Freeing any Ethereum developer to navigate AWS EC2 console to provision a machine. In fact, you don’t even need to have an AWS or Google Cloud account.
  2. Docker support! Meaning apart from fetching the data you need, you are free to add any kind of pre/post data processing in your logic, as long as you are able to dockerize it.
  3. No WEB3 library obstructing your logic! We take care of storing the result back on Ethereum without you having to write a single line of “Web3 code”.
  4. Flexible trust level! Not all the dapps need the same level of decentralization at the Oracle level. You may decide to trust a private cloud provider, or instead, you may prefer a highly decentralized on-chain consensus, using the iExec PoCo (Proof-of-Contribution) consensus protocol on a public worker pool. It is your choice.

How does the iExec DOracle compare to other oracles?

As a dapp developer, the decision to have your smart contract relying on someone else’s oracle shouldn’t be taken lightly. Apart from the 4 points mentioned above, here are the main benefits of choosing an iExec DOracle as the bridge between your dapp to real-world data:

  1. Live on Ethereum mainnet. It’s sad to say, but it’s actually worth mentioning. With so many projects popping up in the space, and only a few are actually able to serve smart contracts on Ethereum mainnet.
  2. Clear & Competitive pricing policy. iExec’s platform is built on an open Marketplace with an off-chain order-book allowing its participants to readjust their pricing depending on the current offer and demand. iExec does not decide on the price, but rather, the market does.
  3. Easy tracking & debugging of each DOracle request. As a developer, you want to be able to monitor the status of all off-chain requests. This is exactly what the iExec Explorer allows for.
  4. Secure storage of API keys used to fetch data. Chances are that the API is protected by a key/token. You would not want to leak the key you paid for, right? We have you covered. Keys can be stored and encrypted, and you can even start earning RLC with your API key by listing it on the iExec’s Data Wallet (ensure reading the API TOS before).
  5. Up-to-date documentation and a working example. No need to take our word for it, go have a look!

How to get started? Dev Training Bounty Program

We believe that spending time expanding your blockchain skills and learning iExec should be a rewarding experience, not only from a developer perspective but also financially. If earning some RLC while learning iExec is something that interests you, make sure to check out upcoming article introducing the dev training program.

💡 Want to learn more about iExec? Check out iExec Academy!

iExec Academy aggregates all content related to the project. You’ll find articles, tech documentation, videos, interactive demos, and much more! Whether you are a beginner or an expert, a developer or crypto-enthusiast, you’ll find what you are looking for on iExec Academy!

📚➡️ https://academy.iex.ec

Interested in following the iExec project? What’s next?
Before iExec V4 (the high-performance computing version with GPU support) is released this year, we’ll be giving more news on the recent developments of each of the recent announcements. To be the first to know and get exclusive updates, subscribe to the iExec newsletter and follow on social media.

WebsiteSlackTelegramTwitterFacebookLinkedInYoutubeGithubTechnical Documentation

iExec

Blockchain-based Decentralized Cloud