logoDocumentation
Transactions

Send AVAX on C/P-Chain

Learn how to execute a native transfer on the C or P-Chain using the Avalanche CLI.

Prerequisites

  • Install the Avalanche CLI.
  • Use the CLI to create a key.
  • Fund the key with AVAX. You can use the faucet with coupon code devrel-avax-0112 to get testnet AVAX.
  • Optionally, you can export your private key for use in scripting or other tools.

Initiate the transfer Command and Walk Through the Prompts

In your terminal, run the following command:

avalanche key transfer
Note

This command and all of its flags are documented here.

You will be prompted to answer the following questions:

? On what Network do you want to execute the transfer?:
 Mainnet
    Fuji Testnet

Select the chain you want to transfer funds from:

? Where are the funds to transfer?:
 P-Chain
    C-Chain
    My blockchain isn't listed

Select the chain you want to transfer funds to:

? Destination Chain:
 P-Chain
    X-Chain

Select the step of the transfer process you want to execute:

? Step of the transfer:
 Send
    Receive
Note

If you are performing a native transfer where the sender and receiver address are on the same chain, you only need to complete a "send" transaction.

If you wish to perform a cross-chain transfer (i.e. from C to P-Chain), you should abort this flow and reinitiate the command as avalanche key transfer --fund-p-chain or avalanche key transfer --fund-x-chain, completing both the "send" and "receive" flows with keys stored in the CLI. You can fund your CLI-stored key with AVAX on the C-Chain using the faucet with coupon code devrel-avax-0112.

Select the sender address:

? Which key should be used as the sender?:
 Use stored key
    Use ledger
? Which stored key should be used as the sender address?:
 DemoKey
    MyKey
    ewoq

Specify the amount to send, input the destination address:

 Amount to send (AVAX units): 100
 Destination address: P-avax1zgjx8zj7z7zj7z7zj7z7zj7z7zj7zj7zj7zj7e

Review the transaction details and confirm/abort:

this operation is going to:
- send 100.000000000 AVAX from P-avax1gmuqt8xg9j4h88kj3hyprt23nf50azlfg8txn2 to destination address P-avax1f630gvct4ht35ragcheapnn2n5cv2tkmq73ec0
- take a fee of 0.001000000 AVAX from source address P-avax1gmuqt8xg9j4h88kj3hyprt23nf50azlfg8txn2
? Confirm transfer:
    No
 Yes

After a successful transfer, you can check your CLI keys' balances with the command: avalanche key list.

Last updated on

On this page

Edit on Github