DA Publishing Cost: zkEVM Rollup vs zkEVM Validium on Avail

Hey everyone,

We have tested both the zkEVM Validium which uses Avail as its data availability layer and the zkEVM Rollup which uses Ethereum. We wanted to compare the Ethereum gas cost for each construct.

The test compares the gas cost for posting data blobs of various sizes. The zkEVM Validium using Avail was capable of publishing more data and achieved a ~90% reduction in Ethereum transaction fees compared to the zkEVM rollup.

The zkEVM Validium has been adapted to use Avail as its DA layer, no further optimizations were made for this test.

Test Results

Summary

Price per byte
Data Availability Layer Ethereum Avail
Construct zkEVM Rollup zkEVM Validium % change
32 bytes $0.3539691943 $0.4320809249 22.07%
1,000 bytes $0.01260526316 $0.0138265896 9.69%
100,000 bytes $0.00143625 $0.000138265896 -90.37%
120,000 bytes $0.001420238095 $0.00011522158 -91.89%
1,000,000 bytes n/a $0.0000138265896 -
  • The 32 byte and 1,000 byte tests were higher for the zkEVM Validium. This is because of data attestation verification.
  • The 100,000 byte and 120,000 byte tests were ~90%+ cheaper for the zkEVM Validium.
  • The 1,000,000 byte test was run for Avail only as transactions of this size are not possible for the zkEVM Rollup.

Full

Construct Gas Max Transactions Max Data Included (in bytes) Price to Fill Block (in USD) Price per Byte (in USD) Bytes sequenced
zkEVM Validium 172846 173 5536 2392 0.4320809249 32 bytes
172846 173 173000 2392 0.0138265896 1000 bytes
172846 173 17300000 2392 0.000138265896 100000 bytes
172846 173 20760000 2392 0.00011522158 120000 bytes
172846 173 173000000 2392 0.0000138265896 1000000 bytes
zkEVM Rollup 141632 211 6752 2390 0.3539691943 32 bytes
157593 190 190000 2395 0.01260526316 1000 bytes
1795382 16 1600000 2298 0.00143625 100000 bytes
2131324 14 1680000 2386 0.001420238095 120000 bytes
n/a n/a n/a n/a n/a n/a
  • The first value is the fixed gas cost of sequencing B bytes in one tx, G
  • The second value is if you had to fill a block, the number of txs you could fit in a block, basically block gas limit, (Bgl / G) = N
  • Therefore, the max data you can include in a block is, (N * B) = Mb
  • The third value is the price you pay to fill a block, basically, (N * G * Ether price * Gas price / 10e18) = Pb
  • The final value is the price you pay per byte which is, Pb / Mb

Assumptions: 30M block gas limit, tx calldata limits (normal EVM specifications), Avail block contains only one data extrinsic, 1MB blob size limit on Avail (there is no similar case possible for zkEVM, hence not included), ETH price = $2000, Gas price = 40 gwei.

How does the Validium work?

Below is a simplified diagram showing how the zkEVM Validium works. You can find a more detailed description in this blog post and you can view a more detailed schema in the docs.

zkEVM Validium Repos

You can build and test a zkEVM Validium using the Validium node repo and these contracts.

Note that Avail is in testnet prior to mainnet release and these repos have not been audited.

8 Likes

You mentioned that

The 1,000,000 byte test was run for Avail only as transactions of this size are not possible on the zkEVM Rollup.

How about 32 byte and 1,000 byte data? If more than 50% of a zkevm rollup tx’s have <1000 byte data, it’s more advantageous to use. Is there any data about average tx size of zkevm rollups?

It depends on the total bytes of RLP-encoded transactions included in a sequence, typically the average tx for a transaction (ERC20 transfer/swap) can range somewhere around 100-500 bytes. A zkEVM rollup that is posting 1000 bytes / 32 bytes (this case is technically impossible because no sequence will have only 32 bytes, unless it’s like an ether transfer or something) is basically overpaying for L1 security and should rather pause posting sequences until the price per byte is low enough, although in that case, it is slightly more cost-effective than a validium would be, it’s not an average case for a sequence of batches, it would be closer to, 50-100KB, since otherwise it’s tough to breakeven with L1 gas costs, essentially in the average case, the validium will always be cheaper.

3 Likes