API Overview

The API exposed by the ZKsync node is designed to be Web3-compliant. Any deviation from the Ethereum behavior is likely unintended, and we encourage users to report such discrepancies.

eth_ Namespace

Data getters in this namespace operate in the L2 domain. They deal with L2 block numbers, check balances in L2, and more.

MethodNotes
eth_blockNumber
eth_chainId
eth_call
eth_estimateGas
eth_gasPrice
eth_newFilterMaximum amount of installed filters is configurable
eth_newBlockFilterSame as above
eth_newPendingTransactionsFilterSame as above
eth_uninstallFilter
eth_getLogsMaximum amount of returned entities can be configured
eth_getFilterLogsSame as above
eth_getFilterChangesSame as above
eth_getBalance
eth_getBlockByNumber
eth_getBlockByHash
eth_getBlockTransactionCountByNumber
eth_getBlockTransactionCountByHash
eth_getCode
eth_getStorageAt
eth_getTransactionCount
eth_getTransactionByHash
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionReceipt
eth_protocolVersion
eth_sendRawTransaction
eth_syncingZKsync node is considered synced if it's less than 11 blocks behind the main node.
eth_coinbaseAlways returns a zero address
eth_accountsAlways returns an empty list
eth_getCompilersAlways returns an empty list
eth_hashrateAlways returns zero
eth_getUncleCountByBlockHashAlways returns zero
eth_getUncleCountByBlockNumberAlways returns zero
eth_miningAlways returns false

PubSub

This is exclusively available on the WebSocket servers.

MethodNotes
eth_subscribeMaximum amount of subscriptions is configurable
eth_subscription

net_ Namespace

MethodNotes
net_version
net_peer_countAlways returns 0
net_listeningAlways returns false

web3_ Namespace

MethodNotes
web3_clientVersion

debug_ Namespace

This namespace provides a set of non-standard RPC methods for developers to inspect and debug calls and transactions. By default, this namespace is disabled but can be activated using the EN_API_NAMESPACES setting. Please refer to the configuration section for more details.

MethodNotes
debug_traceBlockByNumber
debug_traceBlockByHash
debug_traceCall
debug_traceTransaction

zks Namespace

This namespace holds rollup-specific extensions to the Web3 API. Only the methods documented are deemed public. Other methods in this namespace, though exposed, are not stable and may change without notice.

MethodNotes
zks_estimateFee
zks_estimateGasL1ToL2
zks_getAllAccountBalances
zks_getBlockDetails
zks_getBridgeContracts
zks_getBytecodeByHash
zks_getConfirmedTokens
zks_getL1BatchBlockRange
zks_getL1BatchDetails
zks_getL2ToL1LogProof
zks_getL2ToL1MsgProof
zks_getMainContract
zks_getRawBlockTransactions
zks_getTestnetPaymaster
zks_getTokenPrice
zks_getTransactionDetails
zks_L1BatchNumber
zks_L1ChainId

en Namespace

This namespace includes methods that ZKsync node call on the main node during syncing. If this namespace is active, other ENs can sync using this node.


Made with ❤️ by the ZKsync Community