net_version

The net_version method returns the current network ID as a decimal string. The network ID identifies which Ethereum network the node is connected to, allowing applications to verify they're interacting with the correct network.

This method is functionally similar to eth_chainId but returns a decimal string representation instead of hexadecimal, and exists primarily for legacy compatibility with older Ethereum applications and wallets. Common network IDs include 1 for Ethereum mainnet, 11155111 for Sepolia testnet, and 17000 for Holesky testnet. Many wallets and dapps use this method to verify network connectivity and display network information to users, though modern applications typically prefer eth_chainId. The network ID is crucial for preventing replay attacks across different Ethereum networks.


Parameters

This method does not require any parameters.

Return Object
field
type
description
result
string
The current network ID as a string (e.g., '1' for mainnet, '5' for Goerli, '11155111' for Sepolia)
Request Example
Request
Response Example
Response

Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?