Try   HackMD

Hyper Oracle: scaling Ethereum via zkDApps

Introduction

The scaling of Ethereum has been a hot topic for years. While most discussions have been revolving around L2 protocols that are capable of significantly increasing the Ethereum's throughput while providing low-fee transactions, there is another approach capable of scaling Ethereum in a different but equally important way. Hyper Oracle has been building along the latter path boosting the capabilities of smart contracts built on top of Ethereum, opening up whole new perspectives in creating trustless, decentralized and fully on-chain applications.

In practise it means you can add zk-proven data-indexing, automated workflows or machine-learning capabilities to your smart contract. In this article we'll dive deeper into Hyper Oracle's architecture, workflows and use cases.

A Programmable zkOracle Protocol

What exactly does it mean?

Hyper Oracle is a stateless protocol consisting of a network of nodes called zkOracles that are programmable and can handle customized, arbitrary computations. A zkOracle can provide zk-proven on-chain data from Ethereum as input for the customized computation while ensuring that the output is also verified through a zero-knowledge proof. The former is achieved by proving Ethereum's state through zkPoS, while the processing of data along a customized logic is achieved using programmable zkGraphs that run on zkWASM.

What problems do zkOracles solve, and how?

Traditional oracles ensure the security, integrity and reliability of data generally through consensus mechanisms and staking, with the amount staked being subject to slashing if the data turns out to be incorrect. However high staking requirements may increase the entry barrier for new nodes and could be a limiting factor for decentralization.

Besides, optimistic oracles work on a "true-unless-disputed" basis. Only the data that remains undisputed over a pre-determined challenge period will be passed through the network and assumed to be true. If we were to use a term from the L2 space, we'd say only after this period does it reach finality.

On the contrary, Hyper Oracle is designed to be a decentralized, autonomous network of zkOracle nodes where consensus mechanisms and staking requirements are replaced by math. The nodes generate zero-knowledge proofs (ZKPs) to ensure data integrity and reliability, and rely on Ethereum for security. This results in a 1-of-N trust model in which a single honest zkOracle is enough to secure the trustless functioning of the network.

zkDApps: the future of smart constracts

Architecture

Hyper Oracle relies on zkPoS for data availability: the whole Ethereum state is verified through ZKPs ensuring data integrity and credibility. In addition zkGraphs are used to achieve programmability. The customized computation logic is defined in zkGraphs which are subsequently processed by zkOracle nodes. The zkGraphs are Subgraph-equivalent, written in AssemplyScript, and thus enable easy migration. An easy-to-use webIDE called zkGraph Studio is available for developers looking to integrate Hyper Oracle.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Source: Hyper Oracle

Making smart contracts smarter

The concept of zkDApps can be summarised as follows: zkDApps = zkOracle + DApp. While the number of unique use cases is endless, the Hyper Oracle team has been building certain zkGraph Standards (MetaApps) as core applications to facilitate integration:

Using zkIndexing developers can provide decentralized applications with zk-proved historical data. The use-cases of these zkGraphs could include quering the transaction activity and volume for NFTs or building verifiable DeFi dashboards.

  • The process flow for zkIndexing includes: 1. Reading on-chain data; 2. Computing and indexing with zkGraph; 3. Verifying the output and the ZKP

When combining zkGraphs with zkAutomation users can add automation capabilities to their smart contracts, opening up the door for robust and powerful zkDApps. The additional computational power also allows them to make automated calls if the computation output meets certain pre-defined parameters. Be it automated swap orders and recurring transactions, automated treasury management for DAOs, fully on-chain stablecoins, zkAMM, or a fully-on-chain liquidation keeper for DeFi protocols the opportunities are truly endless.

  • The process flow for zkAutomation goes as follows: 1. Reading on-chain data; 2. Computing and checking if automation is triggered; 3. On-chain verification; 4. Writing values into the smart contracts defined by zkGraph

Through zkML (zkMLinference) users will be able to build fully on-chain DApps powered by machine learning and secured by Ethereum. zkMLinference is Hyper Oracle's trustless machine-learning inference protocol based on ZKPs, enabling model and user input privacy, and computation integrity. This allows smart contracts to integrate decentralized machine learning computation. There could be a wide range of potential use-cases such as verifiable ML model inference, fully on-chain ML quant funds or fully on-chain AIGC (EIP-7007: zkML AIGC-NFTs, co-authored by Hyper Oracle), potentially even dApps capable of predictive analytics and automated decision-making processes, or automated risk assessment and fraud detection in DeFi applications.

  • The process flow for zkMLinference is the following: 1. Reading on-chain data; 2. Computing for inference with zkGraph; 3. On-chain verification; 4. Writing inference output into the smart contract defined by zkGraph

zkOracle workflow

  1. The users register their zkGraphs and provide the bounty for the zkOracle network to process the arbitrary computation.
  2. zkOracle nodes pick up the computation tasks customized in the zkGraphs, and process them, generating zk-proofs. zkOracle nodes also deploy the smart contract that can verify the ZKPs generated.
  3. Once the ZKPs are verified, the user’s smart contract receives the computation result and uses it in its operation.
  4. Bounty provided by the user in step 1 is sent as reward to the zkOracle node that processed the corresponding task.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Source: Hyper Oracle

Building without trade-offs

Integrating Hyper Oracle developers don't need to worry about the usual trade-offs. Instead, they can focus on building robust DApps that truly represent the core values of Ethereum, such as decentralization, trustlessness, permissionlessness, security and integrity.

Find out more about Hyper Oracle:

Website, Github, Docs, Blog
How to develop a zkGraph with zkGraph Studio
How to develop a zkGraph with zkGraph Template
Sample Code: zkGraph Examples
Dev flow for zkAutomation
Towards World Supercomputer


References:

Hyper Oracle website and docs
Defining zkOracle for Ethereum
Hyper Oracle Simply Explained
Latest Applications Building on Hyper Oracle
Marine: Compound Liquidation Keeper with zkGraph