For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

  1. Avalanche consensus (DAG-based) and

  2. 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:

  1. The Contract Chain (C-Chain) for EVM-compatible smart contracts

  2. the Platform Chain (P-Chain) for validators, staking, and subnet metadata,

  3. 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 path

  • Sub-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 the newAcceptedTransactions WebSocket subscription

  • Atomic Cross-Chain Transfers: avax.export / avax.import enable atomic AVAX movement between C, P, and X chains

  • Snowman 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.

Network Information

Property
Value

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:

Chain
Path suffix
Use for

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

Network
C-Chain JSON-RPC
C-Chain WSS
P-Chain
X-Chain
Frankfurt

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).

1

Setup project

2

Install Axios

3

Create file

Create a new file named index.js. This is where you will make your first call.

4

Set ES module type

Set the ES module "type": "module" in your package.json.

5

Add code

Replace <ACCESS-TOKEN> with your actual GetBlock access token.

6

Run the script

Expected output:

0xa86a (43114 in decimal) confirms you are connected to Avalanche C-Chain mainnet.

1

Setup the project directory

2

Create and activate a virtual environment

3

Install requests

4

Create script

Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

5

Run the script

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_*)

Method
Description

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

Method
Description

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

Method
Description

eth_subscribe

Subscribes to events (newHeads, logs, newPendingTransactions, newAcceptedTransactions)

eth_unsubscribe

Cancels an existing subscription

C-Chain: Network & Client Info

Method
Description

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.*)

Method
Description

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.*)

Method
Description

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:

See Also

Last updated

Was this helpful?