AVAX tokens exist on the X-Chain, where they can be traded, on the P-Chain, where they can be provided as a stake when validating the Primary Network, and on the C-Chain, where they can be used in smart contracts or to pay for gas.
Here are the steps to transfer tokens between the X-Chain and C-Chain.
The easiest way to transfer AVAX between chains is to use the Avalanche Wallet which is a non-custodial, and secure way to access and move AVAX.
The Avalanche Wallet source code can be found here.
2. Log in to the wallet by using the private key, mnemonic key phrase, keystore file or Ledger Nano S. C-Chain transfers via Ledger are not supported yet.
3. After successfully logging in, select, "Cross Chain."
4. Choose the "Source Chain" and the 'Destination Chain" for the transfer. Then enter the amount to transfer below.
5. Confirm the transaction and then click, "Transfer."
6. Once completed, a notification will confirm the transaction was successful. A cross-chain transfer is a two step process: first a transaction to export the funds from the X-Chain, and another to import it to the C-Chain. The wallet will do both and show its the progress while doing so.
To return the AVAX back to the X-Chain, you need to do the transfer in the opposite direction.
Simply swap the source, and destination chain, by selecting them from the Source and Destination dropdown menu. The rest of the process is the same: enter the amount, confirm and transfer.