Cointime

Download App
iOS & Android

State Diff and Account Abstraction

Repost from DoganEth : “State Diff and Account Abstraction” The full report and all related findings are available on the official website of DoganEth Mirror.

The concept of Account Abstraction (AA) is gaining significant momentum in the blockchain space. Despite the promise it holds, AA faces a major challenge: the high costs associated with calldata. In this blog post, I'll explain this issue and why zkSync's state diff model is crucial for our infrastructure.

Rollups: Rollups are, in essence, blockchains. They have a state transition function, full nodes, and, hopefully in the future, trustless light clients. Their main functionality lies in performing off-chain computations without any extra trust assumptions. However, the reality is often much different than what we think.

Red is bad, yellow is gud (source: L2beat)

Rollups are communicating Ethereum with a smart contract bridge. This bridge is so important for Rollup's security because assets are secured via the smart contract (I know it is much more complex in reality; rollups are not real, but this is not today's topic). What's happening in Rollup Bridges? Rollup bridges maintain a state root on Ethereum. This state root represents the Rollups state, and changing the state root requires integrity proof mechanisms such as ZK proofs and fraud proofs, but why?Ethereum cannot know what's happening outside of the Ethereum blockchain. Thus, rollup executions should be calculated from zero, or we need to find a way to prove it to the blockchain. This is why we need integrity proofs. In practice, we see two proof systems: fraudulent proofs and zero-knowledge proofs. They're different, and it's important to understand what we need on the data availability side.

Fraud Proofs: Fundamentally, Fraud Proofs only prove invalid computations. I won't go into detail about the two types of fraud proofs (non-interactive and interactive). Optimistic rollups (rollups that use fraud proofs) assume that all state transitions are valid unless a fraud proof exists. All state transitions are happening after a challenge window, to be sure that watchers have enough time to create a fraud proof and sent it to mainnet. To prove the invalidity of a fraud proof, fully onchain DA is essential. Thus, using various Data Availability Layers becomes difficult since, due to the nature of Fraud Proofs, if the DA layer posts invalid data, there is no way to prove it to the mainnet. And also state diffs (we’ll dive into details) are useless for Optimistic Rollups because fraud proofs are requiring fully onchain data.

Zero Knowledge Proofs: Zero Knowledge Proofs (also known as validity proofs) prove the validity of computations using cryptographic algorithms. Consequently, state transitions rely on cryptographic algorithms, not on game theory. ZK Rollups can utilize different data availability layers or methods with minimal security changes (compared to optimistic rollups). This is because users don’t need to trust the Data Availability layer to be sure that state transitions are valid. Therefore, we've seen the emergence of solutions like validium and volutions, which decrease the costs of Data Availability with some minimal security changes. And also this is why ZK Rollups can utilize both State Diff and TxData data (also know as transaction data input) posting functions.

Data Availability: Data Availability is required for three things:Censorship Resistance and Liveness: Rollups aim to inherit the security conditions of the base layer, and censorship resistance is one of these aspects. Ideally, a rollup should enable everyone to construct the state, even if they are not running a full node for the rollup. Additionally, it should allow users to access the chain even if the prover or sequencer stops working. This aspect is crucial for both liveness and censorship resistance. Onchain DA is needed to construct the rollup’s state and

Security: As I have mentioned, rollups strive to inherit the cryptoeconomic and social security of Layer 1 (L1). Therefore, in many cases, on-chain Data Availability is essential.State Diff: Data Availability is important but sending all transaction data to ethereum can be problem because Ethereum’s DA capacity is not scalable right now. State Diff is an another method for posting the data to base layer with some trade offs on finality side. Let’s explain how state diffs are working and what trade offs are coming with it.

Finality: Finality on rollups can be thought in two perspectives.

  • For a user who doesn’t run a full node on Layer 2 (L2), a transaction is finalized when the state root of Layer 1 (L1) changes, incorporating the user’s transaction in a block, and this block is finalized through consensus.
  • For a user who runs a full node on Layer 2, a transaction is finalized when a batch includes the transaction is sent to Ethereum, and the block that includes this batch is finalized.

For rollups that post all transaction data to Ethereum, users who run a full node can achieve faster finality. They can directly verify that their transaction is included in the batch. However, users of state diff rollups should wait for finality on Layer 1.

However State Diff is coming with a significant improvement: users are only paying for functions that changes L2’s storage slot in L1 instead of paying for all transaction data. State diff rollups are posting only overall change to the state from the batch of transactions (not just one transaction). This is why, if a user had an oracle that updated the same slot 100 times in a single batch, it is only charged for 1 update, because you only care about the last state of the storage slot. Users don't care about the 99 that were overwritten.Account Abstraction and State Diff:Quick Reminder: Users pay for three things on rollups: the Layer 2 (L2) execution fee, the Layer 1 (L1) calldata cost (for Data Availability), and the proof verification cost (specific to ZK Rollups)ERC 4337 and 4337 like protocol-level improvements (such as zkSync's and Starknet's Account Abstraction) introduce a new transaction type that includes two functions: Verification and Execution. In State Diff rollups, the verification process does not alter any slot in Layer 1 (L1). As a result, users only pay for the Layer 2 (L2) execution cost, instead of paying for all transaction data. Additionally, users benefit from the cost improvements associated with State Diff on the transaction execution side.

As a Clave, we are building an infrastructure to be pioneer of payments in Web3. As a payment focused app, we need cheap way to achieve self custody + smart wallet features. zkSync’s state diff’s are helping us to decrease the calldata cost that comes with Secure Enclave based signer. Also with the upcoming EIP-7212 implementation, Clave accounts are going to be first class citizens in ZK Stack chains. Furthermore, with the upcoming decentralization of zkSync, we will be able to achieve enhanced security guarantees regarding finality.

At the end of day, we (Clave + MatterLabs team) are trying to solve the gas issue with;EIP-7212 integration for L2’s execution fee: The EIP-7212 contract is a precompiled contract designed for gas efficiency and secure operations on the secp256r1 curve. Since zkSync currently does not support modexp, the estimated gas amount for r1 verification without EIP-7212 is around 2 million gas. Consequently, the zkSync team is working on integrating EIP-7212 to improve the usability of passkeys and wallets based on hardware signers.State Diff’s for reducing L1’s Calldata Cost: As I have mentioned earlier, state diffs are so powerful for reducing the calldata overhead that comes with account abstraction.Boojum + Shared Bridge Upgrade to Reduce the Gas Cost for Proof Verification: As I explained in the ZK Stack article, proof verification will become much cheaper with the upcoming ZK Stack chains. Additionally, zkSync has recently changed their proof system to one that is more cost-effective.

However, there are already additional approaches being implemented to reduce calldata costs, with most of them focusing on compression:Bulk by Daimo TeamBLS aggregation by 4337 teamBLS wallet by wax teamRollup Compression by Vitalik

Thanks a lot to Donnoh for answering my questions and helping me to understand the differentiators between state diff and txdata rollups. Also special thanks to Anthony for giving valuable feedbacks on the thread and Ori for helping me within answering my questions.

Comments

All Comments

Recommended for you

  • Zhipu Launches and Open Sources GLM-5.3-Flash

    On August 26, Zhipu launched and open-sourced GLM-5.3-Flash (320B-A18B), the first native multimodal model in the GLM-5 series. It features a total of 320 billion parameters and surpasses GLM-5.2, achieving a score of 57 on the globally recognized Artificial Analysis Intelligence Index (AA Comprehensive Intelligence Index), placing it among the leading models worldwide, on par with Anthropic's popular model Claude Opus 4.8. In the self-developed Z.ai Code Bench evaluation, its programming performance is comparable to that of Claude Opus 4.8. Additionally, GLM-5.3-Flash is priced at 1/10 of GLM-5.3, and during a limited-time discount, it is priced at 1/20 of GLM-5.3, which is 1/40 of Opus 4.8. The same intelligence at 1/40 the price, cutting-edge capabilities without the need to hold back.

  • Zhipu Launches and Open Sources GLM-5.3-Flash

    On August 26, Zhipu launched and open-sourced GLM-5.3-Flash (320B-A18B), the first native multimodal model in the GLM-5 series. It has a total of 320 billion parameters and surpasses GLM-5.2, achieving a score of 57 in the globally recognized Artificial Analysis Intelligence Index (AA Comprehensive Intelligence Index), placing it among the leading models worldwide, on par with Anthropic's popular model Claude Opus 4.8. In the self-developed Z.ai Code Bench evaluation, its programming performance is comparable to that of Claude Opus 4.8. Meanwhile, GLM-5.3-Flash is priced at 1/10 of GLM-5.3, and during a limited-time discount, it is available for 1/20 of GLM-5.3's price, which is 1/40 of Opus 4.8's price. The same intelligence, at 1/40 the cost, provides cutting-edge capabilities without the need to hold back.

  • Ethereum Developers Propose Restructuring Validator Staking Contract to Prepare for Quantum Attacks

    On August 26, Ethereum researchers proposed a draft to rebuild the validator deposit contract in preparation for the future introduction of quantum-resistant signature mechanisms, allowing for a gradual phase-out of the existing BLS signature format. This proposal enables the deposit contract to support keys of different sizes and public key types, assigning labels for each cryptographic scheme, with the current BLS signature labeled as 0 and potential future quantum-resistant schemes receiving new labels. Currently, approximately 42.4 million ETH, worth around $10.4 billion, are staked in Ethereum, all relying on BLS validator keys. This draft is still in its early stages and must be implemented alongside subsequent consensus layer upgrades, with the Ethereum Foundation's overall quantum resistance roadmap targeting around 2029.

  • Ethereum Developers Propose Restructuring Validator Staking Contract to Prepare for Quantum Attacks

    On August 26, Ethereum researchers proposed a draft to rebuild the validator deposit contract in preparation for the future introduction of quantum-resistant signature mechanisms, allowing for a gradual phase-out of the existing BLS signature format. This proposal enables the deposit contract to support keys of different sizes and public key types, assigning labels for each cryptographic scheme, with the current BLS signature labeled as 0, and future quantum-resistant schemes to be assigned additional labels. Currently, approximately 42.4 million ETH, valued at around $10.4 billion, are staked in Ethereum, all relying on BLS validator keys. The draft remains in its early stages and must be implemented alongside subsequent consensus layer upgrades, with the Ethereum Foundation's overall quantum resistance roadmap targeting around 2029.

  • Spot Gold Falls Below $4600/Ounce

    On August 26, spot gold fell below $4600 per ounce, declining by 1.30% during the day.

  • Spot Gold Falls Below $4600/Ounce

    On August 26, spot gold fell below $4600 per ounce, declining by 1.30% during the day.

  • SEC Submits New Crypto Custody Regulations Proposal to White House

    On August 26, Bloomberg reported that the U.S. Securities and Exchange Commission (SEC) has submitted a proposal to the Office of Management and Budget (OMB) regarding new regulations for investment advisors holding client digital assets. The rule aims to 'clarify the framework for investment advisors and investment companies to custody crypto assets,' addressing inquiries from institutions on how to comply with the custody of digital assets. It plans to eliminate certain existing custody requirements that are considered 'outdated' due to market evolution and current trading and custody practices. This proposal is seen as a step by financial regulators to advance the current administration's crypto agenda while relevant legislation remains stalled in the Senate. It will take effect after review by the OMB, a vote by SEC commissioners, and a public comment period.

  • BTC Falls Below $78,000

    Market data shows that BTC has fallen below $78,000, currently priced at $77,983.75, with a 24-hour decline of 1.03%. The market is experiencing significant volatility, so please ensure proper risk management.

  • BTC Falls Below $78,000

    Market data shows that BTC has fallen below $78,000, currently priced at $77,983.75, with a 24-hour decline of 1.03%. The market is experiencing significant volatility, so please ensure proper risk management.

  • Alibaba Qwen Releases Qwen 3.8-Flash Model

    On August 26, Alibaba Qwen launched the Qwen 3.8-Flash model, which is a multimodal MoE model and an early preview of the Qwen 4 architecture. The production version of Qwen 3.8-Flash will soon be available through the Qwen Cloud API, priced at just $0.16 per million input tokens and $0.47 per million output tokens. The model features 125 billion parameters plus 51 billion N-gram embedding parameters, but activates only 6 billion parameters per token, achieving high cost-effectiveness.