Cointime

Download App
iOS & Android

Pricing Gas in Polygon zkEVM

Validated Project

The final Polygon zkEVM testnet, which launched last year, has seen a surge of developers and users eager to experience the future of Ethereum scaling.

The years-long technical achievements to get to this point have been enormous. Researchers working on zero-knowledge (ZK) to scale Ethereum have had to answer and address a bevy of design questions at every turn.

One interesting question that arises for all zkEVMs: how do you price gas?

In the Ethereum Virtual Machine (EVM), gas keeps the network secure by setting an economic fee for every computation. Malicious behaviors, like Denial of Service (DoS) attacks, are muted by setting a price to execute transactions. Gas limits define the total number of computational steps a transaction can execute.

So why is figuring out how to price gas in zkEVMs an interesting problem?

Because gas is supposed to reflect resource consumption for nodes (bandwidth/storage/compute), but when generating zkEVM proofs, some EVM opcodes are relatively more expensive to prove than to re-execute on a CPU.

In other words, some computations that require low gas fees in the EVM might become prohibitively expensive and slow down the network when proved in zkEVM. 

What does this mean? Solidity, the programming language for the EVM, is compiled into opcodes, which run on the blockchain. Each opcode does something simple, and each requires gas to execute. 

To translate gas pricing into zkEVM for these opcodes, there are three options, each of which requires different considerations: 

  1. Keep the gas schedule the same as in the EVM
  2. Reprice opcodes
  3. Keep the gas schedule, but also introduce a mechanism for DoS mitigation

We’ll walk through each option and explain the best design choice for Polygon zkEVM.

Keep the gas schedule? Or reprice opcodes?

Keeping the regular EVM gas fee schedule for Polygon zkEVM seems attractive enough, because existing contract behavior in the EVM would remain unchanged. This is ideal for developers who can easily and seamlessly deploy Ethereum dApps in a zkEVM environment, and a huge upside for EVM-equivalency. 

But maintaining gas fees without modification actually introduces a new vector for potential DDoS attacks. 

There are computations in the EVM which require low gas fees, but which in the context of a zkEVM become very expensive to prove. Cram enough opcodes into one block that are low-cost in EVM, but high-cost in zkEVM, and the network can experience serious lag. 

An example? Keccak hashes are expensive to prove in a zkEVM environment. Filling a block with the opcode “EXTCODESIZE” would only cost 100 gas, but cause a type-1 zkEVM to perform an unwieldy number of Keccak hashes–leading to a potential DoS vector.

So a 1:1 pricing scheme looks like it might cause some trouble.

Why not reprice opcodes, then, in order to reflect the proving cost in a zkEVM? (This is option two above.)

The problem is that some contracts rely on the current gas schedule to function as intended – opcodes like “GASLEFT,” for example, or “CALLSTIPEND.” Repricing opcodes for Polygon zkEVM might actually introduce unexpected behavior into dApps, causing developers unnecessary headaches. 

So that leads us to the best option for Polygon zkEVM…

Keep the gas schedule, but also introduce DoS mitigation

With its fast prover, Polygon zkEVM is able to keep the EVM gas schedule, but also introduces a mechanism by which DDoS attacks can be mitigated. In other words, contract functionality can be preserved without sacrificing the security and reliability of the network. 

How does Polygon zkEVM do it? 

First, the gas schedule remains the same. Opcodes are priced the same in Polygon zkEVM as they are in the EVM. 

Second, and most importantly, Polygon zkEVM introduces quotas to identify pathological transactions, like filling an entire block with EXTCODESIZE. Think of it like an extra security reflex. Only a certain number of Keccak hashes can be included in a block. Polygon zkEVM scans for malicious blocks that breach this quota, helping to ensure that expensive and network-slowing spam does not occur.

Due to the extremely fast Polygon zkEVM prover, the differences in compute cost between the L1 gas schedule and actual resource consumption in Polygon zkEVM remains marginal.

It’s the best of all worlds: seamless design integration coupled with a mechanism to prevent spam.

Read more: https://polygon.technology/blog/pricing-gas-in-polygon-zkevm

Comments

All Comments

Recommended for you

  • BTC breaks through $69,000

     market shows BTC breaking through $69,000, currently at $69,039, with a 24-hour increase of 3.96%. The market is highly volatile, please manage your risk accordingly.

  • The "BTC OG Insider Whale" deposited another 69.08 million USDT into a Binance deposit address associated with Yi Lihua.

    according to on-chain analyst Ai Yi (@ai_9684xtpa), the "BTC OG insider whale" has deposited 69.08 million USDT into a Binance deposit address associated with Yili Hua. In the past 11 hours, a total of 10,000 ETH and 69.08 million USDT have been transferred in, with a total value of 89.47 million USD.

  • BTC falls below $69,000

    the market shows BTC falling below $69,000, currently at $68,957.16, with a 24-hour increase of 5.84%. The market is highly volatile, please manage your risk accordingly.

  • ETH breaks $2,000

    the market shows ETH breaking through $2000, currently at $2000.7, with a 24-hour decline of 3.93%. The market is highly volatile, please manage your risk accordingly.

  • BTC breaks through $68,000

    the market shows BTC breaking through $68,000, currently at $68,000.01, with a 24-hour decline of 3.33%. The market is highly volatile, please manage your risk accordingly.

  • BTC breaks through $67,000

    the market shows BTC breaking through $67,000, currently at $67,006.7, with a 24-hour decline of 3.83%. The market is highly volatile, please manage risk accordingly.

  • COINMY Named Title Sponsor of “The Silent Rise” Summit in Hong Kong on February 9

    According to CoinTime, COINMY has been confirmed as the title sponsor of “The Silent Rise” summit, taking place in Hong Kong on February 9. COINMY (CMY) is a globally compliant digital asset exchange focused on bridging traditional payment systems with the crypto ecosystem, with an emphasis on transparency, security, and efficient global trading infrastructure. “The Silent Rise” is a themed summit co-hosted by RWAX, METASTONE, ChainTimes, and other ecosystem partners, with sponsorship support from CoinMy, Nexus Chain, and several more Web3 projects. The event will be held from 14:00 to 22:00 on February 9 at the 28th floor of Crowne Plaza Hong Kong Causeway Bay, and is positioned as one of the most anticipated side events during Consensus Hong Kong 2026. The summit will feature multiple roundtable discussions covering key themes such as AI, Real-World Assets (RWA), and next-generation financial systems. The summit brings more than 20 prominent speakers to explore emerging trends, system design, and the evolving architecture of Web3.

  • Cardano founder: Over $3 billion lost in the crypto space

    On February 6, Cardano founder Charles Hoskinson revealed in a live broadcast that despite losing more than 3 billion US dollars in the crypto field, he still chooses to stay in the industry rather than quit. In response to external comments that he can afford the losses because he is wealthy, he said: "If you think I am in this business for the money, you are completely wrong — even if I lose everything, I will not stop."

  • Tether makes a $100 million strategic equity investment in Anchorage Digital

    Tether announced a $100 million strategic equity investment in Anchorage Digital. Anchorage Digital Bank N.A. is the first federally regulated digital asset bank in the United States, providing staking, custody, governance, settlement, and stablecoin issuance services to global institutions and innovators to promote the shared goal of advancing the next phase of digital asset applications.

  • ETH falls below $2100

    the market shows ETH fell below $2100, currently at $2099.68, with a 24-hour decline of 7.97%. The market is highly volatile, please manage your risk accordingly.