The current Gnosis bridge is a based on a multi-sig design. However, multi-sig bridges have known weaknesses, particularly their reliance on a relatively centralized set of operators--see the recent Ronin bridge and Harmony bridge hacks, in which hundreds of millions of dollars of funds were stolen by attackers who gained access to multi-sig keys. SNARK-enabled bridges--sometimes called "trustless" bridges--potentially have better security properties. We propose to build prototypes of essential infrastructure for a potential SNARK-enabled bridge for Gnosis to Eth2 bridging.
To build the components of a SNARK-enabled bridge for Gnosis Chain, an Eth2 compatible light client must be implemented on the EVM. Because the EVM does not have precompiles for the BLS12-381 curve used in Eth2, implementing this directly in Solidity would result in impractically high gas costs. As a result, this approach to bridging was unexplored until it was made practical by recent advances in zero-knowledge proofs.
The 0xPARC community has developed extensive expertise in ZK-SNARKs broadly and has built several advanced ZK circuit primitives which can now enable these types of applications. We believe that we can design a circuit which significantly reduces the gas cost of running a light client on EVM by moving the verification of the aggregated BLS signature and the Merkle tree inclusion proof off-chain.
Building this SNARK-enabled bridge will require three important components:
Pros:
Cons:
Additionally, regardless of what cryptographic mechanisms are used, bridges cannot provide security beyond the consensus mechanisms of the source and target chains. Even with the efficiencies provided by zkSNARKs, such limitations will be governed by the size of potential PoS penalties on either chain.
Timeline: 10 weeks (July 4 - September 9) for Phase 1 and Phase 2
Phase 1:
The goal of Phase 1 will be to deliver prototypes of the three important components above. In particular, we will deliver a smart contract that implements the Eth2 light client spec with as much computation as possible moved off-chain with a zkSNARK circuit to make gas costs feasible.
The SNARK circuit will do three things:
The Solidity smart contract will generally implement the Eth2 light client spec substituting out the BLS signature verification and Merkle tree inclusion proofs with a snark verification, reducing gas costs.
We will also provide an operator node implementation which periodically updates the light client with the proof generated by the SNARK circuit.
Phase 2
In Phase 2 of the of the grant, we aim to have public-facing polished artifacts and deliverables including the smart contracts and circuits from Phase 1. The artifacts include the following:
The core team that would recieve this grant is part of the 0xPARC organization. 0xPARC is trying out a unique, experimental public-goods collective grant sharing proposal for this project. In particular, the proceeds from this grant will be split 50/50 between the core team and donations to various dependencies the project relies on (i.e. open source circuits, public goods resources) as well as the 0xPARC community.
The reason for this split is this project is only made possible by extensive open-source work by co-dependencies in the 0xPARC and broader ZK communities (such as circom, made by iden3).
This innovative model for grant-funding and support for public goods will also be mentioned in the blog post, as we want this project to push the narrative from both a technical standpoint as well as a community & grant-funding standpoint.
We are requesting a total of $600k (600k USDC) across two project phases: $300k will go to the team and $300k will go to the broader ZK community and public goods (distribution determined by core team). We expect that the project will take around 30 engineering weeks for the core team, in addition to supporting work from various dependencies and public goods that make this project possible. As described above, half of the grant will be distributed by the core team to the broader ZK community and various co-dependencies (which may include prior work by team members, as well as future ZK projects that opt into 50/50). Note that the core team, not GnosisDAO, will be deciding on the distribution of the $300k set aside for broader ZK community and public good contributions.
Phase 1: $120K for Team + $180K Public Goods/0xPARC ZK Ecosystem
The funding for this phase will be paid out in advance of work starting on Phase 1. The deliverables for this phase include the following:
Phase 2: $180K for Team + $120K Public Goods/0xPARC ZK Ecosystem
The funding for this phase will be paid out after the completion of Phase 1 (as judged by Stefan and Martin of Gnosis) and before starting of Phase 2. The deliverables of this phase include the following:
The address of the SAFE to provide funds to is: 0xFeB39382FCBE6035e0bE2263Ba474390AB926eE4 https://gnosis-safe.io/app/eth:0xFeB39382FCBE6035e0bE2263Ba474390AB926eE4/home
Additional 0xPARC community members will be helping out with implementation. This includes individuals that helped implement many of the most advanced circuit primitives in groth16, including co-authoring of circom-bigint, circom-ecdsa, and circom-pairing.