Cointime

Download App
iOS & Android

Bundle Compression

Contract accounts aren’t just better, they’re also cheaper.

Background…

The future of Ethereum is contract accounts on rollups.

Together, contract accounts (also known as “account abstraction”) and rollups represent a fundamental upgrade & enable real-world use of the chain:

  • Fast, cheap transactions.
  • Secure accounts built on best-practice cryptography.
  • Better recovery, including easy-to-use passkey backups. No seed phrase.

EOAs and L1 are settlement infrastructure. The future is 4337 on L2. The problem, so far, was that 4337 on L2 was expensive.

Making 4337-on-L2 efficient

The main cost on L2 is calldata. 4337 can use a lot of that. For example, see Ansgar’s breakdown of what Vitalik later called the “infamous 1600-byte transfer”: a 4337 bundle containing a single Daimo USDC transfer.

We fix this using bundle compression.

The BundleBulker contract is simple and permissionless. Any bundler can register their own IInflator to compress bundles however they want. A good default is the PerOpInflator, which concatenates individually compressed ops. Each bundler (Pimlico, ThirdWeb, Alchemy, etc) can deploy their own PerOpInflator instance, with the beneficiary (op fee recipient) set accordingly. PerOpInflator is similarly permissionless: any app can register their own IOpInflator with arbitrary, app-specific userop compression.

For an example, check out DaimoOpInflator. What it is doing, specifically?

  • Packing. The Solidity ABI encoding was designed for L1, where computation is expensive, not for L2, where computation is effectively free and calldata is expensive. A single boolean argument takes 32 bytes… structs are encoded in a luxuriously expansive way.
  • Templating. Parts of the op that don’t change are templated in. In our case, callGasLimit, verificationGasLimit, and the WebAuthn (passkey) JSON envelope.
  • Stateful compression. We replace the 40 byte (from address, to address) with a ~10 byte (from name, to name) using our existing onchain name registry. We could further optimize by using an index instead of a name.

The important thing is that this setup is permissionless. Any app can write their own inflator and start using it.

Results

Results so far, using a simple ERC20 token transfer as our benchmark.

Bytes per transferJust the op1-op bundle10-op bundle
EOA transaction · example179179179
Naive 4337 · example140816231429
Bundle compression · example127343149

Below: a 4337 bundle containing a single USDC transfer, before and after compression. In both cases, I’ve highlighted the op. The rest is the bundle fixed overhead.

The highlighted op is smaller than an EOA ERC-20 transfer.

Each bundle will contain many of these, amortizing the fixed overhead & making contract wallets more efficient than legacy wallets.

Questions

  • What about rollup compression?

Bundle compression is complementary to rollup compression. Both are useful.

Rollups compress calldata before settling to L1, but this is limited on its own. Stateful compression is hard to achieve. Bundle compression is at the app layer and lets you do application-specific templating and stateful lookups.

Together, this lets us approach the goal state of very compact transactions.

  • Why use 4337 at all, if we’re calling into another contract that sits in front of the EntryPoint?

Three reasons.

  • Standard ops. Userop explorer, ops identified by ophash, everything inter-”op”-erable. If you use bespoke AA, you get no observability or devtools. Note that a userop explorer will show the uncompressed op, —it’ll just have a lower preVerificationGas = lower cost.
  • Censorship resistance. Bundler down or not serving you? Your wallet can send the uncompressed op to the standard 4337 mempool, paying a few cents more fee for guaranteed inclusion.
  • Security. Stick with the battle-tested EntryPoint contract. See below.
  • What if there’s a vulnerability in my inflator?

The inflator contract is, unavoidably, not beautiful to look at. You’re writing a byte-packed encoding, plus templating and lookups.

The great news is that the inflator contract has no security responsibilities. This is because your wallet still signs over the uncompressed op. The EntryPoint contract and your 4337 wallet’s validateUserOp function work exactly as before. If there’s any issue in the inflator contract, it can only cause liveness problems (reverted, invalid ops), not security errors. It’s neatly compartmentalized as an optional optimization.

In fact, this separation of responsibilities makes your wallet more secure. The gross bit-packing goes in one place—the security-critical validation logic goes in another, which can written in entirely idiomatic Solidity.

  • Doesn’t state diff fix this?

State diffs are an elegant theoretical optimization for zkrollups: just prove that you have a block of valid transactions resulting in a given diff. The transactions themselves, and their calldata, are not posted! For a transfer, the diff is just (-10 for alice, +10 for bob). No compression needed.

We’re unlikely to see this in a production, real, stage2 rollup. A state-diff-only permissionless rollup is a scary construct. It raises the spectre of undiagnosable hacks, both of the rollup itself and applications on top. Say a block shows up that drains a defi protocol. You might never learn what the bug was! The transaction was never published, only the final state diff (minus $500m for contract 0x…, plus $500m for bob) and a proof that some valid set of transactions produced this diff. Similarly for proving-system bugs.

TLDR; production rollups will post calldata for the forseeable future.

Comments

All Comments

Recommended for you

  • Lightchain AI announces testnet launch and completes $15 million in financing

    blockchain project Lightchain AI has announced the official launch of its testnet and has completed a $15 million financing round. The project's main technological innovations include the Proof of Intelligence (PoI) consensus mechanism and the AI Virtual Machine (AIVM). The PoI consensus mechanism is achieved by rewarding nodes to solve AI computing problems, while the AIVM provides developers with a toolkit to build AI applications on the blockchain. The project is currently in the final round of presale, and the funds raised will be used for technology development, infrastructure expansion, and talent recruitment. Lightchain AI plans to launch its mainnet in 2025 and will focus on developing enterprise-level decentralized AI solutions in the future.

  • Over 64.5404 million USD was liquidated in the past hour, mainly due to long orders

    According to data, in the past hour, the total liquidation amount of the entire network reached 64.5404 million US dollars, of which the liquidation amount of long positions was about 63.1007 million US dollars, and the liquidation amount of short positions was about 2.2016 million US dollars.

  • The State Council Tariff Commission: Additional tariffs will be imposed on some imported goods originating from the United States

    The State Council Tariff Commission issued a notice: with the approval of the State Council, tariffs will be imposed on some imported goods originating in the United States from February 10, 2025. A 15% tariff will be imposed on coal and liquefied natural gas, and a 10% tariff will be imposed on crude oil, agricultural machinery, large-displacement cars, and pickups. (Jinshi)

  • Japanese listed company Remixpoint increased its holdings by 30.83 BTC, bringing its total Bitcoin holdings to 509.33

    Japanese listed company Remixpoint announced on February 3 that it had released a "Notice of Additional Purchase of Cryptocurrency" on January 30, 2025, and passed a resolution to purchase a total of 2 billion yen (approximately $12.89 million) worth of cryptocurrency at a board meeting held on the same day. Based on the resolution, the company completed the purchase of the first 500 million yen (approximately $3.22 million) worth of cryptocurrency on January 31, 2025, including the addition of 30.83 BTC, bringing the company's total Bitcoin holdings to 509.33.

  • US spot Ethereum ETF had a net inflow of $83.54 million yesterday

    According to  TraderT monitoring shows that the net inflow of US spot Ethereum ETF was 83.54 million US dollars yesterday.

  • Yesterday, Fidelity Ethereum ETF had a net inflow of $49.7 million, while Bitcoin ETF had a net outflow of $177.6 million

    According to Farside monitoring, yesterday, the net inflow of Fidelity Ethereum ETF (FETH) was $49.7 million, while the net outflow of Bitcoin ETF (FBTC) was $177.6 million.

  • GOAT Gaming, the AI ​​gaming network on Telegram, completes $4 million in strategic financing

    According to official sources, AI game network GOAT Gaming on Telegram announced the completion of a $4 million strategic financing round, led by TON Ventures, Karatage, Amber Group, and Bitscale Capital. This financing round brings the total funding for Mighty Bear Games, the game studio behind the game, to $15 million.

  • Thailand SEC plans to launch tokenized securities trading system

    According to a report from the Bangkok Post on February 3, Jomkwan Kongsakul, Deputy Secretary-General of the Thai Securities and Exchange Commission, stated that token investment is increasingly being taken seriously, and regulatory agencies will allow securities companies to trade digital tokens to leverage their large investor base. Jomkwan Kongsakul said, "The SEC is using technology to improve the efficiency of the capital market by promoting the electronic securities ecosystem," adding, "New regulations will be introduced to promote the issuance of electronic securities and online purchase of bonds," which are medium- to long-term debt instruments that large companies use to borrow money.

  • BTC falls below $96,000

    The market shows that BTC has fallen below $96,000 and is now trading at $95,909.85, with a 24-hour drop of 5.26%. The market is volatile, so please be prepared for risk control.

  • The total market value of AI agent tokens falls below $10 billion

    According to CoinGecko data, the total market value of AI agent token sector is currently reported at 9.68 billion US dollars, with a 24-hour decline of 0.8% and a 24-hour trading volume of 1.231 billion US dollars, as reported by Jinse Finance.