Quantum Gravity Bridge: Secure Off-Chain Data Availability for Ethereum L2s with Celestia

Quantum Gravity Bridge: Secure Off-Chain Data Availability for Ethereum L2s with Celestia

tl;dr: This post introduces the Quantum Gravity Bridge project, a Celestia to Ethereum data availability (DA) bridge.

From the onset of DeFi Summer in 2020, through the eruption of NFTs in 2021, and now an escalation of DAOs, the demand for blockspace on Ethereum has exploded.

The deadly combo of high fees and slow transactions have led a variety of teams to work on two types of layer 2 (L2) solutions known as rollups—optimistic and zero knowledge—with the goal of making Ethereum more scalable, while preserving decentralization and security. However, rollups will also experience a mushrooming of fees as more projects onboard and transaction volume increases.

Today, we’ll focus on how Celestia can serve Ethereum rollup teams as a scalable off-chain data availability (DA) solution using Celestiums.

This post assumes readers know about rollups (or L2s in general), data availability, validiums, and volitions. For more color on these topics, check out the further reading section at the bottom of this post.

Introducing Celestiums

Figure 1: rollups currently interacting with Ethereum.

Celestia is a layer 1 (L1) blockchain that is optimized for ordering transaction data and making it available. This makes it the perfect pluggable component for rollup teams to input their transaction data, with high data throughput.

Currently, Ethereum rollups collect data from multiple transactions into a single batch transaction, which is posted to Ethereum. This batch transaction includes the rollup's transaction data as calldata, i.e. data that is posted to Ethereum but not executed directly.

In practice this can get really expensive really quickly due to the costs associated with posting all this calldata to Ethereum, due to limited data capacity on Ethereum.

This is where Celestia, and Celestiums, comes in. A Celestium is an Ethereum L2 chain that uses Celestia for data availability, but uses Ethereum for settlement and dispute resolution.

As stated previously, Celestia as an L1 doesn’t handle computation and acts as a data layer only. Resource pricing on Ethereum drives up gas cost as the demand for blockspace increases. Celestia has the benefit of only pricing based on bytes rather than compute and storage, since it handles the ordering and availability of transaction data. This makes the data throughput of Celestia greater than Ethereum.

So here’s what Celestiums will look like, leveraging Celestia as the data availability layer:

Figure 2: an overview of how the Quantum Gravity Bridge can be used by Ethereum L2s.

Celestia’s data availability bridge contract, the Quantum Gravity Bridge, will sit on Ethereum. Ethereum L2 operators will be able to post their transaction data to the Celestia network, where it is placed into blocks by Celestia’s Proof of Stake (PoS) validators. This data is then relayed in the form of a data availability attestation from Celestia to Ethereum. The attestation is a Merkle root of the L2 data signed by the Celestia validators attesting to the fact that the data is available on Celestia.

The Quantum Gravity Bridge contract verifies the signatures on the DA attestation from Celestia. So when the L2 contract on Ethereum updates its state, rather than relying on the transaction data being posted as calldata to Ethereum, it just checks to make sure the correct data was made available on Celestia by querying into the DA bridge contract. The bridge contract will return a positive response for any valid attestation that has previously been relayed to it, otherwise it will return a negative response.

Celestiums will provide high throughput data availability for Ethereum L2s with a higher level of security than other off-chain data availability techniques, which we discuss in the tradeoffs section below.

Rollup Costs

Figure 3: transaction batch size vs. per transaction cost in gas for a theoretical STARK based rollup.

Above is a diagram comparing transaction batch sizes versus per transaction costs in gas for a theoretical STARK based rollup. For the sake of this visual, batch sizes are projected up to 10,000 transactions per batch and costs are denominated in gas. Fixed gas costs per batch for this analysis are assumed to be 5 million gas.

Transaction batch size and per transaction cost in gas have an asymptotic relationship. This means that no matter how big batches of transactions on the rollup get, the gas cost on Ethereum approaches an asymptote, which is the cost of posting calldata to Ethereum.

This cost is driven by the 16 gas-per-byte cost of posting data to Ethereum which then is multiplied by the transaction size in bytes:

This means that no matter how much you reduce other costs for your rollup,  you can’t get around paying 16 gas per byte of data. For example, even sending a typical 200 byte Ethereum transaction on a rollup incurs a 3200 gas fee for just the calldata. Assuming state write costs and base transaction costs are not factored in (and at today’s gas price of 150 gwei and Eth at $2500), this transaction would cost a user roughly $1.20. End users will continue to be burdened with the issue of Ethereum gas fees even when they are interacting with a rollup as a result of posting to Ethereum.

On the flip, Celestia strictly provides consensus and data availability and not transaction execution. Thanks to data availability sampling, as the number of Celestia light nodes contributing to the data availability of the network increases, the size of each block can also increase without compromising on security or scalability.

The Tradeoff Space

There are many different approaches to off-chain data availability, each making different tradeoffs between scalability and security. On-chain data availability for L2s is the highest-security approach, as there is no way for data to be unavailable without corrupting the chain in question. This can get expensive, so sometimes off-chain DA mechanisms can be used.

Posting data off-chain permits corruption in different ways, with different security guarantees. The most naive mechanism for off-chain data is a single entity or permissioned set of entities that sign off on data being available. These signers can be corrupted with no penalty, so the system is meaningfully less secure than an equivalent system with on-chain data availability. There are a couple models of this, which we’ll explore below.

Validiums are a prime example of using off-chain data availability. Validiums post transaction data off-chain (in many cases to a centralized database), but post proofs to the execution layer of Ethereum. Validiums are not a rollup because they do not post to the L1 and thus do not inherit the security of Ethereum. Posting transaction data off-chain saves on cost because it avoids the 16 gas per byte fee of Ethereum.

Volitions are also an interesting development in the space, as they allow users to choose on a per transaction basis where their data gets posted, between on and off-chain. Volitions let users select on a per transaction basis where their transaction data is posted, at the expense of cost (off-chain being cheap, on-chain being expensive). Volitions, compared to validiums, do inherit the security of Etherum in the case that a user decides to post transaction data on-chain and would be considered a rollup in those cases, but fall short on security if the user opts for the off-chain option.

Celestiums, however,  provide an attractive combination of security and scalability compared to other solutions. Celestia as an off-chain data availability mechanism may be more expensive than traditional off-chain DA solutions, due to the gas costs of verifying Celestia’s DA attestations on Ethereum, and the data fees on Celestia which will be decided by a fee market. However, the data availability guarantees are higher than off-chain data availability mechanisms based on a centralized provider or permissioned committee.

Given that Celestia adopts Tendermint with proof-of-stake and plans to have a large, permissionless group of stakers on the network, an incorrect DA attestation can be penalized with slashing. This is possible because light nodes on the Celestia on-chain network can detect unavailable blocks with data availability sampling, and thus similarly to a validator can automatically halt if the validator set becomes malicious. Celestia’s Quantum Gravity Bridge will provide scalable and secure off-chain data availability to Ethereum L2s.

Learn More and Future Development

Quantum Gravity Bridge is an early stage project still under development. Check out the repository on GitHub to keep track of development progress.

For a more complete picture of the various off-chain data availability solutions, we’ll be publishing a post on the Ethereum off-chain DA landscape and the tradeoffs as a part 2 to this post in the coming week. And if you’d like to get in touch with the team or test out Celestiums for your own rollup, get in touch with us on our Discord!

Further Reading