Brevis Alpha Now Live: Introducing ZK Co-processing and Data Attestation SDKs for Developers

4 min read

TL;DR

We’re thrilled to announce the launch of Brevis Alpha. This release provides developers with access to our innovative omnichain ZK co-processing SDK supporting ZK cross-chain interoperability, EVM storage slot value proof, EVM transaction proof, and EVM transaction receipt proof. Alongside this, we’ve launched a web UI that enables the developer community to explore all functionalities code-free. Engage with fun demo applications, such as the generation of “whale trader” NFTs based on your Uniswap trade history using Brevis, or validate on-chain friendships between two addresses based on historical transactions. It’s fun, try it out!

With the Brevis SDK, developers have the tools to create applications that redefine the boundaries of smart contract omnichain data processing, such as user life cycle management (e.g. DeFi loyalty programs and liveops for on-chain games), data-driven DeFi applications, zkDID, socially recoverable wallets, long-term user acquisition attribution platforms, trust-minimized cross-chain asset bridges and much more. Brevis is already being used by top-tier developers in the ecosystem to bring groundbreaking use cases to fruition. If you’re keen to build with Brevis and are interested in obtaining financial and technical support through future builders grant programs, please fill out this form.

All smart contracts and ZK circuits of Brevis Alpha are fully open-sourced. We wholeheartedly encourage community collaboration on all levels. Please note, while the alpha version is available for use on the mainnet, it has not yet been audited and should therefore not be used in production code just yet. 
In the rest of the blog post, we share what features are available in the SDK and what developers can build with the SDK in detail. 

ZK Cross-chain Interoperability API

How does it work?

Developers can utilize Brevis to facilitate generalized cross-chain messaging among blockchains, simply by invoking a function of a smart contract deployed on supported chains. The foundational technology of Brevis, known as zkFabric, obviates the need for reliance on externally verified mechanisms for security. Instead, it only depends on the consensus process of the connected blockchains. Brevis attains unparalleled trust-minimization for cross-chain messaging, supported by light client-level security. 

On a more foundational level, this functionality is powered by zkFabric that relays block headers and ZK Proof of block header validity among supported blockchains. Therefore, the functionality also serves as a basis to enable remote blockchains to access arbitrary state, transaction and transaction receipt through the availability of block headers.  Therefore, what this feature enables is not just a message “push” from source chain to destination chain but also information “pull” in the reverse direction. 

In this alpha release, the primary source chain available is Ethereum, while the destination chains can extend to any EVM-compatible chain. We anticipate adding more blockchains in future releases.

What can you build with this API?

For the “push” model, the most obvious application is ZK asset bridge and you can see an end-to-end working sample application here. Existing asset bridges, such as Celer cBridge can integrate Brevis as an additional validation method in concurrence with the existing validation mechanisms for the asset bridges. 

Since Brevis support arbitrary message passing, asset bridges can be easily extended to any type of omnichain applications such as cross-chain yield mining, cross-chain governance, cross-chain DeFi such as lending, derivative and more with the same much enhanced ZK-based security guarantee. 

On the other hand,  the “pull” model, combining with other functionalities of Brevis, is suitable for building applications interested in proactively querying other chains’ state such as user-gating based on identity, profile or activity on other chains. 

EVM Transaction and Transaction Receipt ZK Proof API

How does it work?

The Brevis framework provides a unique way to prove and verify the dynamics of actions across all connected blockchains through the Transaction and Transaction Receipt proof APIs. With Brevis, smart contracts can now access any transaction or combination of transactions during any time period of the supported blockchain in a trust-free manner. Transaction proofs are typically used to verify the existence of certain user or smart contract actions, with calldata included, regardless of the consequences of such action. Complementary to Transaction proof API, Transaction Receipt proof API comes into play when a proof of events, often associated with the outcomes of transactions, is required.

What can you build with this API?

The application scenarios for this API are vast: any use case that depends on processing user behavioral data or application profile data is viable. One excellent example is the construction of loyalty programs for DeFi applications, such as VIP trader fee rebates for DEXes.

While VIP trading fee rebates are a common feature in centralized exchanges, almost no DEX has successfully implemented it. The primary deterrent lies in the fact that direct implementation of such an accounting logic imposes significant costs at the smart contract level for all users, whereas only a fraction of them will qualify as VIPs. Implementing this off-chain undermines the decentralized essence of a DEX, creating operational overhead and potential regulatory risks.

With the Brevis framework, loyalty features like VIP trader fee rebates can be seamlessly integrated in a fully decentralized, trust-free and cost-effective manner. No accounting is required at the smart contract level. Qualified traders can submit a trading volume ZK proof using Brevis based on their past transaction record, allowing the loyalty business logic smart contract to verify and attribute them corresponding status in a trust-free manner.

In this release, we have showcased a demo for such use cases. Users can generate a ZK proof of their single largest trade in the Uniswap ETH/USDC pair. An NFT minting contract, integrated with Brevis using the Transaction Receipt proof API, will mint a special BrevisUni NFT based on users’ whale status upon successful verification of the ZK proof on the blockchain. Feel free to try it out!

For the Transaction proof API, we have constructed another demo to confirm that a transaction has occurred between two addresses, i.e. proof of “friendship” on-chain. This demo serves as an excellent foundation for building new types of account abstraction and socially recoverable wallets.

There are numerous exciting use cases in the pipeline, such as user engagement features in fully on-chain games, other types of DeFi loyalty reward systems, and more.

EVM Storage Slot Value ZK Proof API

How does it work?

The Brevis framework also furnishes an API that facilitates ZK proof of any EVM storage slot value from a connected (same or remote) chain. Different from the Transaction and Receipt API, which focuses on dynamic actions, this API empowers developers to build smart contracts that can access a blockchain’s static state snapshot at any given time. To access certain storage slots’ values at a specific block number in a trust-free way, application builders need only invoke a SlotValue Verifier contract. You can experiment with this demo to better understand how it works.

What can you build with this API?

Armed with this enhanced visibility, developers can build applications like decentralized identity solutions by merging user profile and states across multiple chains, or construct historical Oracles to attest to historical ownership of fungible token assets or NFTs. They can develop data-driven DeFi that adjusts protocol parameters based on past states of the protocol, create proof of reserve for centralized exchanges with privacy-protected proof of fund ownership at a specific point in time, or significantly enhance the composability of dApps by enabling read access of internal contracts states not accessible through view functions.

What’s Next?

With this Alpha release, we aim to onboard and support a group of early developer partners with grant programs. If you’re brimming with exciting ideas that you’d like to bring to life with Brevis, we offer hands-on developer support and financial grants. Details of our grant program will be announced shortly. Please don’t hesitate to get in touch!

In upcoming releases, we will focus on performance enhancement, implement new proving frameworks and horizontally scaling system architectures to unlock more functionalities at a larger scale to accommodate intriguing use cases in the future.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: