Coinbase Price-Feed DApp

This series, Dapp of the Month will feature the most innovative applications built on top of iExec, by both individual developers and enterprises. We’ll showcase what can be achieved with iExec tools and libraries, demonstrating how easy it can be to create applications, run using decentralized and confidential cloud computing.

We are excited to show you an application recently discovered by the team. This app has been developed behind the scenes over the lockdown period and makes use of the most recently released and cutting-edge features of the iExec technical stack. The dapp we’ll be presenting is a Trusted Crypto Price Feed, by @j48.

This piece of work was particularly impressive for the iExec team for a few reasons, here’s a quick overview:

           
  • An all-in-one Oracle-based price feed application for multiple cryptocurrencies
  •        
  • Signed and trusted thanks to iExec trusted data encryption within Intel SGX hardware enclaves
  •        
  • Makes use of the brand new APIs by Coinbase, a release that has been a hot topic in the blockchain community recently
  •        
  • To top everything off, the interface is hosted via IPFS, being fully decentralized and Web3 certified — the future is here!

The dapp is quite self-explanatory, you can find the UI with a selection of a multitude of cryptocurrencies here:

iExec Decentralized Oracle Tech Demo

Decentralized Price Feeds for a multitude of cryptocurrencies
Decentralized Price Feeds for a multitude of cryptocurrencies

J48, who we met in the #tech-support the iExec Slack channel built this application after seeing the possibilities of oracles and confidential computing.

The Dapp’s UI
The Dapp’s UI (click the link in the image to test for yourself)

The application UI: ➡️https://gateway.pinata.cloud/ipfs/QmQ4CY6fSbys5bfAE2nFoKJ5KgXZUEoQeQZv2MnfGFDH3h

We got in touch with him to ask a few questions about his work, so without further ado, here’s @j48 on his Signed Price Feed dapp:

           
  • How did you learn about iExec and why were you interested?

I first learned about iExec back in 2017, at which point the ICO mania was in full swing and it was hard to tell which projects were all hype and which had actual promise. iExec originally caught my eye as it seemed similar to folding@home — combining that type of tech with an immutable ledger seemed admirably futuristic. I started following the project more closely after Consensus 2018 when iExec gave a presentation together with Intel about using SGX to protect data. At the time there were few crypto collaborations with big corporations, so this really stood out to me. Since then, I’ve been keeping up with the tech, being genuinely curious to see how it evolves.

           
  • Can you give us an insight into any other projects you are working on at the moment?

I’m working on a crypto price analysis dapp running on iExec that will access a private dataset stored on Google BigQuery. It’s currently more of a demo of the tech, since I’m just exploring the possibilities of using iExec to access data on Google BigQuery.

           
  • Your application uses the newly released API by Coinbase. What inspired you to use that?

I became intrigued about the potential for signed price feeds to serve as a component of an oracle on Ethereum when I first read Coinbase’s article about their new signed price feed being made available. Current systems are either on-chain rube goldberg complexities or trusted middleware reporting secondhand data from API feeds. Digging deeper into the topic I started reading up on Compound’s Open Oracle system and became impressed with what they were trying to create.

While the signed API data is completely capable of being used in an isolated decentralized oracle deployed on iExec’s sidechain. API results from tasks can also update Open Oracle smart contracts on mainnet since the trust in the signed price feed isn’t lost when the message is relayed to mainnet. The message that stores the data is always a trusted Coinbase price since the signature verifies it was signed by Coinbase’s private key.

Currently, as it’s still in the early stages, there’s only one signed price feed being maintained by Open Oracle smart contracts on mainnet. The need for various entities updating these oracles will become essential as the number of signed APIs grows and the variety of events, data, or prices expands. What’s better than an on-chain median estimated price, calculated from verifiable price data taken from a multitude of only the most-used exchanges?

           
  • Why did you choose iExec confidential computing to secure the data?

About a month ago, the SGX-based Kaiko Price Feed dapp was released, inspiring me to try something similar with the Coinbase API. Without TEE, none of this would really be possible, given that the API key would have to be in paintext and visible to all. Using a decentralized cloud provider such as iExec to report signed API data on-chain felt like a perfect combination to me. As the amount of signed API providers grow the need and demand for on-chain updaters increases significantly

           
  • You took the interesting approach of encrypting the API key as a dataset within an Intel SGX hardware enclave, can you explain a little more about that?

Encrypting the API key allows for this dapp to run securely on any worker (with SGX) within an TEE workerpool without exposing the actual API key or any of the data. This also allows API providers to take advantage of publishing an encrypted API key on the marketplace without ever publicly revealing the API key, yet still remaining the provider of the data. This avoids giving up control of data they provide to secondhand resellers and eliminates complications where the API results might be sensitive or confidential, also providing them with unique monetization opportunities.

For @j48, testing with iExec has just been a hobby, if you’re interested in the code behind the dapp, you can find his github repos here:

j48/iExecCoinbaseOracle

If you enjoyed reading about how iExec is inspiring developers to build for the Ethereum ecosystem, you might look out for future dapp showcases in the future. We’ll aim for monthly with this series. We already have a few applications and use cases already lined up, one of the main ones comes from a well known international company that we’ve been publicly working with. We’re looking forward to telling you more about it.

Interested in confidential computing and oracles with iExec? Check out our similar work with Kaiko on a trusted ETH price feed:

The Kaiko and iExec Price Feed: Secure Pricing for Ethereum Smart Contracts

Thanks for reading!

TelegramTwitterYoutubeGithubTechnical Documentation