PreVerification Gas (PVG) is a fee charged by a blockchain network or layer-2 rollup to cover the initial computational cost of validating a transaction's basic integrity before it enters the mempool or execution phase. This upfront payment acts as a spam-prevention mechanism, deterring users from flooding the network with invalid or computationally expensive transactions. By requiring this cost, the system ensures that only transactions with a genuine economic incentive proceed, optimizing node resources and maintaining network performance. It is a distinct fee from the standard execution gas paid for on-chain computation and state changes.
PreVerification Gas
What is PreVerification Gas?
PreVerification Gas (PVG) is a transaction fee mechanism designed to prevent spam and ensure network efficiency by requiring payment for initial computational work before a transaction is fully processed.
The PVG fee is typically calculated based on the intrinsic properties of a transaction, such as its size (calldata length), signature verification complexity, and other pre-execution checks. For example, in zk-Rollups like zkSync Era, PVG covers the cost of verifying cryptographic proofs and preparing the transaction for inclusion in a batch. This process is separate from the gas used to run the smart contract logic on the destination chain. If a transaction fails these initial checks, the PVG is still consumed, as the computational work has already been performed by the network's validators or sequencers.
From a user's perspective, PVG is often bundled into the total estimated transaction fee presented by a wallet. However, it represents a critical, non-refundable component that secures network health. Its implementation is particularly vital for Layer 2 solutions and high-throughput chains, where unchecked transaction submission could easily overwhelm system capacity. By economically aligning user behavior with network efficiency, PVG mechanisms protect against denial-of-service (DoS) attacks and ensure that block space is used responsibly, creating a more stable and predictable environment for all participants.
How PreVerification Gas Works
A technical breakdown of the preverification gas mechanism, a critical component for managing transaction costs and network efficiency in Ethereum and other EVM-compatible blockchains.
Preverification gas (PVG) is the portion of a transaction's total gas that is estimated and paid upfront to cover the computational cost of initial validation and signature checks before a transaction is included in a block. This initial validation, performed by nodes upon receiving a transaction, includes verifying the sender's signature, checking the nonce, and ensuring the account has sufficient balance to pay the maxFeePerGas * gasLimit. This upfront payment prevents spam by requiring a minimum economic commitment for network consideration, distinct from the execution gas used for running the smart contract code.
The process works by having the transaction sender specify a gasLimit and a maxFeePerGas. The network nodes multiply these values to determine the maximum transaction fee the sender is willing to pay. A portion of this maximum fee is consumed as PVG during the initial checks. If these basic validations fail—for instance, if the signature is invalid or the nonce is incorrect—the transaction is rejected, and the sender forfeits the PVG. This creates a cost for submitting invalid transactions, protecting the network from certain denial-of-service attacks.
It's crucial to distinguish PVG from the total gas used. The execution gas is only consumed if the transaction passes preverification and is executed within a block. The actual fee paid is gasUsed * baseFee + priorityFee, where gasUsed includes both execution gas and a smaller, fixed amount for intrinsic gas costs like data storage. Therefore, a transaction with high PVG costs might still have low execution costs if its logic is simple, but the sender must always have enough balance to cover the maximum potential fee (gasLimit * maxFeePerGas) at the moment of submission.
For developers, underestimating PVG requirements is a common cause of transaction failure. Wallets and libraries like Ethers.js or Web3.js automatically estimate a gasLimit that includes a safety margin for both preverification and execution. However, for complex transactions or during network congestion, manual adjustment may be necessary. A transaction will revert if the gasLimit is set too low to cover the PVG, resulting in an "out of gas" error before any contract code runs, emphasizing the need for accurate gas estimation strategies.
Key Features and Purpose
PreVerification Gas (PVG) is a mechanism designed to prevent spam and ensure economic security for off-chain services, particularly in account abstraction and intent-based systems. It requires users to pay a small, refundable fee before their transaction is processed by a third-party service.
Spam Prevention
PVG acts as a sybil-resistance mechanism by imposing a sunk cost on transaction submitters. This economically disincentivizes bad actors from flooding a network or service provider with invalid or malicious transaction bundles, protecting the system's availability and operational integrity.
Refundable Security Deposit
The core feature of PVG is its refundability. Users pay the fee upfront, but it is returned if their transaction is deemed valid and is included in a block. This ensures honest users are not penalized, while attackers who submit spam lose the deposited funds.
Enabling Account Abstraction
PVG is critical for ERC-4337 and other account abstraction frameworks. It allows Bundlers (off-chain actors who package user operations) to be compensated for their computational work in simulating and forwarding transactions, without relying on in-band transaction fees.
Intent-Based System Safeguard
In intent-based architectures, where users specify a desired outcome rather than a transaction, PVG secures the off-chain solver network. It prevents solvers from wasting resources on impossible or malicious intents, ensuring the marketplace for fulfillment remains efficient.
Economic Design & Incentives
The PVG amount is set to balance user accessibility and system security. Key design considerations include:
- Cost Recovery: Covers the solver/bundler's gas costs for simulation.
- Attack Cost: Sets a price floor for spam, making attacks economically non-viable.
- Refund Logic: Integrated into the on-chain settlement to guarantee repayment for valid submissions.
Workflow Example
A typical PVG flow in ERC-4337:
- User signs a UserOperation and submits it to a mempool with a PVG pledge.
- Bundler simulates the op; if it passes, the bundler includes it in a bundle.
- On-Chain: The EntryPoint contract validates the bundle.
- Settlement: If valid, the user's PVG is refunded. If invalid, the PVG is forfeited to the bundler as compensation.
PreVerification Gas vs. Other Gas Types in ERC-4337
A comparison of the distinct gas fee components within an ERC-4337 UserOperation, detailing their purpose, payer, and calculation.
| Gas Type | Purpose | Payer | When Calculated | Refundable? |
|---|---|---|---|---|
PreVerification Gas | Covers off-chain bundler work (signature verification, simulation) | User (via wallet) | Before submission to mempool | |
Verification Gas Limit | Covers on-chain execution of the wallet's | User (deducted from deposit) | During UserOperation execution | |
Call Gas Limit | Covers on-chain execution of the UserOperation's | User (deducted from deposit) | During UserOperation execution | |
Max Priority Fee | Tip to the bundler/validator for transaction ordering | User (via wallet) | At time of bundler inclusion | |
Max Fee Per Gas | Base fee + priority fee cap for the network block | User (via wallet) | At time of bundler inclusion |
How is PreVerification Gas Calculated?
An explanation of the deterministic gas cost for verifying a transaction's signature and basic validity before it enters the mempool.
PreVerification Gas (PVG) is a deterministic gas cost calculated by an Ethereum node to cover the computational work of performing initial validation on a transaction before it is accepted into the mempool. This validation includes verifying the transaction's cryptographic signature, checking the nonce against the sender's current state, and ensuring the sender has sufficient balance to pay the maxPriorityFeePerGas and maxFeePerGas. Unlike execution gas, PVG is paid upfront and is not refunded, as the work is performed regardless of whether the transaction ultimately succeeds or fails during block execution.
The calculation is performed by the client software (e.g., Geth, Erigon) using a fixed gas cost schedule defined in the Ethereum protocol. Key components include a base cost of 21,000 gas for any transaction, plus additional gas for signature verification which depends on the transaction type: - 0 gas for a legacy transaction with a simple ECDSA signature. - 4,500 gas for an EIP-1559 transaction due to additional signature operations. - A variable amount for more complex account abstraction transactions involving EIP-4337 paymasters or signature aggregators. The node sums these fixed costs to arrive at the PVG total.
This gas is conceptually 'charged' against the transaction's maxFeePerGas limit during validation. If the calculated PVG multiplied by the maxFeePerGas exceeds the transaction's upfront payment (value sent with the transaction), the node will reject it immediately. This mechanism protects the network from Denial-of-Service (DoS) attacks by ensuring that spammers pay for the cost of initial validation, preventing the flooding of the mempool with invalid transactions that would waste node resources.
Ecosystem Implementation
PreVerification Gas (PVG) is a mechanism designed to prevent spam and ensure economic viability for on-chain computations, particularly for complex operations like zero-knowledge proof verification. It is a fee paid upfront, before a transaction is included in a block, to cover the cost of initial validation.
Core Purpose & Economic Security
The primary function of PreVerification Gas is to impose a sybil-resistance cost on transaction submission. By requiring a fee for the initial computational work (e.g., signature verification, proof validation), it disincentivizes spam and denial-of-service attacks. This ensures network resources are allocated to transactions with provable economic intent, protecting sequencers and validators from being flooded with invalid or malicious payloads.
Implementation in zk-Rollups
In zk-Rollup architectures like zkSync and StarkNet, PVG is critical for covering the cost of zero-knowledge proof verification before a batch is accepted. The sequencer must perform this computationally intensive check to ensure the batch's validity. PVG acts as a deposit for this work; if the proof is valid, the gas is applied to the final settlement. If invalid, the PVG is forfeited, penalizing the submitter.
Fee Market Dynamics
PVG operates within the broader gas fee market. Its price can fluctuate based on:
- Network Demand: Congestion on the base layer (e.g., Ethereum) can increase PVG costs.
- Proof Complexity: Larger circuits or more complex proofs require more verification work.
- Sequencer Policy: Individual rollup sequencers may implement different pricing models for PVG based on their operational costs and risk tolerance.
User & Developer Flow
For users and dApp developers, PVG represents an additional upfront cost in the transaction lifecycle.
- Wallet Integration: Wallets must estimate and request PVG alongside standard gas fees.
- Revert Handling: If a transaction fails pre-verification (e.g., an invalid signature), the PVG is consumed, but the main execution gas is not spent.
- Estimation Tools: RPC providers and SDKs offer methods to estimate PVG requirements for specific transaction types.
Contrast with Standard Gas
PVG is distinct from execution gas paid for on-chain state changes.
- Timing: PVG is paid before block inclusion; execution gas is paid after.
- Refundability: PVG for failed pre-verification is not refundable; execution gas for a reverted call may be partially refunded.
- Purpose: PVG secures the entry point; execution gas compensates for state computation and storage.
Evolving Standards & EIPs
The concept is part of a broader evolution in transaction pricing. Related Ethereum Improvement Proposals (EIPs) and research include:
- EIP-4844 (Proto-Danksharding): Introduces blob gas, a separate fee market for data, influencing rollup economics.
- EIP-1559: Its fee market design principles (base fee, priority fee) often inform PVG pricing models.
- Account Abstraction (ERC-4337): Paymasters may be designed to sponsor or manage PVG payments on behalf of users.
Security and Economic Considerations
PreVerification Gas (PVG) is a mechanism designed to prevent spam and ensure economic viability in blockchain systems, particularly those with parallel execution. It requires users to pay a fee upfront for transaction validation before inclusion in a block.
Spam Prevention Mechanism
The primary security function of PreVerification Gas is to act as a sybil resistance mechanism. By requiring a non-refundable fee for the computational work of pre-execution (e.g., signature verification, basic sanity checks), it imposes a direct economic cost on bad actors attempting to flood the network with invalid transactions. This protects validators and sequencers from resource exhaustion attacks.
Economic Alignment & Fee Markets
PVG creates a fee market for validation resources, separate from the fee for block space (execution gas). This ensures that the entity performing pre-verification (e.g., a bundler in an ERC-4337 UserOperation context) is compensated for their work, even if the transaction later fails or is outbid. It aligns incentives by making validation a profitable service.
Refund Policy Nuances
A critical economic consideration is the refundability of PVG. Policies vary:
- Non-refundable: The fee is paid for the validation service, regardless of the transaction's eventual success or inclusion. This strongly discourages spam.
- Conditionally refundable: The fee may be refunded if the transaction is included in a block, creating a softer economic model. The chosen policy directly impacts user experience and security guarantees.
Parallel Execution Pre-requisite
In high-throughput, parallel-execution environments (e.g., Solana, Aptos, Monad), PVG is essential. Parallel transaction processing requires knowing a transaction's read/write sets in advance to schedule it efficiently. PVG funds the initial execution to determine these dependencies, preventing validators from wasting resources on transactions that will later conflict or fail.
Interaction with Max Priority Fee
PVG is distinct from Max Priority Fee (tip). The tip incentivizes a block producer to include a transaction. PVG compensates for the work to validate it for inclusion. A transaction must pay sufficient PVG to be deemed valid and a sufficient tip to be attractive for inclusion, creating a two-dimensional fee market.
Wallet & User Experience Impact
For end-users, PVG introduces complexity. Wallets must:
- Estimate two separate gas costs (PVG + execution gas).
- Possibly handle partial failure (e.g., paying PVG but the transaction not being included).
- Manage gas token balances for pre-verification, which may differ from the token used for execution fees. This affects transaction reliability and UX design.
Frequently Asked Questions (FAQ)
PreVerification Gas (PVG) is a critical, upfront cost in account abstraction and ERC-4337 UserOperations. This FAQ addresses common technical questions about its purpose, calculation, and optimization.
PreVerification Gas (PVG) is the upfront gas cost a bundler must pay to perform initial validation and simulation of a UserOperation before including it in a bundle for the EntryPoint contract. It is required to prevent denial-of-service (DoS) attacks, as bundlers must verify the operation's signature, nonce, and paymaster validity, which consumes computational resources. This cost is separate from the execution gas paid later on-chain and ensures only valid, willing-to-pay operations enter the mempool. The bundler pays the PVG and is later refunded for it, along with a priority fee, upon successful on-chain execution of the bundled operations.
Get In Touch
today.
Our experts will offer a free quote and a 30min call to discuss your project.