Introduction

Overview of the Client component in the ZKsync Go SDK

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

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

In code, the Client provides Ethereum RPC methods on the ZKsync 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 ZKsync chains. 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, prefixed with zks_. These methods facilitate the use of ZKsync'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