# DA Publishing Cost: zkEVM Rollup vs zkEVM Validium on Avail

**URL:** https://forum.availproject.org/t/da-publishing-cost-zkevm-rollup-vs-zkevm-validium-on-avail/439
**Category:** Research & Explorations
**Created:** [November 14, 2023, 9:36am UTC](https://forum.availproject.org/t/da-publishing-cost-zkevm-rollup-vs-zkevm-validium-on-avail/439 "2023-11-14T09:36:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![QEDK](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.availproject.org/qedk/32/22_2.png) [@QEDK](https://forum.availproject.org/u/QEDK)
#### Post date: [November 14, 2023, 9:36am UTC](https://forum.availproject.org/t/da-publishing-cost-zkevm-rollup-vs-zkevm-validium-on-avail/439/1 "2023-11-14T09:36:37Z")

</div>

Hey everyone,

We have [tested](https://github.com/QEDK/validium-benchmarks) both the [zkEVM Validium](https://github.com/availproject/validium-node) which uses Avail as its data availability layer and the [zkEVM Rollup](https://polygon.technology/polygon-zkevm) 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](https://blog.availproject.org/avail-ecosystem-series-polygon-zkevm-validium/#what-is-the-zkevm-validium) 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](https://blog.availproject.org/avail-ecosystem-series-polygon-zkevm-validium/#how-does-the-zkevm-validium-work).
- 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.

 ![](https://europe1.discourse-cdn.com/flex013/uploads/availproject/original/1X/cba7ceb64bc0d0ac9e2513b8dd8a209af7d53314.png "Chart")

### 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](https://blog.availproject.org/avail-ecosystem-series-polygon-zkevm-validium/#how-does-the-zkevm-validium-work) and you can view a more detailed schema in the [docs](https://github.com/availproject/validium-node?ref=blog.availproject.org#architecture).

 ![](https://europe1.discourse-cdn.com/flex013/uploads/availproject/original/1X/175cbc58ed3fe01e78bbda697c09178ecacfa59e.jpeg)

## zkEVM Validium Repos

You can build and test a zkEVM Validium using the [Validium node repo](https://github.com/availproject/validium-node?ref=blog.availproject.org) and these [contracts](https://github.com/availproject/validium-contracts?ref=blog.availproject.org).

Note that Avail is in [testnet](https://blog.availproject.org/introducing-avails-clash-of-nodes-incentivized-testnet/) prior to mainnet release and these repos have not been audited.

---

<div class="post-metadata">

### Author: ![fukuyamasato](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.availproject.org/fukuyamasato/32/894_2.png) [@fukuyamasato](https://forum.availproject.org/u/fukuyamasato)
#### Post date: [November 14, 2023, 8:00pm UTC](https://forum.availproject.org/t/da-publishing-cost-zkevm-rollup-vs-zkevm-validium-on-avail/439/3 "2023-11-14T20:00:20Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![QEDK](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.availproject.org/qedk/32/22_2.png) [@QEDK](https://forum.availproject.org/u/QEDK)
#### Post date: [November 14, 2023, 8:53pm UTC](https://forum.availproject.org/t/da-publishing-cost-zkevm-rollup-vs-zkevm-validium-on-avail/439/4 "2023-11-14T20:53:54Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![robin-rrt](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.availproject.org/robin-rrt/32/15_2.png) [@robin-rrt](https://forum.availproject.org/u/robin-rrt)
#### Post date: [November 15, 2023, 8:33am UTC](https://forum.availproject.org/t/da-publishing-cost-zkevm-rollup-vs-zkevm-validium-on-avail/439/5 "2023-11-15T08:33:23Z")

</div>


