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

There are no comments yet, why not be the first?

Recommended for you

  • The JuCoin ecological project JuChain has been launched on the main network, and the public chain co construction summit will be held. The ecological debut protocol is Butterfly

    Cointime News:JuCoin's self-developed public chain JuChain has been launched on the main network. The JuChain Public Chain Co construction Summit initiated by JuCoin will be held on May 15, 2025 in Bangkok, Thailand. The conference will release the first ecological agreement--

  • BTC breaks through $96,000

    the market shows that BTC has broken through $96,000 and is now trading at $96,014.98, with a 24-hour increase of 1.15%. The market fluctuates greatly, so please manage your risks well.

  • JuCoin CEO: UX design in the encryption industry needs to pay attention to user emotional details to enhance user experience

    Cointime News: JuCoin CEO Sammi Li delivered a keynote speech at the TOKEN2049 conference, analyzing the current challenges in user experience (UX) design in the cryptocurrency industry. Sammi Li believes that the existing encryption product experience fails to effectively empathize with users, often leading to usage anxiety, which hinders the large-scale adoption of Web3. Combining her rich experience in the luxury goods industry, she emphasizes that building trust relies on paying attention to user emotions and critical moments of interaction, and constructing it through details rather than simply technical presentations. JuCoin is applying these user centered design principles to its Web3 ecosystem construction, aiming to lower user barriers and enhance user experience by optimizing JuChain and related product designs. It calls on the encryption industry to think together and place user experience at a more core position.

  • Xiongan New Area: Combining blockchain with digital RMB to launch "Digital Currency Loan" product, with payment amount of nearly 100 million yuan

    On January 11th, according to the Xiong'an Public Account, the digital RMB pilot in Xiong'an New Area has achieved new results. The first digital RMB tax payment transaction in the financial field has been completed, and self-service tax terminals have been developed. The "blockchain + digital RMB" technology is applied to government procurement management, increasing the proportion of advance payment and landing multiple applications to solve corporate problems. In 2024, the People's Bank of China Xiong'an New Area Branch, together with the Xiong'an New Area Reform and Development Bureau, will launch the "Implementation Plan for the Deepening of the Pilot Work of Digital RMB in the Rongdong Area", to enhance public awareness. By combining blockchain with digital RMB, the "digital currency loan" product will be launched, with a payment amount of nearly 100 million yuan.

  • Fardi Wang, Chairman of NEXUS 2140: AI•Web3•Ecom Global Expo, Made Appearance at Meta Crypto Oasis 2025 in Dubai

    Fardi Wang, Chairman of NEXUS 2140: AI•Web3•Ecom Global Expo, recently appeared at the Meta Crypto Oasis 2025 in Dubai, joining global Web3 leaders such as Justin Sun (Founder of TRON) and Chris (Co-founder of Sonic) to discuss the future of the industry. As the first cross-industry event integrating AI, Web3, and E-commerce, NEXUS 2140 is accelerating its international expansion through Fardi Wang’s active participation. At the summit, Fardi Wang emphasized that the integration of virtual and real-world assets is the key breakthrough for the Web3 ecosystem. He mentioned: “NEXUS 2140 is leveraging Korea’s policies, technological strengths, and ecosystem advantages to build a global industrial hub.” His insights received strong recognition from attendees, and the Dubai visit further amplified the international influence of the event, injecting new momentum into global digital economy collaboration.

  • Binance Wallet’s New TGE B² Network is Now Available for Investment

    according to official page data, Binance Wallet's new TGE B² Network is now open for investment, with an end time of 18:00 (UTC+8). The participation threshold for this TGE is that Alpha points must reach 82 points.

  • The price of ALPACA perpetual contract on Binance platform rose by more than 25% in the past 5 minutes

    the current price of ALPACA perpetual contract on the Binance platform has risen by over 25% in the past 5 minutes, now falling back to $1.3683. At the same time, the spot price of ALPACA is $1.22, showing a significant price difference.

  • To participate in Binance Wallet's new TGE B² Network, you must have 82 points

    according to the official announcement, Binance Wallet has announced the participation threshold for the new B² Network (B2) TGE, with Alpha points needing to reach 82 points.

  • 1confirmation founder: There is a negative correlation between the popularity of the seed round and the success of the project product

    On April 29th, Nick Tomaino, the founder of 1confirmation, wrote on X that there is a negative correlation between the popularity of seed round projects and their success. Participating in a hot round is indeed exciting: high funding amounts, intense competition, big-name investors, and extensive media coverage. However, rarely does participating in such hot projects before the product-market fit is clear bring truly outstanding results. At 1confirmation, some of the most "popular" projects we have invested in have actually performed the worst.

  • U.S. Treasury Secretary Benson: We hope to obtain long-term tariff revenue and agreements

    US Treasury Secretary Besant said he hopes to obtain long-term tariff revenue and agreements, and the US will hold talks with at least 17 partners in the coming weeks. There is a good chance of seeing income tax reductions in the tax bill, and tariff revenue could be used for tax cuts.