-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tracking] EVM light client bridge vs Gravity Bridge #4
Comments
How come an audit is only necessary in the gravity bridge case but not for the EVM Light Client case? I think we should expand more on the required changes so we can properly estimate the amount of time both would take. My intuition is that the gravity bridge changes are less involved and a matter of a few weeks max? While the evm client work is rather months not weeks? Is that about right? But before that we should clarify if the lack of accountability a show-stopper for using the gravity bridge. |
Oh, an audit would be necessary for both, I just forgot the add it for the latter.
About right, yes.
It is not IMO. |
Decision is to modify the Gravity bridge as above. |
@adlerjohn What's your recommendation here? |
Problem Statement
Various rollups on EVM L1s may have a need for using Celestia as a DA layer, while keeping fraud/validity proof verification in the EVM. To that end, two concrete possibilities exist: the Gravity bridge and a native EVM light client. This issue summarizes how each will work, any changes necessary for our usecase, and pros and cons.
Gravity Bridge
The Gravity bridge is a project initiated in the Cosmos ecosystem: https://github.com/cosmos/gravity-bridge. Various forks (maybe as many as a dozen at this point) exist of this protocol, with minor changes. Non-exhaustively
Method of Operation
The Gravity bridge has two components: an on-chain component written in Solidity and an off-chain component (the orchestrator) written in Rust (Peggy) or Go (Injective). A high-level explanation of the Solidity contracts can be found here.
The orchestrator runs alongside a Tendermint node (potentially as an SDK module) that causes validators (i.e. block producers) to, in addition to regular Tendermint votes, also sign EVM-compatible messages that mirror:
Specifically, messages are signed in accordance with ERC-191. These signatures are batched and sent to an on-chain contract. The contract keeps track of the validator set as it changes, and verifies that the arbitrary events are signed off by a supermajority of voting power.
Updates to the validator set must occur every time
To update the contract's view of the validator set,
updateValset
is called. The orchestrator will construct an EVM-compatible transaction with batched signatures here. The contract will simply verify that:Then update its saved validator set hash.
I estimate this operation is ~500k gas each time. As an example, Ethereum is an EVM-compatible chain and at its current gas prices this would cost ~$400. It would be prohibitive to update the validator set every block, hence the above threshold of 5%. With only occasional updates, this cost should end up not being too significant.
Batches of arbitrary messages are submitted to the EVM chain with
submitBatch
. This requires verification of the current validator set and a supermajority of signatures. Note that arbitrary messages does not necessarily imply single blocks; properly implemented, a single batch of arbitrary messages can be made across as many blocks as can fit in the gas limit.Required Changes
submitBatch
function only works for transfers of fungible tokens across the bridge. This will have to be modified for our purposes, namely a list of (block height, namespace ID, message commitment) tuples.Pros
Cons
EVM Light Client Bridge
The EVM light client bridge (this repo) is a Celestia light client written in Solidity. It accepts new blocks headers as they are in Celestia, and follows the chain of block headers under an honest majority assumption.
Method of Operation
The EVM light client bridge has two components: an on-chain component written in Solidity and an off-chain component (which we'll call the orchestrator), yet to be written.
The on-chain contract will accept new Celestia block headers in protobuf, along with addition metadata, such as the validator set (diff). It can then update its view of the validator set similar to the Gravity bridge. Again, the actual updating of the validator set is only required when a threshold of the voting power changes.
To parse the protobuf-encoded header, the following libraries implement deterministic protobuf:
The final piece of the puzzle is that verification of the header and signatures must be done optimistically, by making the header chain an optimistic rollup. This is necessary since parsing protobuf every time would be too expensive. This would significantly reduce gas costs vs the Gravity bridge: verifying 50 signatures would be ~200k gas, while simply posting them would be ~50k. This similarly applies to processing messages. In other words, gas costs can be reduced by somewhere around a factor of 4 with an optimistic EVM light client bridge vs the Gravity bridge.
Required Changes
Significant changes are required.
Pros
Cons
Discussion
Don't forget to like, comment, and subscribe 👇
The text was updated successfully, but these errors were encountered: