Avalanche (AVAX)
Avalanche Network API Reference for efficient interaction with AVAX nodes, enabling fast, low-cost Layer 2 scaling solutions for Ethereum with high throughput and secure smart contracts.
Avalanche is a high-throughput, low-latency Proof-of-Stake blockchain platform launched in September 2020 by Ava Labs, founded by Emin Gün Sirer, Kevin Sekniqi, and Maofan "Ted" Yin. Its defining innovation is a novel family of consensus protocols:
Avalanche consensus (DAG-based) and
Snowman consensus (linear chains) achieves sub-second finality through repeated random subsampling rather than traditional PBFT or longest-chain rules.
Avalanche's most distinctive architectural feature is its three-chain Primary Network:
The Contract Chain (C-Chain) for EVM-compatible smart contracts
the Platform Chain (P-Chain) for validators, staking, and subnet metadata,
The Exchange Chain (X-Chain) for native asset transfers.
Each chain has its own virtual machine, its own RPC namespace, and its own URL path under the GetBlock base URL. The network also pioneered the concept of Subnets (now called L1S), application-specific blockchains with custom validators and tokenomics.
Key Features
Three-Chain Primary Network: C-Chain (EVM, smart contracts), P-Chain (
platform.*for staking and subnets), X-Chain (avm.*for native assets) — each with its own RPC pathSub-Second Finality: Repeated random subsampling delivers irreversibility in under 1 second, with no probabilistic confirmation windows
EVM Compatibility on C-Chain: Full Ethereum JSON-RPC support; deploy Solidity / Vyper contracts with Hardhat, Foundry, ethers.js, viem, or web3.py without modification
Avalanche
eth_*Extensions on C-Chain:eth_baseFee,eth_getChainConfig,eth_suggestPriceOptions,eth_getBadBlocks, and thenewAcceptedTransactionsWebSocket subscriptionAtomic Cross-Chain Transfers:
avax.export/avax.importenable atomic AVAX movement between C, P, and X chainsSnowman Consensus: Used by C-Chain and P-Chain — linear, BFT-style finality optimized for smart contract execution
Avalanche Consensus: Used by X-Chain — DAG-based, optimized for parallel asset transfers
Subnets (L1s): Custom application-specific blockchains with their own validator sets, virtual machines, and token economics
Native AVAX: Network's native token (18 decimals on C-Chain, 9 decimals as nAVAX on P-Chain / X-Chain — see warning below)
Production-Grade Scalability: 4,500+ TPS theoretical throughput on the Primary Network, with subnets adding horizontal scale
TECHNICAL DISCLAIMER: AUTHORITATIVE AVALANCHE RPC SPECIFICATION
GetBlock’s Avalanche API reference documentation is provided exclusively for informational purposes and to optimize the developer experience. The canonical specification for Avalanche's RPC interfaces is maintained by Ava Labs and published at build.avax.network/docs/rpcs. The C-Chain follows the standard Ethereum JSON-RPC specification at ethereum.org/developers/docs/apis/json-rpc, plus Avalanche-specific extensions documented separately. For P-Chain and X-Chain protocols, consensus parameters, and subnet architecture, consult the official Avalanche documentation.
AVAX DECIMALS DIFFER BETWEEN CHAINS — IMPORTANT
AVAX is represented with different decimal precision depending on which chain you are interacting with:
C-Chain: 18 decimals (1 AVAX = 10¹⁸ wei), matching Ethereum's convention. Use
parseEther/formatEther.P-Chain and X-Chain: 9 decimals — denominated in nAVAX (nano-AVAX). 1 AVAX = 10⁹ nAVAX.
When transferring AVAX across chains via avax.export / avax.import or platform.exportAVAX / platform.importAVAX, the amount field uses the destination chain's decimal convention. A common integration bug is sending 18-decimal wei amounts to the P-Chain (which interprets them as nAVAX).
Network Information
Network Name
Avalanche Mainnet (Primary Network)
C-Chain ID
43114 (0xa86a)
Fuji Testnet C-Chain ID
43113 (0xa869)
Native Currency
AVAX
C-Chain Decimals
18 (wei)
P-Chain / X-Chain Decimals
9 (nAVAX)
Finality
Sub-second (Avalanche / Snowman consensus)
Smart Contract VM
EVM on C-Chain; AvalancheVM on X-Chain; Platform VM on P-Chain
EVM Compatible
Yes (C-Chain only)
Address Format
C-Chain: Ethereum-style 0x…; P-Chain / X-Chain: Bech32 P-avax1… / X-avax1…
Block Explorer
snowtrace.io (C-Chain), avascan.info (all chains)
Base URL
GetBlock exposes all three Avalanche chains under a single regional base URL. The chain is selected by the URL path:
C-Chain
/ext/bc/C/rpc
EVM smart contracts, eth_*, avax.* cross-chain ops
P-Chain
/ext/bc/P
platform.* — validators, staking, subnets
X-Chain
/ext/bc/X
avm.* — native asset transfers
All methods are called by sending a POST request to the corresponding chain URL with a JSON-RPC 2.0 body. For real-time subscriptions on the C-Chain, use the WebSocket scheme: wss://go.getblock.io/<ACCESS-TOKEN>/ext/bc/C/ws. WebSocket is only available on the C-Chain — P-Chain and X-Chain are HTTP only.
Supported Networks
Mainnet
✅
✅
✅
✅
✅
Fuji Testnet
✅
✅
✅
✅
✅
Quickstart
In this section, you will learn how to make your first call against the C-Chain (the most common starting point) with either:
Axios (JavaScript / Node.js)
Python (Requests library)
Before you begin, you must have already installed npm or yarn on your local machine (for the Axios example) or Python and pip (for the Python example).
Available API Methods
Avalanche exposes three RPC surfaces. C-Chain is the most heavily used (EVM smart contracts). P-Chain and X-Chain are documented here with their core methods; for the complete platform.* and avm.* surface, see build.avax.network/docs/rpcs.
C-Chain: Ethereum-Compatible (eth_*)
eth_blockNumber
Returns the current latest block number
eth_chainId
Returns the chain ID (0xa86a = 43114 for C-Chain mainnet)
eth_getBlockByNumber
Returns block information by block number
eth_getBlockByHash
Returns block information by block hash
eth_getBlockReceipts
Returns all transaction receipts for a given block
eth_syncing
Returns sync status or false if node is fully synced
eth_getBalance
Returns the AVAX balance of an account (in wei)
eth_getCode
Returns the contract bytecode at a given address
eth_getStorageAt
Returns the value at a specific storage slot
eth_getTransactionCount
Returns the transaction count (nonce) for an account
eth_sendRawTransaction
Broadcasts a signed transaction
eth_getTransactionByHash
Returns a transaction by its hash
eth_getTransactionReceipt
Returns the receipt for a transaction by hash
eth_call
Executes a read-only call against contract state
eth_estimateGas
Estimates gas required for a transaction
eth_gasPrice
Returns the current gas price
eth_maxPriorityFeePerGas
Returns the suggested max priority fee per gas (EIP-1559)
eth_feeHistory
Returns historical base fees and priority fees
eth_getLogs
Returns logs matching a given filter
C-Chain: Avalanche eth_* Extensions
eth_baseFee
Returns the base fee for the next block (Avalanche-specific)
eth_getChainConfig
Returns the C-Chain configuration
eth_suggestPriceOptions
Returns suggested slow / normal / fast gas price options
C-Chain: WebSocket Subscriptions
eth_subscribe
Subscribes to events (newHeads, logs, newPendingTransactions, newAcceptedTransactions)
eth_unsubscribe
Cancels an existing subscription
C-Chain: Network & Client Info
net_version
Returns the network ID
net_listening
Returns true if the client is actively listening for connections
net_peerCount
Returns the number of peers connected to the node
web3_clientVersion
Returns the client software version
web3_sha3
Returns the Keccak-256 hash of the given data
P-Chain (platform.*)
platform.getHeight
Returns the current P-Chain block height
platform.getCurrentValidators
Returns the list of current validators for a given subnet
platform.getMinStake
Returns the minimum amount of AVAX required to stake
platform.getStakingAssetID
Returns the asset ID used for staking on a subnet
platform.getCurrentSupply
Returns the current AVAX supply on the P-Chain
platform.getTotalStake
Returns the total amount of AVAX staked on a subnet
X-Chain (avm.*)
avm.getAssetDescription
Returns description (name, symbol, decimals) for an asset
avm.getTx
Returns a transaction by ID
avm.getTxStatus
Returns the status of a transaction (Accepted, Processing, etc.)
avm.getUTXOs
Returns the UTXOs that reference a given address
avm.issueTx
Sends a signed transaction to the X-Chain
Support
For technical support and questions:
Support Email: support@getblock.io
See Also
Last updated
Was this helpful?