Transfer AVAX Between the X-Chain and P-Chain

·

Introduction

AVAX tokens exist on multiple chains within the Avalanche ecosystem:

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

  1. Access the Wallet

  2. Navigate to Cross-Chain Tab

    • Select Cross Chain from the sidebar.
  3. Configure Transfer

    • Source Chain: X-Chain
    • Destination Chain: P-Chain
    • Enter the amount and confirm.
  4. Complete the Transfer

    • The wallet automates the export/import process.
    • Wait for both transactions (export + import) to finalize.
  5. 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

  1. Call avm.export

    curl -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
  2. Verify Transaction
    Use avm.getTxStatus to confirm the export is accepted.

Importing AVAX to P-Chain

  1. Call platform.importAVAX

    curl -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
  2. Check Balance
    Confirm funds arrive via platform.getBalance.

Reverse Flow (P-Chain → X-Chain)

  1. Export from P-Chain
    Use platform.exportAVAX.
  2. Import to X-Chain
    Use avm.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:

👉 Learn more about fees

Can I transfer AVAX to the C-Chain?

Yes! Use similar steps with the C-Chain as the destination.

👉 Explore C-Chain transfers


Key Takeaways

Now you’re ready to stake on the P-Chain or trade on the X-Chain! For advanced features, refer to the Avalanche documentation.