Introduction

Overview of the Client component in the ZKsync Era

The Client is a critical component that enables interaction with the ZKsync Era. It serves as a wrapper around the ZKsync Era RPC API and supports ethclient.Client from the geth library, along with additional methods specific to ZKsync Era.

Since the geth library has the concept of a Client, not a Provider, the Go SDK for ZKsync Era also adopts the concept of a Client, as opposed to using a Provider like in other ZKsync Era SDKs.

In code, the Client provides Ethereum RPC methods on the ZKsync Era node, prefixed with eth_. It includes the same methods as ethclient.Client from the geth library, ensuring compatibility with existing Ethereum tools and workflows. Additionally, it has extra methods capable of handling EIP-712 transactions, which are essential for the unique features of the ZKsync Era. The Client is designed to be compatible with the bind.ContractBackend interface from geth, which enables support for smart contracts generated using the abigen tool.

Also, the Client provides the API methods specific to ZKsync Era, prefixed with zks_. These methods facilitate the use of ZKsync Era’s unique features, such as account abstraction, custom fee systems, and other L2 functionalities.

These interfaces are designed to make the SDK flexible and extensible.

Made with ❤️ by the ZKsync Community