matter-labs /zksync

zkSync: trustless scaling and privacy engine for Ethereum

★ 4,910⑂ 2,643👁 169⑃ 281● 354▤ 4
RustApache-2.0Created 2019-05-29zksync.io
Download: Security upgradecontracts-7 ↓72021-11-12
-2
Daily
-2
Weekly
4,910
stars
2,643
forks
169
watchers
281
prs
354
issues
4
releases

README

ZKSync: scaling and privacy engine for Ethereum




 ⚠️ Deprecation Notice

 ZKSync Lite is being deprecated. To withdraw your funds, please visit
 lite.zksync.io.

 Withdrawing your funds with the Exit Tree Generator

If you prefer to generate your withdrawal proof independently rather than use the web interface, you can use the
Exit Tree Generator. The flow is three steps:

 1. Download the data

Download the snapshot of the ZKSync Lite state at the last verified block from:



or IPFS CID:
QmSqzPQNRcz3grznTMCYDDunDFGZCXFFjew7fgYpFcGYoh

The archive contains accounts.csv, balances.csv, and tokens.csv.

 2. Create leaves for the Keccak tree

bash
cargo run --release --bin zksync_exit_tree_generator -- create-new-leaves \
    --accounts accounts.csv \
    --balances balances.csv \
    --tokens tokens.csv \
    [--output new_leaves.csv]


 3. Create a proof and claim

bash
cargo run --release --bin zksync_exit_tree_generator -- create-proof \
    --account  \
    --tokens  [ ...] \
    [new_leaves.csv]


Submit the printed proof to the withdrawal contract.

Mainnet:: https://etherscan.io/address/0x0a14b696350546110a0d8acdb86226983af9d2a0

The contract exposes two methods for claiming:

- claim — withdraws the funds to the caller (msg.sender). Use this when the wallet submitting the
  transaction is the address that held the ZKSync Lite account.
- claimTo — withdraws the funds to a specified recipient address. Use this when you want the funds sent
  somewhere other than the caller (for example, a cold wallet or a different EOA).

Both methods take the account address, the token addresses, and the proof produced in step 3. You can
call them from Etherscan's "Write Contract" tab, or from any wallet/script that can encode a contract call.

For advanced workflows — including verifying the Keccak Merkle root, restoring the original ZKSync Merkle root (a
heavy computational task, ~6 hours) and restoring the tree from a database — see the
Exit Tree Generator README.

 ZKSync Lite

ZKSync Lite is a scaling and privacy engine for Ethereum. Its current functionality scope includes low gas transfers of ETH
and ERC20 tokens in the Ethereum network.

 Description

ZKSync is built on ZK Rollup architecture. ZK Rollup is an L2 scaling solution in which all funds are held by a smart
contract on the mainchain, while computation and storage are performed off-chain. For every Rollup block, a state
transition zero-knowledge proof (SNARK) is generated and verified by the mainchain contract. This SNARK includes the
proof of the validity of every single transaction in the Rollup block. Additionally, the public data update for every
block is published over the mainchain network in the cheap calldata.

This architecture provides the following guarantees:

- The Rollup validator(s) can never corrupt the state or steal funds (unlike Sidechains).
- Users can always retrieve the funds from the Rollup even if validator(s) stop cooperating because the data is
  available (unlike

Top issues

Latest release

Security upgrade contracts-7 2021-11-12

Snapshot: 2026-11-27T22:26:53Z · Data license Apache-2.0 · JSON