Latest Applications Building on HyperOracle (Bonus: Things You Can Build Now)

For our latest offering, check out our litepaper.

0. Introduction

HypeOracle (Hyper Oracle) is a programmable zkOracle protocol. We aim to unlock historical data access and complex compute for smart contracts in a trustless and secure way.

A zkOracle is an expansive compute for smart contracts. Any DApp that uses zkOracle in their architecture is a zkDApp that has more potential than a traditional DApp.

To program a zkOracle, you can write code in zkGraph (a piece of code for custom logic) to define your own “API”. Also, we provide zkGraph Standards, including zkAutomation, so you can use it as a template to power your smart contract to achieve the ability of end-to-end trustless automation.

Since the release of HyperOracle's zkGraph, what kind of zkDApps have been built on HyperOracle?

We will break down the latest applications in the HyperOracle ecosystem into three categories: simple zkGraph applications, applications using zkGraph + zkAutomation, and advanced DeFi applications using zkGraph + zkAutomation.

We also provide builders with some project ideas based on zkOracle.

1. Simple Applications with zkGraph

Developers can use zkGraph purely in development, and they can use a zkGraph to re-create and re-develop on existing protocols and smart contracts.

These zkGraphs unlock two capabilities: trustless historical data access with arbitrary compute.

HyperOracle's community members have contributed to building zkGraphs, and we've created a dedicated showcase page for them. You can see the zkGraph source code here, as well as the demo use case page.

a) USDT Transfer Volume Per Block

USDT is one of the most commonly used stable coins on the blockchain. Its activity is a measure of how active the blockchain network is as a decentralized financial platform. The core of this zkGraph is simple: summing up the USDT transfer capacity of any block.

This example demonstrates the programmability and ease of use of zkOracle, which requires only a simple computation to allow smart contracts to access historical data and perform simple data processing and computation with zero knowledge technology.

Based on this zkGraph, it is possible to build on data insights of stable coins, as well as direct onchain monitoring of historical stable coin data and fluctuations.

You can access this demo directly here.

b) Uniswap v2 Price

Uniswap v2 is one of the most commonly used AMMs on the blockchain. Due to its special AMM mechanism and design, calculating the price of an asset in the v2 pool requires a certain amount of computation. The core computation of this zkGraph is to get the number of pairs of tokens in the Uniswap v2 pool, to calculate the price of an asset by division, and finally, to determine whether the price exceeds a certain threshold.

This example further demonstrates the programmability of zkOracle, which involves more operations. At the same time, special Solidity syntax such as ‘require()’ is used, demonstrating the ease of use of zkGraph.

Based on this zkGraph, developers can retrieve and track asset prices on Uniswap at any given time to build DeFi applications.

You can access this demo directly here.

c) OpenSea Trade Activity

OpenSea has SeaPort, an onchain NFT trading protocol that carries most of the NFT trading activity on Ethereum. Due to the sophisticated technical architecture, this zkGraph performs rich computations on the parsing of the data and calculates SeaPort's transaction activity on each block, yielding the number of trades and their value.

This example demonstrates the extensibility of zkGraph by writing a simple parser for SeaPort contracts, which emphasizes the programmability of zkOracle. For zkGraph development, you can use any of the libraries available on npm, which is very flexible. You don't need to worry about any ZK knowledge, just write code, not circuits.

Based on this zkGraph, developers can query any onchain NFT transaction activity and volume, and then judge the NFT market and build NFT-related applications.

You can access this demo directly here.

d) Build Your Own zkGraph

To build a similar zkGraph application, you can refer to the following sources:

2. zkDApp with zkGraph and zkAutomation

a) Introduction to zkDApp with zkAutomation

We have covered examples focused on zkGraph as the main application above, but to build a complete zkDApp, we can leverage both zkGraph and zkAutomation.

Recall the concept of a zkDApp: zkDApp = zkOracle + DApp. We build the smart contract ourselves, and then add automation capabilities to the smart contract with zkAutomation.

We have put together a video tutorial on the development process of the zkAutomation powered zkDApp: https://www.youtube.com/watch?v=VbhoQnu5_Kg.

b) Build Your Own zkDApp with zkAutomation

The difference between the development process for a zkDApp using zkAutomation and the zkGraph applications in the previous section is that a zkDApp requires:

  • Preferably be based on a smart contract that you have developed yourself (to ensure that the development and testing process is smoother).

  • Set the return value (payload) of the zkGraph (to ensure that the right data is sent, and the right on-chain functions are triggered).

We will explain the "set payload value" step in more detail using the video tutorial example.

The value returned by a zkGraph is usually some kind of data, and for zkGraphs that use zkAutomation, the return value can be used to define the onchain smart contract that is eventually triggered. The process is as follows:

  1. In zkgraph.yaml of zkGraph, set dataDestination as the smart contract to be triggered.

  2. set the payload for the final return. e.g., if you want to trigger the run() function, then return the signature of the function (c0406226), which can be computed or confirmed in the signature database.

  3. During the run, if zkGraph runs to the last return operation, then it will trigger the chain tx. e.g.: https://sepolia.etherscan.io/tx/0x4f0c30fa489989d679acefa9fdaf7022d4a12c35eab9494a3b4eceb44006d8af

Based on these additional operations, you can implement any trustless automation-capable zkDApp with zkAutomation.

3. zkAMM

What would a full DeFi application that is built entirely with zkOracle look like?

An AMM project during HackZuzalu in Singapore implemented the core logic entirely through zkOracle: zkAMM.

a) Intro to zkAMM

The concept and core logic of AMM (eg. Uniswap v2) is simple and minimal:

  • a pool with token A and token B

  • calculate token A and token B in pool for liquidity and swap price

Typically, this logic can be implemented directly in the smart contract. When implemented in zkOracle, the logic and computation can be extended indefinitely, as any computation of any complexity ends up as an O(1) onchain-verified ZKP, thus greatly increasing the computational potential.

The key advantages of zkAMM deploying core AMM logic via zkOracle are:

  • Trustless features are still guaranteed

  • Greatly scalable and extensible performance (extend to Uniswap v3 or Uniswap v4 or even UniswapX)

  • Higher computational flexibility, not limited by Solidity or EVM

b) zkAMM Architecture

The workflow and structure of the entire zkAMM is as follows:

Complex calculations and core logic are implemented in zkGraph for the zkAMM. Below are some key functions of this zkGraph.

The corresponding onchain smart contract has callbacks for key functions and performs zk proof and other verifications.

c) Other zkAMM Implementation

In addition to zkAMM, which is implemented through HyperOracle's zkOracle, we have also seen zkUniswap implemented using other technologies on the same concept as zkAMM.

Some key differences are:

  • zkAMM implements Uniswap v2, zkUniswap implements Uniswap v3.

  • zkAMM uses AssemblyScript, zkUniswap uses Rust.

  • zkAMM is fully automated, zkUniswap needs additional triggers or human intervention.

  • zkAMM has trustless historical data access provided by zkOracle, zkUniswap needs extra component to support this feature.

4. Request to Build

Now you can build your own zkGraph application or zkDApp. We come up with some experimental ideas for building in three levels of complexity.

Of course we’d like to hear what other possibilities you can think of too!

a) Vanilla zkGraph

As with “Simple Applications with zkGraph” in the previous section, we can build a zkGraph purely for an existing protocol that exists as an extension of a smart contract.

  • zkGraphs for NFT Marketplace

    In our previous example, HyperOracle ecosystem builder has developed a zkGraph for OpenSea's SeaPort to compute NFT volumes.

    There are many different onchain NFT trading platforms on Ethereum. With some research into the protocols and development, you can build a similar zkGraph for:

    • Blur

    • Looksrare

    • CryptoPunks

    • Memswap (Intent-based Architecture!)

    We believe that these zkGraphs can be used together to compute data for onchain NFTs, and that each zkGraph will have its own characteristics (trading-focused, creator-royalty-focused…) depending on the design of the NFT trading protocol.

  • zkGraphs as Onchain DefiLlama

    For a DeFi protocol, it is important to calculate the net inflows and outflows and TVLs of the protocol, and their historical data can be analyzed, which is very useful for risk management and risk parameter updates.

    In order to build an onchain DefiLlama, developers can use zkGraph to analyze risk for different DeFi protocols in different directions:

    • zkGraph for AAVE, Compound, Morpho, etc.

    • Performs calculations on protocol inflow and outflow, TVL, protocol revenue (like cryptofee), protocol health ratio (like bad-debt dashboard), protocol yield for user

  • zkGraphs as Onchain L2BEAT

    There are currently 30+ Rollups on Ethereum. These L2 Rollups are basically settled on L1, so it is possible to directly access and review the operation of these L2 Rollups via zkGraph.

    Therefore, developers can use zkGraph to build an onchain L2BEAT:

    • Calculate TVL (Canonical, External, Native) of L2

    • Calculate TPS (via L2 blocks settled on L1) of L2

    This information can be computed and aggregated directly onchain with the help of zkGraph to guide the user to use the appropriate L2 for them.

  • zkGraphs for ERCs

    The ERC protocol allows smart contracts to be implemented in a standardized form, so developers can also implement reusable zkGraphs based on these standardized smart contracts.

    • The most commonly used zkGraphs may be for ERC-20 (maybe also weird ERC-20s) and ERC-721.

    • zkGraphs for ERC-6150 and ERC-7007 (Bonus, because these two ERCs are co-authored by HyperOracle).

b) zkGraph as Onchain API

One of the major differences between HyperOracle's zkOracle and the Chainlink oracle is that zkOracle is fully programmable. Developers can build their own "API" instead of waiting for an oracle provider to set it up, and this API can be used by other users or developers.

To build such an onchain API with programmable zkOracle, you need to write some algorithmic logic in zkGraph, and use zkAutomation to return the results to the onchain smart contract, so that the user can use it onchain directly.

  • zkGraphs of Onchain Price Oracle (TWAP, TWMP…)

    In AMMs and DEXs, there are many financial primitives that require additional computation, such as TWAP. Developers can implement a set of TWAPs or even TWMPs through zkGraph to have a common onchain price oracle for any protocol.

    Or even use a statistical method to generate an estimated price of assets (like ETH) without external information other than transfer transactions, like UTXOracle.

  • zkGraphs of Uniswap Hooks Algorithms

    zkOracle can implement any logic entirely through a programmable zkGraph. The hottest computing paradigm these days are the Hooks proposed by Uniswap v4.

    A developer can implement any hook logic with a zkGraph, just in a different way. We've compiled a list of 25 hooks for you in awesome-uniswap-hooks. You can try implementing their computational logic with zkGraph, and complete the whole loop with zkAutomation!

  • zkGraphs of Public Goods Libraries

    There are a number of libraries and standards in traditional smart contracts that play an important role in the complete implementation of a contract. You can implement them with zkGraph to achieve more efficient computation with ZK.

  • zkGraphs of Traditional Oracle Services

    In the traditional oracle service, there are many other small APIs that are commonly used by developers and can be implemented with zkGraph + zkAutomation.

    • VRF (Verifiable Random Function, maybe like zk-draw)

    • VDF (Verifiable Delay Functions)

    • FSS (Fair Sequencing Service)

c) Complete zkDApp

Of course, you can also implement a completely new and complete application like a zkAMM with zkOracle.

You can take advantage of zkGraph's expansive computational power and trustlessness to build zkDApps:

  • Automation zkDApps: auto-renewal of ENS, automated strategies, onchain liquidator keepers for DeFi protocols...

  • DeFi3 zkDApps: we have a zk version of Uniswap v2, how about AAVE, Curve, Uniswap v3, v4 or something completely new?

  • Experiemental Games: For games, the computational logic is very complex, so implementing with zkGraph can save a huge portion of onchain gas consumption, such as etherquake and GameOfLife that costs $2k to run one step.

  • ZK-AIGC Token zkDApp: Build zkDApps based on EIP-7007. Existing example: ZenetikNFT.

5. Outro

Whether it's a simple zkGraph application, a zkDApp with zkAutomation capabilities, or a fully fledged application like zkAMM, you can use zkOracle to augment your smart contracts and applications:

  • More complex computational power that can be verified onchain

  • Access to more historical data or multiple data sources

  • The ability to perform automation calculations for rich interactions

The newest applications we present here are just the tip of the ecosystem iceberg. Stay tuned for more interesting applications in the future.

Share your ideas and tag us on Twitter or Discord. Come build with us!

About HyperOracle

HyperOracle is building a programmable zkOracle protocol that decentralizes and secures dApps. zkOracles power smart contracts with arbitrary compute, trustless automation, and rich data sources. HyperOracle abstracts away the complexity of zero knowledge technology and offers the simplest, developer-friendly way to create next-gen dApps.

hyperoracle.io | x.com/hyperoracle | github.com/hyperoracle

Subscribe to ORA
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
Author Address
0x85d62aCFf841c4f…8709f276110a45F
Content Digest
Tik3nBI9mw05Ql_…EQdDAKn7JKcx0xQ