How to install and set up zksync-ethers for your project.

Learn how to install and set up the zksync-ethers library to interact with the ZKsync network, leveraging its features for Ethereum scaling and Layer 2 solutions.

If you're migrating from zksync-web3, please refer to the migration guide for detailed instructions.


Ensure you have the following installed on your machine:

  • Node.js (version 14.x or later)
  • A package manager like npm, yarn, pnpm, or bun.

Installation steps

Step 1: Initialize your project

Create a new Node.js project or navigate to your existing project directory.

mkdir my-zksync-project
cd my-zksync-project
npm init -y

Step 2: Install zksync-ethers

Install the zksync-ethers library along with its peer dependency, ethers. Choose the appropriate version of ethers based on your needs.

npm install zksync-ethers@5 ethers@5

Made with ❤️ by the ZKsync Community