ZK

ZK Rollups Explained for Solidity Developers: Build on zkSync and Scroll

Understand ZK rollups from a Solidity developer's perspective — deploy contracts on zkSync Era and Scroll, and learn what changes in the ZK-EVM world.

Mudaser Iqbal··15 min read

What ZK Rollups Actually Do (No Math Required)

Zero-Knowledge rollups are Layer 2 scaling solutions that execute transactions off-chain and post cryptographic proofs to Ethereum. The proof guarantees that all transactions were executed correctly — Ethereum verifies the proof without re-executing the transactions.

Why ZK rollups matter for Solidity developers:
- Your Solidity contracts can run on ZK rollups with minimal or no changes
- Users get 10-100x cheaper transactions with Ethereum-level security
- Finality is faster than optimistic rollups (no 7-day challenge period)

The key ZK rollup chains in 2026:
1. zkSync Era: most mature ZK-EVM, largest TVL among ZK rollups
2. Scroll: bytecode-level EVM equivalence — your contracts deploy unchanged
3. Polygon zkEVM: strong ecosystem, backed by Polygon's resources
4. Linea: developed by Consensys, tight MetaMask integration
5. Taiko: fully decentralized and permissionless ZK rollup

EVM equivalence vs EVM compatibility:
- EVM equivalent (Scroll, Taiko): same bytecode, same opcodes, same behavior. Deploy your existing contracts with zero changes.
- EVM compatible (zkSync Era): supports Solidity but compiles to a different bytecode format (zkEVM bytecode). Most contracts work, but some low-level operations differ.

For most Solidity developers, the practical difference is small. But if your contracts use inline assembly, precompiles, or rely on specific opcode gas costs, test carefully on your target ZK rollup.

Deploying on zkSync Era

zkSync Era is the most popular ZK rollup with the richest developer tooling. Here's how to deploy your Solidity contracts:

Setup:
- Install the zkSync CLI: npm install -g zksync-cli
- Use Hardhat with the @matterlabs/hardhat-zksync plugin
- Configure your hardhat.config.ts to target zkSync Era

Key differences from Ethereum deployment:
1. Compiler: zkSync uses zksolc (a modified Solidity compiler that outputs zkEVM bytecode). The Hardhat plugin handles this transparently.
2. Contract deployment: use the Deployer class from @matterlabs/hardhat-zksync-deploy instead of ethers.getContractFactory.
3. Gas model: zkSync's gas model differs from Ethereum. Storage operations are relatively cheaper; computation is relatively more expensive. Profile your contracts on zkSync testnet.
4. Paymaster support: zkSync natively supports paymasters at the protocol level (not ERC-4337). Users can pay gas in any ERC-20 token.

What works the same:
- Standard Solidity (up to 0.8.x)
- OpenZeppelin contracts (most work unchanged)
- ethers.js and viem for frontend interaction
- Events, mappings, structs, inheritance — all standard

What to watch out for:
- msg.sender behavior: in zkSync, msg.sender during contract deployment might differ from Ethereum
- CREATE2 address calculation: uses a different formula (includes bytecode hash)
- Some precompiles (ecrecover works; others may not)
- Contract size limits may differ

Testing: zkSync provides a local test node (era_test_node) and a Sepolia testnet. Always test on the local node first, then testnet, then mainnet.

Deploying on Scroll

Scroll aims for the highest level of EVM equivalence among ZK rollups. If you want the "it just works" experience, Scroll is your best bet.

Why Scroll stands out:
Scroll is bytecode-equivalent to Ethereum. This means your existing deployment scripts, testing frameworks, and tooling work without modification. No special compiler, no custom deployment classes.

Deploying on Scroll:
1. Add Scroll's RPC to your Hardhat/Foundry config
2. Get testnet ETH from Scroll's faucet
3. Deploy with your existing scripts — no changes needed

That's it. Seriously. If your contract deploys on Ethereum, it deploys on Scroll with the same bytecode and the same address (if using CREATE2 with the same salt).

Scroll's architecture:
- Sequencer: receives transactions and produces blocks
- Coordinator: manages the proving pipeline
- Prover: generates ZK proofs for transaction batches
- Rollup contract (on Ethereum): verifies proofs and stores state roots

Gas costs on Scroll:
Scroll's fees have two components:
1. L2 execution fee: similar to Ethereum but much cheaper (gas prices are ~0.1 gwei vs Ethereum's ~10-30 gwei)
2. L1 data fee: cost of posting transaction data to Ethereum (this is the dominant cost and varies with Ethereum gas prices)

After EIP-4844 (blob transactions), L1 data fees dropped ~10x. A typical Scroll transaction costs $0.01–$0.05.

Cross-chain messaging:
Scroll provides a native bridge and messaging system. You can send messages from Ethereum to Scroll (and vice versa) via the ScrollMessenger contract. L1→L2 messages are included in ~15 minutes; L2→L1 messages require proof finalization (~1-4 hours).

ZK Rollup Development Best Practices

Whether you choose zkSync, Scroll, or another ZK rollup, these practices will save you headaches:

Testing strategy:
1. Unit test with Foundry/Hardhat on a local EVM (fast iteration)
2. Integration test on the ZK rollup's local test node (catches ZK-specific issues)
3. Deploy to testnet and test with real bridges and cross-chain messaging
4. Mainnet deployment with monitoring

Gas optimization for ZK rollups:
ZK rollup gas costs differ from Ethereum L1. General tips:
- Storage writes are relatively cheaper on ZK rollups (the proof amortizes cost across batches)
- Calldata/input data costs matter more (it's posted to L1)
- Use events for data that doesn't need on-chain access — events are cheaper than storage
- Batch operations when possible — one transaction with 10 actions is cheaper than 10 transactions

Handling L1↔L2 messaging:
- Always handle the case where a cross-chain message fails or is delayed
- Use a retry mechanism for L1→L2 messages
- For L2→L1 messages, inform users about the finalization delay
- Never assume instant cross-chain messaging

Security considerations:
- ZK rollups inherit Ethereum's security, but bridge contracts are an additional attack surface
- Audit your cross-chain messaging logic carefully
- Be aware of sequencer centralization — most ZK rollups currently have a single sequencer. If it goes down, you can force transactions via L1, but with delay
- Monitor the ZK rollup's upgrade mechanism — most have an upgrade timelock, but understand the trust assumptions

The ZK rollup ecosystem is converging on shared standards. By late 2026, expect frameworks like the ZK Stack (from zkSync) and Polygon CDK to make launching your own ZK rollup as easy as deploying a smart contract. The future is modular, and ZK proofs are the connective tissue.

One Solidity tip + 1 case study per month

ZK Rollups Explained for Solidity Developers: Build on zkSync and Scroll | Crypto Hawking