7Block Labs
Ethereum Improvement Proposals

ByAUJay

EIP-7623 Migration Guide: Refactoring Contracts to Reduce Calldata Footprint

EIP-7623, activated in Ethereum’s May 7, 2025 Pectra upgrade, changes how transactions are priced when they carry lots of calldata. This guide shows exactly what changed, how to measure your exposure, and concrete refactoring patterns to shrink calldata or shift it to blobs—complete with code and sizing math. (eips.ethereum.org)

Summary: EIP-7623 introduces a “calldata floor” that makes data-heavy transactions more expensive, while leaving typical compute-heavy dapp calls mostly unaffected. Teams can avoid surprises (and often save money) by shifting data to blobs (EIP‑4844), packing inputs, using commitments+proofs, and leveraging BLS aggregation.


1) What exactly changed with EIP‑7623?

At a high level: transactions now pay the max of (a) the traditional gas formula and (b) a new calldata floor that scales with how many “tokens” your calldata contains. The proposal is live on mainnet as part of Pectra. (eips.ethereum.org)

  • Key constants (from the EIP spec):

    • STANDARD_TOKEN_COST = 4
    • TOTAL_COST_FLOOR_PER_TOKEN = 10
    • tokens_in_calldata = zero_bytes + 4 × nonzero_bytes
    • New rule: tx.gasUsed = 21,000 + max( 4 × tokens_in_calldata + execution_gas_used + create_costs, 10 × tokens_in_calldata ) (eips.ethereum.org)
  • Intuition and threshold:

    • The floor kicks in when execution_gas_used < (10−4) × tokens_in_calldata = 6 × tokens_in_calldata.
    • If your transaction computes a lot relative to the bytes it carries, you stay on the left side (unchanged). If you mostly post data (e.g., DA payloads), you hit the 10/40 gas-per-byte floor (10 for zeros, 40 for nonzeros). (eips.ethereum.org)
  • Why Ethereum did this:

    • To cap worst‑case block sizes, make room for more blobs, and reduce variance. This pairs with EIP‑7691, which increased blob throughput (target 6 blobs, max 9 per block) in the same Pectra upgrade. (blog.ethereum.org)
  • Status and timing:

    • Pectra (Prague/Electra) was activated on mainnet on May 7, 2025 (epoch 364,032) and includes EIP‑7623 among other core EIPs. (eips.ethereum.org)

2) Should you act? A quick decision matrix

  • Probably unaffected:

    • Typical end‑user calls (ERC‑20 transfers, swaps, NFT mints) where execution gas dominates: 60k–200k+ execution gas vs ~100 bytes calldata. 6 × tokens_in_calldata is tiny compared to execution gas here, so the floor doesn’t apply. (eips.ethereum.org)
  • Must act:

    • Any workflow that ships large arrays, attachments, batched proofs, or bulk state in calldata (airdrop allocations, batched claims, off-chain data anchoring, index updates, content storage, etc.). These will almost always fall under the calldata floor. Move this data to blobs or compress/commit it instead. (eips.ethereum.org)
  • Strategic context:

    • Blob capacity was doubled in Pectra (EIP‑7691). Blob fees have been near-zero post‑Pectra because demand hasn’t filled the higher target, making now the cheapest time to migrate DA from calldata to blobs. (eips.ethereum.org)

3) Measure your exposure with one number

The minimal extra gas your tx must reserve due to 7623 is:

  • floor_gas = 10 × tokens_in_calldata
  • where tokens_in_calldata = (#zero_bytes) + 4 × (#nonzero_bytes)

You can estimate this client‑side from the hex payload:

// Node/Browser utility: estimate EIP-7623 floor contribution
export function calldataFloor(hexData: string) {
  const bytes = Buffer.from(hexData.replace(/^0x/, ''), 'hex');
  let zeros = 0, nonzeros = 0;
  for (const b of bytes) (b === 0) ? zeros++ : nonzeros++;
  const tokens = zeros + 4 * nonzeros;
  return { zeros, nonzeros, tokens, floorGas: 10 * tokens, thresholdExecGas: 6 * tokens };
}

// Example: 68B ERC-20 transfer input (mostly non-zeros)
const ex = calldataFloor("0xa9059cbb000000000000000000000000..."); // truncated
// Compare your measured executionGasUsed vs ex.thresholdExecGas to see if floor applies.

Transactions are invalid if gasLimit < 21000 + max(intrinsic, floor_gas). Update off-chain gas estimators accordingly. (eips.ethereum.org)


4) Refactor patterns that work now

Pattern A — Shift data availability to blobs (EIP‑4844)

Best for: L2 sequencers, or any system that needs data available to verifiers but not read synchronously by a contract.

  • How it works:
    • Post large payloads as blobs in a type‑3 “blob‑carrying” transaction. Contracts cannot read blob contents directly, but they can read the versioned blob hashes via the BLOBHASH opcode and verify KZG proofs with the point‑evaluation precompile (0x0A). (eips.ethereum.org)
  • Why now:
    • Pectra’s EIP‑7691 doubled blob throughput (target 6/max 9), and blob fees dropped near zero post‑upgrade—so the economics strongly favor blobs vs calldata. (eips.ethereum.org)
  • Durability and ops notes:
    • Blobs persist ~18 days on the consensus layer; if you need longer retention, mirror to your archival infra (Blockscout indexes blobs; several providers expose blob APIs). (eips.ethereum.org)

Minimal integration example (on-chain reference):

// Read blob versioned hash at index i and record it
uint256 i = 0;
bytes32 vh;
assembly { 
  // BLOBHASH opcode (0x49) pushes versioned hash for tx blob at index i
  // solidity doesn't expose it yet; inline-asm or prebuilt lib
  mstore(0x00, i)
  // pseudo: vh = blobhash(i)
}
// store vh; later verify a field element with the KZG point-eval precompile

Design pattern: pass versioned hash(es) to your contract, then verify only the minimal field(s) you need using the KZG point‑evaluation precompile, not the entire payload. (eips.ethereum.org)

Pattern B — Replace arrays with commitments + per‑user proofs

Best for: airdrops, allowlists, and any batch distribution.

  • Old: send N addresses/amounts in calldata.
  • New: store a Merkle (or KZG) commitment on‑chain once; users submit short proofs individually.
  • Benefit: shrink calldata from O(N) to O(1) per claim; avoids hitting the 10/40 floor for batch updates. Combine with blobs if a verifier needs temporary DA. (eips.ethereum.org)

Pattern C — Pack calldata tightly and decode in Yul

Best for: hot paths where you control both client and contract, and the contract must actually read the values.

  • Standard ABI packs most scalars into 32-byte slots—wasteful. Instead:
    • Accept a
      bytes
      payload with densely packed fields (bit-level).
    • Decode with Yul to keep compute low while saving bytes.

Example: pack 3 addresses (20B each) + 2 uint128 (16B each) into 92B instead of 5×32=160B (−68B). If most bytes are nonzero, tokens drop by ~4×68=272 tokens; the floor and thresholdExecGas fall by 2720 and 1632 gas respectively, often enough to avoid the floor on borderline calls.

function execPacked(bytes calldata p) external {
  // Layout: [addrA(20)|addrB(20)|addrC(20)|u128x(16)|u128y(16)]
  address a; address b; address c; uint128 x; uint128 y;
  assembly {
    let ptr := p.offset
    a := shr(96, calldataload(ptr))               // first 20B
    b := shr(96, calldataload(add(ptr, 20)))      // next 20B
    c := shr(96, calldataload(add(ptr, 40)))      // next 20B
    x := shr(128, calldataload(add(ptr, 60)))     // next 16B
    y := shr(128, calldataload(add(ptr, 76)))     // last 16B
  }
  // ...use a,b,c,x,y...
}

Trade‑off: extra compute for decoding vs bytes saved. Under 7623, leaning into a bit more compute is often cheaper than paying the 10/40 floor. (eips.ethereum.org)

Pattern D — Aggregate signatures with BLS (EIP‑2537)

Best for: multi‑sig attestations, allowlists, or oracle reports where many signers endorse the same message.

  • Replace N×65‑byte ECDSA signatures with one 96‑byte BLS aggregated signature and verify via the new BLS12‑381 precompiles (pairing/multi‑scalar‑mult). You massively cut calldata while paying predictable precompile gas (e.g., pairing base cost 37,700 + 32,600×k). (eips.ethereum.org)

Design note: batch verification patterns and MSM precompiles make BLS practical at the application layer post‑Pectra.

Pattern E — On‑chain catalogs and ID indirection

Best for: repeated parameters shared across calls.

  • Publish static configs once (e.g., an address list, IPFS CID, price table) and refer by ID in future calls. You trade one‑time storage cost for recurring calldata reductions. Combine with CREATE2 determinism to derive addresses from salts instead of sending them explicitly.

Pattern F — Skip base64 and human‑readable encodings

  • Base64 inflates bytes by ~33% and increases nonzero density. Prefer compact binary layouts and domain‑specific compression (e.g., varints, bit‑slicing). Under 7623, nonzero bytes are 4× more “expensive” in tokens than zeros when the floor applies. (eips.ethereum.org)

Pattern G — Batch/sponsor calls to amortize fixed costs

  • 21,000 intrinsic gas is still per‑transaction. Use smart-account flows (e.g., ERC‑4337) or EIP‑7702‑enabled delegation to batch intent execution, reducing per‑action overhead while you also shrink inputs. The 7623 spec explicitly notes bundling does not undermine block‑size goals. (eips.ethereum.org)

5) When blobs are the right answer (and how to wire them)

If your contract doesn’t need to synchronously read the bulk data, prefer blobs:

  • Post the payload in a blob, pass only:
    • one or more blob versioned hashes (via BLOBHASH),
    • minimal witnesses/indices to prove the single field you care about (point‑evaluation precompile at 0x0A verifies KZG openings). (eips.ethereum.org)
  • Economics:
    • With Pectra (EIP‑7691), blob capacity grew to target 6/max 9 blobs per block. Post‑Pectra, median blob prices briefly collapsed near zero as usage lagged the new target, increasing the advantage vs calldata. (eips.ethereum.org)
  • Ops:
    • Blobs live ~18 days on consensus; if you need longer retention, mirror to your indexers or use services archiving blobs (e.g., Blockscout). (eips.ethereum.org)

6) Gas‑limit, estimation, and failure‑proofing under 7623

Wallets and RPCs must account for the calldata floor in eth_estimateGas; otherwise users hit “out of gas” despite sufficient ETH. The EIP requires these updates; ensure your stack (wallet, bundler, relayer) has them. (eips.ethereum.org)

  • Minimal safe gasLimit:
    • gasLimit ≥ 21,000 + max(intrinsic_gas, 10 × tokens_in_calldata)
  • Programmatic guardrail (pseudo):
    • if (estimatedExecGas + 4×tokens + createCost) < (10×tokens) then bump gasLimit to meet the floor.

Practical note: some bundlers initially rejected txs whose gasLimit didn’t pre‑reserve the floor. Add a pre‑send check using the earlier utility to avoid mempool churn. (eips.ethereum.org)


7) Worked examples with numbers

  • Example 1: ERC‑20 transfer

    • Calldata ≈ 68B (mostly nonzeros) → tokens ≈ 4×68 = 272
    • thresholdExecGas = 6×272 = 1,632
    • Typical exec gas ≈ 50k+, so the left side (standard compute pricing) dominates; no change. (eips.ethereum.org)
  • Example 2: Submit 10 kB of nonzero payload to a contract

    • tokens ≈ 4×10,240 = 40,960; floor = 409,600 gas
    • Unless your exec gas > 245,760 (6×tokens), you pay the floor; this is exactly the pattern 7623 targets—move to blobs or pack heavily. (eips.ethereum.org)
  • Example 3: BLS aggregate vs ECDSA pile

    • 100 ECDSA signatures in calldata = 100×65 = 6,500 bytes (≈ 26,000 tokens if nonzero-heavy) → likely floor territory.
    • 1 BLS aggregate signature = 96 bytes; verify with 2–3 pairings (precompile cost ≈ 37,700 + 32,600×k) plus a few MSM ops. You swap thousands of calldata bytes for a few hundred thousand compute gas—usually cheaper post‑7623. (eips.ethereum.org)

8) L2s and rollups: the new default is “blob‑first”

If you operate an L2 or DA‑heavy service:

  • Target type‑3 blob transactions for batch data and keep calldata for small control parameters.
  • Post‑Pectra, rollups purchased ~20.8% more blobs/day yet still underused the new target, pushing blob prices to near‑zero and improving rollup economics (e.g., Base). This makes blob migration not only necessary post‑7623 but also cost‑optimal. (galaxy.com)

9) Future‑proofing: plan for stricter floors

A follow‑on draft (EIP‑7976) proposes raising the calldata floor further (to 15/60). Even if parameters change before inclusion, the direction is clear: large DA in calldata will be increasingly penalized as blob capacity rises. Design now so you can tolerate a higher floor without a refactor. (eips.ethereum.org)


10) Implementation checklist (30/60/90 days)

  • Week 1–2: Measure and gate

    • Instrument calldata tokens and floor thresholds in CI and pre‑send tooling.
    • Fail builds for functions whose inputs exceed a configured token budget. (eips.ethereum.org)
  • Week 3–6: Refactor

    • Move DA payloads to blobs; wire in BLOBHASH + point‑evaluation proofs.
    • Replace big arrays with commitments; migrate to packed calldata + Yul decoders on hot paths.
    • Introduce BLS aggregation for multi‑sig workflows where feasible. (eips.ethereum.org)
  • Week 7–12: Harden and optimize

    • Update gas estimation to pre‑reserve the calldata floor; add mempool policy tests.
    • Roll out on testnets (Holesky/Sepolia) with blob flows; rehearse data mirroring for 18‑day blob expiry. (eips.ethereum.org)

11) Executive talking points (for decision‑makers)

  • Risk: Data‑heavy calls now trigger a floor cost (10/40 gas per zero/nonzero byte), and txs that don’t reserve it are invalid. Teams with DA in calldata will see costs rise and potentially fail transactions. (eips.ethereum.org)
  • Opportunity: Pectra doubled blob throughput and blob fees are near zero—moving DA to blobs reduces cost and bandwidth risk and aligns with Ethereum’s roadmap. (eips.ethereum.org)
  • Action: Fund a short migration sprint to “blob‑first” and “packed‑calldata” patterns; greenlight BLS aggregation where it materially cuts calldata.

12) Reference summary

  • EIP‑7623 (Increase calldata cost) — live in Pectra; introduces a calldata floor of 10/40 via tokens; wallets/RPCs must update gas estimation. (eips.ethereum.org)
  • Pectra meta and activation — Prague/Electra mainnet activation on May 7, 2025; includes EIP‑7623 among other core EIPs. (eips.ethereum.org)
  • EIP‑7691 (Blob throughput increase) — target 6, max 9 blobs; improves blob market headroom. (eips.ethereum.org)
  • EIP‑4844 (Blobs, BLOBHASH opcode, point‑evaluation precompile) — use blobs for DA; contracts read commitments, not data. (eips.ethereum.org)
  • EIP‑2537 (BLS12‑381 precompiles) — enables practical BLS aggregation to compress signature calldata. (eips.ethereum.org)
  • Post‑Pectra blob market — blob prices near zero; daily blobs purchased up ~20.8%; node storage implications (18‑day retention). (galaxy.com)
  • Draft EIP‑7976 — potential future increase of the calldata floor; plan ahead. (eips.ethereum.org)

13) Brief in‑depth takeaways

  • The practical threshold: floor applies when execution_gas_used < 6 × tokens_in_calldata. Any design that regularly ships kilobytes of nonzero data through calldata will pay the floor. Aim to either (a) push the bytes into blobs, or (b) squeeze inputs and spend a bit more compute. (eips.ethereum.org)
  • The architecture shift: blobs are the canonical DA lane; calldata is for parameters. Contracts that need occasional access to specific data elements can verify them with KZG openings, not by bulk‑loading the payload. (eips.ethereum.org)
  • The crypto assist: Pectra’s BLS precompiles make it viable to swap thousands of signature bytes for one aggregated signature—materially cutting calldata without sacrificing security. (eips.ethereum.org)

If you want 7Block Labs to audit your calldata footprint and produce a concrete refactor plan (packed ABI, blob wiring, BLS integration, and gas‑limit hardening), we can deliver a fixed‑scope blueprint in two weeks with measurable byte and gas targets for each critical path.

Like what you're reading? Let's build together.

Get a free 30‑minute consultation with our engineering team.

Related Posts

7BlockLabs

Full-stack blockchain product studio: DeFi, dApps, audits, integrations.

7Block Labs is a trading name of JAYANTH TECHNOLOGIES LIMITED.

Registered in England and Wales (Company No. 16589283).

Registered Office address: Office 13536, 182-184 High Street North, East Ham, London, E6 2JA.

© 2025 7BlockLabs. All rights reserved.