As the Ethereum network continues to grow, so do its challenges with scalability and high transaction fees. To address these issues, Layer-2 solutions like zkSync have emerged, offering significant improvements in transaction speed and cost efficiency. zkSync, developed by Matter Labs, leverages zero-knowledge rollups (ZK-rollups) to enhance Ethereum's performance. This blog post will explore the fee structure of zkSync's Layer-2 rollups, detailing how it works and the benefits it offers.
zkSync is a Layer-2 scaling solution for Ethereum that uses ZK-rollups to bundle multiple transactions into a single batch. This batch is then submitted to the Ethereum mainnet, significantly reducing the amount of data that needs to be processed on-chain. By doing so, zkSync lowers transaction costs and increases throughput while maintaining the security and decentralization of the Ethereum network.
The fee structure on zkSync is designed to be transparent and efficient, breaking down into several key components:
These costs are associated with publishing data to the Ethereum mainnet (Layer-1) and include:
L1 Commit Batches: This involves submitting the list of updated storage slots (pubdata) to L1. The cost is calculated as constant overhead + price of pubdata
, with the overhead evenly distributed among L2 transactions in the batch[2][7].
L1 Prove Batches: Once an off-chain proof is generated, it is submitted to L1 to finalize the rollup batch. Each proof typically contains one L1 batch[2].
L1 Execute Batches: This processes L2 to L1 messages and marks executed priority operations. Multiple L1 batches can be included in a single execute transaction[2].
These are the fees users pay to complete transactions on zkSync. They are calculated as gasUsed x baseFeePerGas
, where gasUsed
is the actual gas consumed by the transaction, and baseFeePerGas
is the base fee per unit of gas[2][7].
The fee structure includes:
Execution Fee: The cost for processing the transaction on L2.
Data Fee: The cost of publishing data to L1.
Proof Generation and Verification Costs: The costs associated with generating and verifying zero-knowledge proofs.
Contract Deployment Costs: One-time costs for deploying new contracts to L1[1][2].
zkSync provides refunds for unused system resources and overpaid computation, ensuring users are not overcharged for their transactions. Refund rates vary depending on the transaction type, with typical refunds being approximately 49% for ETH transfers, 56% for ERC20 transfers, and 64% for swaps[1][2].
This includes the operational costs required for proof generation and verification, divided among all transactions in a batch. The protocol aggregates as many transactions as possible into a single batch, and each transaction proportionally pays for the batch overhead based on its resource usage[2][7].
zkSync significantly reduces transaction costs compared to Ethereum's Layer-1 by aggregating multiple transactions into a single batch and publishing only the state differences to L1. This approach minimizes the amount of data that needs to be processed on-chain, leading to lower gas fees[1][2][5].
By offloading computation and data storage to Layer-2, zkSync can handle a higher volume of transactions. The protocol supports over 2,000 transactions per second (TPS), with future upgrades like zkPorter expected to increase this to over 20,000 TPS[3][8][9].
zkSync inherits the security properties of Ethereum, ensuring robust protection against attacks. The use of zero-knowledge proofs guarantees the validity of transactions without revealing private details, enhancing both security and privacy[4][5][10].
zkSync supports various transaction types, including ETH transfers, ERC20 transfers, swaps, and contract deployments. The protocol also allows for custom fee structures and refunds, providing flexibility for different use cases[1][2][7].
zkSync's Layer-2 rollups offer a compelling solution to Ethereum's scalability and high transaction fee challenges. By leveraging zero-knowledge proofs and an efficient fee structure, zkSync provides cost-effective, scalable, and secure transactions. As the protocol continues to evolve, it promises to further enhance the Ethereum ecosystem, making it more accessible and efficient for users and developers alike.
Citations:
[1] https://blog.kroma.network/l2-scaling-landscape-fees-and-max-tps-fe6087d3f690?gi=952eb389f2a5
[2] https://docs.zksync.io/zk-stack/concepts/fee-mechanism.html
[3] https://ideasoft.io/blog/zksync-2-0-solution-the-future-for-defi-projects/
[4] https://learn.smoothie.so/articles/web3-101-zksync
[6] https://www.zeeve.io/blog/optimistic-vs-zk-rollups-comparing-their-feasibility-for-dapps/ [7] https://docs.zksync.io/build/developer-reference/fee-model.html
[8] https://cruxpool.com/blog/why-is-zksync-a-good-layer-2-solution-to-ethereum-transaction-fees/
[9] https://www.placeholder.vc/blog/2021/7/21/zksync-scaling-ethereum
[10] https://blog.quarkslab.com/zksync-transaction-workflow.html
[11] https://docs.zksync.io/build/developer-reference/rollups.html
[12] https://www.immunebytes.com/blog/zksync-a-secret-sauce-leveraging-blockchain-technology/
[13] https://l2beat.com/scaling/projects/zksync-lite
[14] https://thedefiant.io/news/cefi/transaction-fees-on-layer-2-plummet-post-dencun [15] https://blockworks.co/news/zk-rollups-cheaper-with-scale
[16] https://l2fees.info
[17] https://www.linkedin.com/pulse/zk-rollups-vs-optimistic-rollups-overview-garima-singh-p1mvf
[18] https://docs.zksync.io/zk-stack/concepts/transaction-lifecycle.html