How to import your Phantom or Sollet Wallet to use with the Solana CLI - HedgeDoc
 owned this note
<center> # How to import your Phantom or Sollet Wallet to use with the Solana CLI *Written by [JDC]( Originally published 2022-01-11 on the [Monadical blog](* </center> ## Intro For those of you who have missed it, [Solana]( is a blockchain built to enable scalable, user-friendly apps. When people first get started on Solana, they often use browser extensions such as Phantom or Sollet because they’re easy to install and create - an excellent option for beginners who want to keep it simple. However, as you become more advanced, you might want to use your wallet with the Solana command line interface (CLI) from a terminal, in order to run a command from a script to deliver tokens or NFTs to your friends. This requires an imported Solana Wallet. Even if you don’t want to get complicated, importing your wallet allows you to back up your wallet, and store it in multiple locations, such as a USB or external hard drive. That way, you don’t have to worry about losing your wallet if something happens to your computer. So, if you’re wondering what steps to take to import your wallet, this quick guide is for you. ## Step 1: Install Solana CLI tools Before you do anything, make sure you have the [latest solana cli tools]( installed and configured. ## Step 2: Get the seed phrase in Phantom Wallet This step is only necessary for people using a Phantom Wallet. If you created your Solana wallet using Sollet, you should already have the seed phrase written somewhere. Those who already have their [seed phrase]( can go ahead and skip this step. If not, this is how you can access the seed phrase in Phantom Wallet by following these four steps: 1. Unlock your wallet. ![A screenshot of Phantom's wallet unlock page]( 2. Once you're in, select the gear icon located at the bottom right corner. 3. Scroll to the bottom of the page and select “Show Secret Recovery Phrase.” ![A screenshot that shows the "Reset Recovery Phrase" button]( 4. Unlock and copy your seed phrase. ![Phantom's "show secret recovery phrase" page]( ## Step 3: Verify your wallet This step is optional, but important: you want to make sure that everything will work, and that the correct parameters are being used. To verify your wallet, open a terminal window and input the following command to verify your public key. The public key, that we will be using as example is: `5vdAeq93iynwZPGyj5QaSczQ9uYzvN4bRsJ4NySucZyB` ```bash= solana-keygen verify <YOUR_PUBLIC_KEY_HERE> prompt://?full-path=m/44'/501'/0'/0' ``` Input the seed phrase and hit the enter key. When the program requests you to fill in the associated passphrase, leave it blank, and hit the enter key again. Once you've done that, you can look for the verification success state `:Success`. ![A screenshot showing the verification success state]( ## Step 4: Import your wallet To import your wallet, input the following command: ```bash solana-keygen recover prompt://?full-path=m/44'/501'/0'/0' ``` This will write your private key in `~/.config/solana/id.json` as an array to be used as keypair with the CLI. Make sure to backup any former wallet or define a new output path with -o. It should look like this: ```bash solana-keygen recover prompt://?full-path=m/44'/501'/0'/0' -o my_imported_key.json ``` ![A screenshot of what your wallet should now look like]( ## Multiple Wallets If you created multiple wallets with the same phantom installation you might need to tweak the derivation path<a href="#note1" id="note1ref"><sup>1</sup></a>, depending on the wallet. The first wallet the derivation path is: `m/44'/501'/0'/0'` The second derivation path changes slightly, with the value of the number following `/501'/` rising by one. So, the second derivation path would be `/44'/501'/1'/0',` the third `m/44'/501'/3'/0'` and so on. Use the verification step to be sure the derivation path corresponds with the wallet you want to import. <a id="note1" href="#note1ref"></a>[1] A [derivation path]( is a piece of data that tells a Hierarchical Deterministic (HD) wallet how to derive a specific key within a tree of keys. Derivation paths are used as a Bitcoin standard and were introduced with HD wallets as a part of BIP 32.. ## Conclusion That’s it! Now your wallet is imported in a format that can be used with the Solana CLI, opening up many new ways to use Solana. Make sure to keep this file extremely safe by saving it on a separate USB key in encrypted format. --- <center> <img src="" style="height: 80px"/><br/> | Full-Stack Consultancy *We build software that outlasts us* </center>

Recent posts:

Back to top