Book a free call

How ZK Rollups Work With Account Abstraction

ZK rollups make transactions cheap, and account abstraction makes wallets simple. Together they let apps onboard users with no seed phrase and no gas.

Hertiv engineering teamReviewed by a senior engineer
7 min read
How ZK Rollups Work With Account Abstraction
On this page

Short answer

ZK rollups and account abstraction work together by pairing cheap transactions with smart contract wallets. The rollup keeps costs low, so wallet features like gas sponsorship, batched transactions and spending limits become affordable, and users get an app-like sign-in with no seed phrase and no gas to buy.

What are ZK rollups and account abstraction?

ZK rollups and account abstraction are two separate ideas that work well together. A ZK rollup is a layer 2 network that runs transactions off the main chain and proves them correct with a zero-knowledge proof, so the main chain only needs to check the proof. Account abstraction is the idea that a wallet can be a smart contract instead of a single private key, so the wallet itself can set its own rules.

Put together, they give users a wallet that behaves like an app account: it can pay gas for them, recover access without a seed phrase, set spending limits and approve transactions in one tap. The rollup keeps the cost low, and the smart contract wallet keeps the experience simple.

The combination matters because each idea fixes a different pain. Rollups fix cost and speed. Account abstraction fixes the wallet experience. A user who has never held crypto can open an app, get a wallet created for them, and pay nothing in gas, because the app handles the parts that used to need a seed phrase and a token balance. The ZK rollup explainer covers the rollup side on its own.

How does a transaction move through a ZK rollup?

A transaction on a ZK rollup moves through four stages: the user signs it, the rollup orders it, a prover proves the batch, and the main chain checks the proof. The user sees a fast confirmation from the rollup sequencer, and the proof gives the result the same security as the main chain once it is verified.

StageWhat happensWho does it
SignUser signs a transaction with their walletUser or app
OrderSequencer orders transactions into a batchRollup sequencer
ProveProver builds a zero-knowledge proof for the batchRollup prover
VerifyMain chain checks the proof and records the resultMain chain contract

The proof is the key step. Instead of re-running every transaction, the main chain checks one small proof that says the batch was executed correctly. That is why a rollup can handle many transactions while the main chain only does a small amount of work.

What does account abstraction add on a rollup?

Account abstraction adds a smart contract wallet, and on a rollup that wallet is cheap to use because the rollup itself is cheap. On the main chain, every wallet action costs main-chain gas, which makes small features expensive. On a rollup, the same actions cost far less, so features like gas sponsorship and batched transactions become practical for everyday apps.

There are two ways the two ideas meet. On some rollups, account abstraction is built in: every account is a smart contract account by default, so apps can use wallet features without extra infrastructure. On others, account abstraction runs through the ERC-4337 standard, where bundlers package user operations and paymasters sponsor gas, with the rollup keeping the cost of those operations low.

The practical result is the same either way. A user can sign in with an email or a passkey, the app creates a wallet for them, and the app pays the gas. The user never sees a seed phrase, never buys a token to pay for gas, and never waits for a long confirmation. The account abstraction explainer covers the wallet side on its own.

Why do the two fit together so well?

The two fit together because each one removes a cost the other creates. A smart contract wallet does more work per transaction than a normal wallet: it checks signatures, enforces rules and may call a paymaster. On the main chain that extra work costs real money. On a rollup, the same work costs a fraction of it, so the wallet features stop being a luxury.

The rollup also benefits. Account abstraction brings new users who would never manage a seed phrase, and those users bring transactions. An app that onboards users with a sponsored wallet can grow faster than one that asks each user to buy tokens first, and the rollup earns fees from the extra activity.

There is a third fit: privacy and safety features become affordable. A wallet that checks a transaction against a spending limit or a list of approved addresses needs extra computation, and that computation is cheap on a rollup. The same checks on the main chain would cost enough to put many users off using them at all.

How do paymasters and gas sponsorship work on a rollup?

Paymasters work by paying the gas for a user's transaction and taking payment in another form, or in no form at all. A user sends a signed instruction, the paymaster checks it against its rules, and the transaction is submitted with the paymaster covering the gas. The user may pay in the app's own token, or the app may cover the cost as an onboarding expense.

On a rollup, gas sponsorship is affordable because the gas itself is cheap. Sponsoring a thousand onboarding transactions on the main chain would be a noticeable line item; on a rollup it is often a small one. That is why many apps sponsor the first few transactions for every new user, and only ask the user to pay once they are active.

A paymaster needs limits, or it will be drained. A typical setup caps the number of sponsored transactions per user, caps the gas per transaction, and only sponsors calls to approved contracts. Those rules live in the paymaster contract, so they are enforced by code rather than by trusting the user to behave. The account abstraction implementation guide covers paymasters in more depth.

How do you build an app that uses both?

You build an app that uses both by choosing a rollup, choosing how accounts work on it, and wiring the wallet, the paymaster and the app together. The work is mostly integration, not new cryptography: the rollup and the wallet standards already exist, and your job is to join them in a way your users can follow.

  1. Pick a rollup. Choose one with the account features you need, such as native smart contract accounts or ERC-4337 support, and check its fees and tooling.
  2. Choose the account model. Decide whether accounts are created by your app, by a wallet provider, or by the user, and how recovery works if access is lost.
  3. Set up a paymaster. Define which transactions you sponsor, the caps per user, and which contracts the paymaster will pay for.
  4. Build the sign-in flow. Let users sign in with an email, a passkey or a social account, and create the wallet behind the scenes.
  5. Test on a testnet. Run the full flow, including recovery and a failed payment, before touching real funds.
  6. Launch with limits. Cap sponsored transactions per user at first, watch the paymaster balance, and raise the caps as the numbers prove out.

Keep the user out of the plumbing. If a user has to understand rollups, proofs or gas to use your app, the integration has failed. The wallet should feel like any other app account, and the rollup should be invisible.

Example (hypothetical): a wallet app sponsors gas for 1,000 new users

Example (hypothetical): a wallet app on a ZK rollup wants to onboard 1,000 new users without asking any of them to buy tokens first. Each new user needs two sponsored transactions: one to create the wallet and one to make a first transfer. The app sets a paymaster cap of 2 sponsored transactions per user and a gas cap per transaction.

The arithmetic: 1,000 users times 2 transactions is 2,000 sponsored transactions. If each transaction costs 0.02 in gas on the rollup, the total sponsorship cost is 2,000 times 0.02, which is 40. The app budgets 50 to cover price movement, and the paymaster stops sponsoring once a user has used their 2 transactions.

Compare that with the same onboarding on the main chain. If each transaction cost 2.00 in gas, the same 2,000 transactions would cost 4,000. The rollup makes the sponsorship 100 times cheaper, which is why the app can afford to sponsor every new user instead of only a few. The numbers are hypothetical, but the gap between main-chain gas and rollup gas is the reason the model works.

What are the common mistakes?

The most common mistakes when combining ZK rollups and account abstraction are sponsoring gas without caps, hiding recovery until it is needed, and assuming the rollup makes every problem disappear.

  • An uncapped paymaster. A paymaster with no per-user or per-transaction cap will be drained by the first person who finds it. Set caps in the contract, not in a dashboard.
  • No recovery plan. A wallet without a seed phrase still needs a way back in. Test recovery with a real user before launch, not after someone is locked out.
  • Trusting the sequencer blindly. A rollup sequencer orders transactions, and its downtime or censorship policy affects your users. Know the rollup's guarantees before you build on it.
  • Skipping the testnet. A wallet flow that works in a demo can fail on real funds. Run the full flow, including a failed payment and a recovery, on a testnet first.
  • Leaking the plumbing. If users have to learn about proofs, gas or bundlers to use your app, the abstraction has failed. Keep it invisible.

Key takeaways

  • A ZK rollup proves batches of transactions correct, so the main chain only checks one proof
  • Account abstraction turns a wallet into a smart contract with its own rules
  • Rollups make wallet features cheap; wallets bring new users to rollups
  • Paymasters sponsor gas, but only with caps set in the contract
  • Test recovery and the full wallet flow on a testnet before launch

Frequently asked questions

Do ZK rollups need account abstraction to work?

No. A ZK rollup works with normal wallets too, and many apps use them that way. Account abstraction is an extra layer that makes the wallet easier to use. The two are independent ideas that happen to fit well together because the rollup makes the wallet features affordable.

Is account abstraction only for ZK rollups?

No. Account abstraction works on the main chain and on other layer 2 networks as well. It is most useful on rollups because the low fees make features like gas sponsorship practical, but the same wallet standards work anywhere the network supports them.

What is a paymaster?

A paymaster is a contract that pays the gas for a user's transaction, either for free or in exchange for another token. It checks each request against its own rules, such as a cap per user or a list of approved contracts, so it cannot be drained by a single user.

What happens if the rollup sequencer goes down?

Transactions stop being ordered until the sequencer returns, or until the rollup's fallback takes over. Users can usually still withdraw their funds through the main chain, but the exact fallback depends on the rollup. Check the rollup's guarantees before building on it.

Can users recover a wallet with no seed phrase?

Yes, if recovery was set up in advance. A smart contract wallet can allow recovery through a guardian, an email, or a second device, depending on how it was configured. Recovery must be tested before launch, because a wallet with no recovery path locks the user out for good.

How much does gas sponsorship cost on a rollup?

It depends on the rollup's fees and the number of transactions sponsored. On a ZK rollup the gas per transaction is low, so sponsoring a few transactions per new user is often a small cost. Set a per-user cap and watch the paymaster balance, and raise the cap only when the numbers prove out.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building a wallet or an app on a ZK rollup? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Blockchain Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call