matter-labs /zksync
zkSync: trustless scaling and privacy engine for Ethereum
★ 4,910⑂ 2,643👁 169⑃ 281● 354▤ 4
-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 (unlikeTop issues
#264requires an ERC20 approve() (and gas) even when a previous one was sufficient16 comments · 2020-12-14#270EIP1271 signature recovery support for Gnosis safe6 comments · 2020-12-17#256Supporting Contract Signatures for undeployed contracts6 comments · 2020-11-16#611Error: invalid value for value.sealFields (Not an array!) 4 comments · 2024-03-30#423zk init: genesis setup failed4 comments · 2023-02-24#598JS library support to Ethers.js v63 comments · 2024-03-09#588Gas Consumption3 comments · 2024-03-02#433Cannot read property 'Interface' of undefined3 comments · 2023-03-27