Lagrange's ZK Coprocessor 1.0: The First SQL-Based ZK Coprocessor, Supporting Applications for Azuki, Gearbox, and More
September 3, 2024
Lagrange Labs is thrilled to announce that Lagrange’s ZK Coprocessor 1.0 is now live! This release enables important features, such as proving of custom SQL queries over onchain data directly from smart contracts. Building off of Lagrange’s Euclid Testnet, the ZK Coprocessor 1.0 is now the first available SQL-based ZK Coprocessor that developers can use to scale and build more data-rich applications.
With the launch of 1.0, Lagrange is also introducing the Themis Launch Program to support the use cases of top DeFi and NFT projects like Azuki, Gearbox, Ether.fi, Usual, Tokemak, 3jane, and more.
What is version "1.0"?
Lagrange’s ZK Coprocessor allows developers to build apps with offchain verifiable compute, enabling efficient computations over historical blockchain data using ZK proofs that are verified onchain. During the Euclid Testnet phase, we released and tested core features, including hyper-parallel computations, enabling 2x faster prover performance by splitting tasks into small, recursive circuits and enabling distributed proving for external operators. The 1.0 release of Lagrange’s ZK Coprocessor is a significant milestone, featuring custom functionalities that teams can now use to develop more expressive queries without having to write custom circuits.
With 1.0, users can now:
- Self-register: Users can register any Ethereum smart contracts to be proveably indexed into a verifiable database and queried over.
- Perform custom SQL queries: Including advanced operations like selecting distinct columns, calculating averages, and summing values from tables with specific conditions and limits, making data retrieval and analysis much more powerful and flexible for decentralized applications:
- SELECT DISTINCT col1, col2, AVG, SUM
- FROM table
- Where P1 AND P2 AND P3
- LIMIT + OFFSET
- DISTINCT
These capabilities extend the functionality of the Lagrange ZK Coprocessor, allowing developers to customize which contracts they want to query over and the types of data interactions they are looking for. This means developers can build more sophisticated and expressive applications, leveraging large datasets with ease.
Themis Launch Program
As part of the ZK Coprocessor 1.0 launch, we are evolving the Lagrange ecosystem with the Themis Launch Program, working with partner protocols to help them achieve their desired applications through the ZK Coprocessor. The program will provide partners with bespoke onboarding support, including custom integration and setup, technical support, early access to performance upgrades and new features, tutorials and documentation, co-marketing support, exclusive swag and more! Inspired by Lagrange’s previous programs, such as the Euclid Testnet, Themis is named after a celestial object at a Lagrange point, launched in 2007 to study space environments. Learn how to become a part of the Themis Program.
Themis Launch Partner Use Cases
Azuki Odyssey
By leveraging Lagrange’s ZK Coprocessor 1.0, Azuki is now able to query extensive datasets related to its NFT collections onchain, unlocking the potential to create more innovative, data-driven user experiences for its community. To demonstrate this capability, the two teams collaborated on the "Lagrange x Azuki Odyssey," a new interactive visualization. The Odyssey allows Azuki holders and community members to explore interesting trends and insights that were previously difficult to analyze.
"Lagrange is simplifying onchain/crosschain data access and enabling Azuki to better understand market trends within our collections. This approach helps us analyze how our community and collectors value specific traits. With this data, we can enhance the collector experience more effectively and efficiently."
- Alex "Zagabond" Xu, CEO of Azuki
By integrating Lagrange's ZK Coprocessor technology, Azuki and its community gain access to reliable and timely data insights, enhancing the collector experience.
Explore the Lagrange x Azuki Odyssey.
Gearbox’s Diesel Token Use Case
The diverse utility of Lagrange's ZK Coprocessor can also be shown through its integration with Gearbox. Gearbox is a DeFi protocol that uses credit account abstraction to bring together lenders and borrowers. Gearbox has RewardPool contracts that reward users that deposit liquidity into lenders.
Currently, Gearbox’s RewardPool contracts are integrated with liquidity mining contracts, called Farming Pools, that are based on 1Inch’s implementations. Users receive yield based on the output of Farming Pools and the duration of time that they’ve provided liquidity.
The Farming Pool contracts have many key limitations such as: only being able to pay out one reward asset, only having one payout mechanic (based on share size) and incorrectly displaying user balances in Etherscan. With Lagrange’s ZK Coprocessor, Gearbox will be able to distribute rewards entirely based on proofs, rather than Farming Pool contracts.
For example, if new rewards such as GHO or ARB are needed, users can simply claim rewards directly using proofs submitted to the RewardPool, rather than based on the Farming Pool contract logic. As a result, the above limitations can be removed from Gearbox’s deposit incentive programs.
Here's how it works:
- Lending in Pools: Users lend tokens like USDC, crvUSD, and ETH in various pools.
- Reward Allocation: Gearbox allocates GEAR tokens to each lending pool daily (e.g., 100 GEAR to USDC lenders).
- Percentage Calculation: Lagrange ZK Coprocessor is used to compute each lender's share of the pool (e.g., if you lend 100k USDC out of 200k total, you get 50% of the rewards).
- Receiving Rewards: Based on their share, a lender receives the corresponding amount of GEAR tokens (e.g., 50 GEAR per day for 50% of the USDC pool).
Beyond simply removing limitations, using Lagrange’s ZK Coprocessor also opens up the opportunity for cross-chain RewardPools. For example, any LP who deposited in WETH pool on any rollup could prove their position to claim a reward on mainnet.
With Lagrange’s solution, Gearbox can ensure that core computations within its yield bearing vaults are handled autonomously and in a gas-efficient manner. This not only streamlines user experience but also significantly enhances the feature set and yield-bearing potential for users, while still maintaining the trustworthiness and secure designs that Gearbox is known for.
Building a Scalable Onchain Future
The Lagrange Labs team has worked diligently to launch the ZK Coprocessor 1.0 to bring offchain verifiable compute to developers. Thanks to the feedback and testing from the Lagrange community, Lagrange is now ready to support more partners and continue improving the performance of Lagrange’s ZK Coprocessor and Prover Network.
Interested in using the Lagrange ZK Coprocessor? Sign up for the Themis Launch Program for custom integration support here.
Stay tuned for more in-depth case studies and exciting updates from the Themis Launch Partners in the coming weeks!