Introduction
AVAX tokens exist on multiple chains within the Avalanche ecosystem:
- X-Chain: For trading and transactions
- P-Chain: For staking and validating the Primary Network
- C-Chain: For smart contracts and gas fees
This guide explains how to transfer AVAX between the X-Chain and P-Chain, enabling you to stake tokens or move them back for trading.
Prerequisites
Before starting, ensure you have:
✔ Completed Avalanche’s Getting Started guide
✔ Basic understanding of Avalanche’s architecture
✔ AVAX tokens (mainnet or testnet via the AVAX Test Faucet)
Method 1: Using Avalanche Wallet (Recommended)
Step-by-Step Transfer Process
Access the Wallet
- Open the Avalanche Wallet.
- Log in via private key, mnemonic phrase, or Ledger.
Navigate to Cross-Chain Tab
- Select Cross Chain from the sidebar.
Configure Transfer
- Source Chain: X-Chain
- Destination Chain: P-Chain
- Enter the amount and confirm.
Complete the Transfer
- The wallet automates the export/import process.
- Wait for both transactions (export + import) to finalize.
Reverse the Transfer (P-Chain → X-Chain)
- Swap the source/destination chains and repeat.
Method 2: Programmatic Transfers via API
Exporting AVAX from X-Chain to P-Chain
Call
avm.exportcurl -X POST --data '{ "jsonrpc": "2.0", "method": "avm.export", "params": { "to": "P-avax1...", "amount": 5000000, "username": "myUsername", "password": "myPassword" }, "id": 1 }' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X- Verify Transaction
Useavm.getTxStatusto confirm the export is accepted.
Importing AVAX to P-Chain
Call
platform.importAVAXcurl -X POST --data '{ "jsonrpc": "2.0", "method": "platform.importAVAX", "params": { "to": "P-avax1...", "username": "myUsername", "password": "myPassword" }, "id": 1 }' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/P- Check Balance
Confirm funds arrive viaplatform.getBalance.
Reverse Flow (P-Chain → X-Chain)
- Export from P-Chain
Useplatform.exportAVAX. - Import to X-Chain
Useavm.import.
FAQs
How long do cross-chain transfers take?
Typically under 10 seconds. Delays may occur during network congestion.
What are the transaction fees?
Fees vary by chain:
- X-Chain: ~0.001 AVAX
- P-Chain: ~0.001 AVAX
Can I transfer AVAX to the C-Chain?
Yes! Use similar steps with the C-Chain as the destination.
Key Takeaways
- Use the Avalanche Wallet for simplicity.
- Programmatic transfers require API calls for export/import.
- Always verify balances after transfers.
Now you’re ready to stake on the P-Chain or trade on the X-Chain! For advanced features, refer to the Avalanche documentation.