Oracles on Tezos: Youves, Harbinger and Mavryk
Looking into the Oracles on Tezos
Oracles provide smart contracts with valuable, verified data that happens off-chain. They are fundamental for smart contract infrastructure to function properly, as off-chain data is necessary for any robust protocol to operate. Imagine building a smart contract without any data from external sources. A common use case for an oracle in Defi would be a price oracle that gives the current price of USD to an exchange.
Since oracles provide crucial information, it is important that the information they are sending is not malicious. Oracles, especially in blockchain, require deterministically verified data. This is often achieved through decentralized oracles like Chainlink, an industry standard across several blockchains. Data from an oracle can be used to trigger on-chain actions and alter the actions of a smart contract, amongst a variety of other unique features.
There are three main oracle projects on Tezos, Youves, Harbinger, and Mavryk Finance. Let’s dive into each of these projects and how they approach off-chain data gathering on Tezos.
Ubinetic (Youves)
Youves is a decentralized, non-custodial, self-governed synthetics assets platform on Tezos that allows users to mint synthetic assets, borrow funds, and exchange assets. To maintain the price of assets on this complex DeFi system, an oracle was developed by the Ubinetic team.
Ubinetic aggregates price data from five data transmitters, Bitcoin Suisse, Sygnum, Taurus, Swisscom, and Cat Financial Products AG. Each of these data transmitters are responsible for providing the price of off-chain assets to the oracle which then aggregates the prices and submits them on-chain. Examples of assets they provide prices for include; USDT, BTC, and XTZ.
The Ubentic oracle utilizes “Android’s key attestation and built-in hardware security modules to create a verifiable trusted execution environment.” According to Ubentic, Android’s operating system is more secure than any server and/or computer operating system because they have enabled “secure solutions such as cryptographically signed executables (aka Apps), a permission system, application sandboxing, isolated filesystems, no root user and hardware security modules.”
Attestation means to prove that something exists so, Android’s key attestation is essentially a cryptographic way to prove that the data provided through the oracle is the same data stored on the Hardware security module (HSM).
These hardware security modules (mobile devices) are operated by multiple parties (the data transmitters from earlier) and receive data from multiple data sources. This data is then verified through a verifiable tamper-proof execution on the device, submitted to the Aggregator and later submitted on-chain.
Ubentic provided a helpful graphic shown above and more detail can be found here.
If you are interested in becoming a Ubinetic data transmitter, you can contact them here. Ubinetic also provides open source code that can be found here.
Harbinger
Harbinger is a centralized, signed price feed oracle that provides Tezos based dApps with reliable and secure token prices. The tools provided with Harbinger allow anyone to deploy their own price oracle.
Harbinger operates in the following manner, similar to the majority of centralized price feeds.
Essentially, the price of a token, provided by the token exchanges API, is sent to a signer wallet (often owned by the exchange) which will use their private key to sign off on the price and pass it to a “poster” wallet. Anyone can become a poster, who will then submit the price data to a storage contract. From here, the data is passed to a normalizer contract in order to calculate the price weighted average, essentially adjusting the price based on the volume available and data received. Any platform can now retrieve this price data from the normalizer contract on-chain.
To learn more about this process, check out the introduction of Harbinger article. Harbinger supports exchange APIs of Coinbase Pro, Binance, Gemini and OKEx. Harbinger is created by the Hover Labs team, who also built the lending protocol Kolibri Finance. Join their community through Discord here.
To learn more about oracles on Tezos, check out the Tezos Developer documentation on Oracles here.
Mavryk Finance
Mavryk’s oracle network is the first decentralized & incentivized oracle system on Tezos, and operated by nodes called Satellites. The Satellite network is inspired by Tezos’ governance model fused with an oracle system inspired by Chainlink. Satellites have two responsibilities; 1) they control governance similar to Tezos bakers and 2) validate the data price feeds for token pairs.
For the sake of this article, we will just focus on the Satellites oracle responsibilities. The decentralized nature of the Satellite network has no single point of failure and maintains consistent network uptime.
Satellites choose their own data sources (such as an exchange) and/or aggregator data sources (ex. Messari or Coingecko), and push their data into an aggregator smart contract that allows peer to peer communication between oracles. The aggregator smart contract checks the oracle signatures, that there are enough signatures, and recomputes the overall median price feed data. Then, that median price data is pushed on-chain making it accessible for other smart contracts to read. This data is critical for maintaining DeFi applications such as Mavryk’s lending & borrowing.
The Oracle rewards are distributed proportionally based on the Satellites staked MVK bond and the MVK delegated to it, similar to baking rewards on Tezos. If a Satellite acts maliciously, it may have its bond slashed, and the Satellite governance may vote to remove the malicious Satellite. These mechanics are used to incentivize good behavior amongst the network.
You can dive further into Mavryk satellites in their litepaper here and join the Discord here.
Bonus: Chainlink
While it’s not yet functional on Tezos, there is documentation on the Chainlink Tezos integration. An official Chainlink Tezos implementation will hopefully happen in the coming years.
Chainlink is the most notable of decentralized oracles across all blockchains, using a system of oracle nodes to provide a reliable, verifiable data stream on-chain. Tezos decentralized app developers will be able to utilize the Chainlink network that has supported networks of billions of dollars and has been thoroughly performance tested. One of the main features of Chainlink is that it provides price feed data on a wide range of tokens and provides price updates.
Chainlink operates in the following way.
An event is triggered by an on-chain submission to the Chainlink oracle Smart Contract that initiates the request. This request is then sent to the Chainlink network of nodes where the following happens:
- Reputation Check: The reputation of each node is checked.
- Order-Matching: The request is paired up with multiple nodes available and capable to handle the request.
- Answer Aggregating: The answers from the nodes are sent to the aggregation smart contract and all valid answers are aggregated into one answer (usually the mean or majority). This step can be run multiple times.
This answer is then aggregated and sent back on-chain to the Chainlink oracle smart contract. This smart contract will then send the data to the notifier contract which is the one dApps pull information from.
Thank you so much for learning about oracles with us! Feel free to message me with any questions on Twitter at @adshinder. Follow Tezos Israel on Twitter @tezosisrael to keep up with what we’re building and how we are advancing the Tezos ecosystem!