Batch Transactions + State Diffs = 🪄

Batch Transactions are so powerful to reduce the gas costs when they're combining with State Diffs

Batch Transactions (AA) and State Diffs are more powerful than you think. With Clave's batchcaller Contract , users can perform batch transactions while reducing data availability fees tanks to state diffs! How? Let me explain:

If you're not familiar with state diffs, you can refer to my previous blog post where I have explained the details of state diffs and why Account Abstraction is more powerful with state diffs.

The TLDR of state diff is, some of rollups such as zkSync and Starknet only post state differences to L1 instead of sending all transaction data. This reduces the calldata costs, which make up almost 90% of a transaction's total cost. To explain it, let's give a simple example: Imagine a scenario where Alice sends 1 ETH to Bob and Bob sends 1 ETH to Charlie. State diff rollup only posts that Alice's balance is down 1 ETH and Charlie's balance is up 1 ETH, whereas TX data rollup posts all TX data.

Image

In a DEX swap, the user first calls approve function and then transfer function. However, this UX is not efficient as it involves multiple steps, and users cannot perform a one-click swap. Also, this has a problem that resulting in users sending unnecessary data to L1.

Batch Transactions allow for the execution of two transactions at once, reducing gas fees and improving the user experience. Using Clave Account's BatchCaller contract, users can perform multiple transactions in a single transaction. This means that users approve the transaction and then do the swap by calling the transferfrom function in one transaction. The L2's storage slot, which lives in L1, only changes with User's changed balance and never learns about approval, reducing the call data cost.

These contracts are open-source and accessible to all Smart Contract wallets in zkSync. If you're a dapp or a wallet looking to integrate BatchCaller into your project, our DMs are open!

Loading...
highlight
Collect this post to permanently own it.
DoganEth logo
Subscribe to DoganEth and never miss a post.
#clave#state diffs#rollups#ethereum