zkSync · AsyncAPI Specification
zkSync Era WebSocket JSON-RPC PubSub API
Version 1.0.0
AsyncAPI description for the zkSync Era WebSocket JSON-RPC PubSub endpoint. zkSync Era is fully compatible with Geth's pubsub API, except for the `syncing` subscription. Clients open a WebSocket connection to the endpoint and use the standard `eth_subscribe` / `eth_unsubscribe` JSON-RPC methods to manage subscriptions. Notifications are delivered as JSON-RPC 2.0 `eth_subscription` messages on the same connection.
View Spec
View on GitHub
Layer 2EthereumzkEVMZK RollupAccount AbstractionPaymasterZK StackBridgeAsyncAPIWebhooksEvents
Channels
/
Send a JSON-RPC 2.0 request from the client to the zkSync Era node.
Single bidirectional WebSocket channel carrying JSON-RPC 2.0 request, response, and notification messages. Clients send `eth_subscribe` requests to open a subscription, then receive `eth_subscription` notifications until they call `eth_unsubscribe`.
Messages
EthSubscribeRequest
eth_subscribe
Open a new subscription. First parameter is the subscription type name (`newHeads`, `logs`, or `newPendingTransactions`). For `logs` an optional filter object may be supplied as the second parameter. zkSync Era does NOT support the `syncing` subscription.
EthUnsubscribeRequest
eth_unsubscribe
Cancel an existing subscription by ID.
EthSubscribeResponse
eth_subscribe response
JSON-RPC response returning a subscription ID for an eth_subscribe call.
EthUnsubscribeResponse
eth_unsubscribe response
JSON-RPC response confirming a subscription was cancelled.
NewHeadsNotification
newHeads notification
Notification delivered when a new block header is produced on zkSync Era.
LogsNotification
logs notification
Notification delivered when a new log entry matches the filter.
NewPendingTransactionsNotification
newPendingTransactions notification
Notification with the transaction hash of a new pending transaction.
JsonRpcError
JSON-RPC error
Error response envelope.
Servers
wss
mainnet
mainnet.era.zksync.io/ws
zkSync Era Mainnet WebSocket JSON-RPC endpoint (chain ID 324).