Coinbase Logo

Language and region

Don’t invest unless you’re prepared to lose all the money you invest. This is a high-risk investment and you should not expect to be protected if something goes wrong. Take 2 mins to learn more

Guide to Brevis

July 31, 2024

We are excited to announce that the Brevis ZK Coprocessor AVS is live on our EigenLayer Operator. If you’ve restaked ETH or LSTs on EigenLayer, visit our Delegation Guide to delegate to Coinbase’s Operator.

Introduction to Brevis

Brevis is a ZK coprocessor that gives smart contracts the ability to read historical onchain data from supported blockchains to run customizable computations trustlessly. This enables developers to build a range of data-driven dapp features like intent-based active liquidity management, loyalty trading programs, and account reputation systems.

How it works

Dapp developers will need to implement three things using the Brevis SDK:

  • Data Access Module: Specifies the needed historical blockchain data

  • App Circuit: Specifies computation logic to run on historical blockchain data

  • App Contract: Receives and processes ZK-verified computation results

Source: Brevis Docs

Brevis App Workflow

  1. The App Service receives input from users or operators

  2. The App Service obtains data based on the dapp’s business logic. This data comes from an offchain indexing solution

  3. A ZK proof is generated to show that both the computation of business logic and the onchain data retrieved from the indexer are valid

    1. The App Circuit proof generation is hosted by the App Service

    2. The onchain data proof generation is hosted by the Brevis Service

  4. The Brevis Service will combine the two proofs into one

  5. The computation results and combined ZK proof will be verified onchain by the Brevis Contracts

It is expected in the future that the App Circuit and the Brevis Service will be migrated to a decentralized prover network and Brevis coChain.

Brevis coChain

Before coChain, Brevis ZK proofs for data access and computation results were always generated upfront. Dapps could only use these results after onchain verification of the ZK proofs. This model has some drawbacks, more specifically on high proof generation costs and the lack of ability to generate proofs in specific use cases. An example would be to try to generate a proof of non-existence.

The Brevis coChain introduces a propose-challenge architecture to address these issues. Here, a proposer can generate and submit coprocessing results onchain without completing the entire ZK Proof computation. After this, a challenge window defined by the developer begins. In the duration of the challenge window, any observer on the chain can initiate a challenge submitting a ZK proof that challenges the initial claim. Successful challenges result in penalties for the proposer and the challenger receives the reward. If no challenges happen during this period, then the dapp considers the results valid.  

Source: Brevis Blog

The Brevis coChain is a Proof of Stake blockchain in which, upon receiving a coprocessing request, validators within the chain generate coprocessing results based on the data from the specified blockchain’s archival nodes. Upon consensus, Brevis coChain pushes the results to the requesting blockchain in the form of a proposal.

This proposal initiates two timers: a dapp challenge window and a coChain slashing window. Anyone can then challenge a result by submitting a challenge claim with a bond onchain. A successful challenge triggers an onchain slashing contract penalizing malicious validators and rewarding the challenger. If the challenge fails, the bond is forfeited.

For a specific use case, please refer to Brevis’ Uniswap V4 Hook + Brevis SDK Coprocessor Blog Post

Conclusion

The Brevis ZK Coprocessor AVS empowers developers to build innovative, data-driven dapp features by enabling smart contracts to read historical onchain data and perform customizable computations trustlessly. The Brevis architecture, enhanced by the upcoming decentralized prover network and Brevis coChain, ensures efficient and secure zero-knowledge proof validations. As part of our commitment to advancing blockchain technology, Coinbase proudly supports Brevis through EigenLayer. For delegation details, please refer to our delegation guide or contact us today.

Disclaimer

This document and the information contained herein is not a recommendation or endorsement of any digital asset, protocol, network, or project. However, Coinbase may have, or may in the future have, a significant financial interest in, and may receive compensation for services related to one or more of the digital assets, protocols, networks, entities, projects, and/or ventures discussed herein. The risk of loss in cryptocurrency, including staking, can be substantial and nothing herein is intended to be a guarantee against the possibility of loss. Reward rates listed herein are estimates, are not guaranteed and are set by the protocol and remain subject to change. Actual rate of rewards earned may vary significantly and may be zero. This document and the content contained herein are based on information which is believed to be reliable and has been obtained from sources believed to be reliable, but Coinbase makes no representation or warranty, express, or implied, as to the fairness, accuracy, adequacy, reasonableness, or completeness of such information, and, without limiting the foregoing or anything else in this disclaimer, all information provided herein is subject to modification by the underlying protocol network. Any use of Coinbase’s services may be contingent on completion of Coinbase’s onboarding process and is Coinbase’s sole discretion, including entrance into applicable legal documentation and will be, at all times, subject to and governed by Coinbase’s policies, including without limitation, its terms of service and privacy policy, as may be amended from time to time.