Abstract’s gas fees depend on the fluctuating gas prices on Ethereum. As mentioned in the transaction lifecycle section, Abstract posts state diffs (as well as compressed contract bytecode) to Ethereum in the form of blobs.

In addition to the cost of posting blobs, their are costs associated with generating ZK proofs for batches and committing & verifying these proofs on Ethereum.

To fairly distribute these costs among L2 transactions, gas fees on Abstract are charged proportionally to how close a transaction brought a batch to being sealed (i.e. full).

Components

Fees on Abstract therefore consist of both off-chain and on-chain components:

  1. Off-chain Fee:
    • Fixed cost (approximately $0.001 per transaction).
    • Covers L2 state storage and zero-knowledge proof generation.
    • Independent of transaction complexity.
  2. On-chain Fee:

Differences from Ethereum

AspectEthereumAbstract
Fee CompositionEntirely on-chain, consisting of base fee and priority fee.Split between off-chain (fixed) and on-chain (variable) components.
Pricing ModelDynamic, congestion-based model for base fee.Fixed off-chain component with a variable on-chain part influenced by Ethereum gas prices.
Data EfficiencyPublishes full transaction data.Publishes only state deltas, significantly reducing on-chain data and costs.
Resource AllocationEach transaction independently consumes gas.Transactions share batch overhead, potentially leading to cost optimizations.
Opcode PricingEach opcode has a specific gas cost.Most opcodes have similar gas costs, simplifying estimation.
Refund HandlingLimited refund capabilities.Smarter refund system for unused resources and overpayments.

Gas Refunds

You may notice that a portion of gas fees are refunded for transactions on Abstract. This is because accounts don’t have access to the block.baseFee context variable; and have no way to know the exact fee to pay for a transaction.

Instead, the following steps occur to refund accounts for any excess funds spent on a transaction:

1

Block overhead fee deduction

Upfront, the block’s processing overhead cost is deducted.

2

Gas price calculation

The gas price for the transaction is then calculated according to the EIP-1559 rules.

3

Gas price calculation

The maximum amount of gas (gas limit) for the transaction is deducted from the account by having the account typically send tx.maxFeePerErg * tx.ergsLimit. The transaction is then executed (see transaction flow).

4

Gas refund

Since the account may have overpaid for the transaction (as they are sending the maximum fee possible), the bootloader refunds the account any excess funds that were not spent on the transaction.

Transaction Gas Fields

When creating a transaction on Abstract, you can set the gas_per_pubdata_limit value to configure the maximum gas price that can be charged per byte of pubdata (data posted to Ethereum in the form of blobs). The default value for this parameter is 50000.