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:
![](https://storage.googleapis.com/papyrus_images/c24c7875851574f8b9d8a705cafd6545.jpg)
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](https://storage.googleapis.com/papyrus_images/c838c4f3cdf3a583091e680e8b846ea0.png)
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.
![](https://storage.googleapis.com/papyrus_images/a3fecf6515b94acf74ecf958b264455f.png)
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!