Bringing the Open Oracle Standard to StarkNet

Empiric Network
3 min readSep 1, 2022

--

Compound and Coinbase were tired with the status quo of black box off-chain oracles on Ethereum so they collaborated to create the open oracle standard. This initiative created an open standard that anyone could use to trustlessly bring data on-chain, without requiring custom integrations with data sources or relying on third parties for secure data.

Today we are proud to announce that Empiric Network has ported the open oracle standard to StarkNet. This allows anyone to bring price data on-chain in a completely permissionless way. At the same time, it maintains the highest cryptographic security due to its use of ECDSA signatures. The result is open, standardized data infrastructure that anyone can build on top of.

Because of the permissionlessness and security (which come at the cost of frequency and data depth) these price feeds are perfect to use as fallback data feeds.

Compatibility Challenge

One of the big topics in zk-rollups broadly and the StarkNet ecosystem in particular is how much to sacrifice performance and other aspects of user experience to maintain backward compatibility with standards developed for Ethereum. Porting over the open oracle standard we experienced first-hand some of the challenges in bridging over Ethereum standards.

Writing the open oracle verification logic in Cairo was challenging as many of the cryptographic primitives made assumptions about how data was represented and which types of computations were easy. In particular, we used StarkNet’s keccak built-in (which is much more expensive than e.g. petersen hashing) and had to create some of our own magic to manage data representations (e.g. little- vs big-endian, keccak padding) — credit to Empiric Network engineer omnisat!

Using Open Oracle Data on StarkNet

Building on open oracle data on StarkNet is extremely simple — whether you’re interested in consuming data or helping bring the data on-chain, anyone can interact with the contract (we provide an open source SDK to help you get started).

Note that Open Oracle is currently only supported by two exchanges, Coinbase and OKX. While we hope that many more exchanges will support this format in the future, we currently advise to use the feeds as a permissionless backup but not as the main price feed. The risk of relying on only a few sources as the main price feed is that the underlying markets could be moved, leading to skewed prices (see past Coinbase/Compound exploit). The Open Oracle data is also best used as a backup because it is updated much less frequently than Empiric Network’s main price feeds.

The Future

Now that this standard has been ported over to StarkNet, the new wave of zk-native protocols building there can profit from an open data infrastructure. We envision a world where any ecosystem participants can run infrastructure to help bring data on-chain, without sacrificing security. A world where price data is a true common good that anyone can use to innovate and drive forwards what DeFi protocols can do.

Lastly, we hope that this will lead to renewed interest in the standard which will help convince more exchanges to join Coinbase and OKX in providing signed data via their APIs. Key to the success of this standard is not only the cryptographic security of the data but also making sure that a rich set of data is available, from many different exchanges.

Want to work on similar exciting technical challenges at the cutting edge of cryptography and blockchain technology? Empiric Network is actively hiring across technical and ecosystem roles! If you’re interested, please send an email to hello@42labs.xyz.

Are you a protocol? Empiric Network has a track record of reliably providing accurate data feeds, both price feeds and more advanced computational feeds. If you’re interested, please reach out on Twitter (DMs open), on Telegram (@JonasNelle) or email at hello@42labs.xyz.

Follow @EmpiricNetwork to stay up to date!

Image by IvanKelmenchuk from Pixabay

--

--