Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to get a private key from seed phrase on solana?

I stored public key and seed phrase in safe place, but not the private key.
When I add my wallet on phantom, it asks to add private key instead of seed phrase.
Any solutions?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Solution 1: navigate to the keypair json on your system. i.e. .config/solana/id.json. Then you can find out the array for the private key.

Solution 2: you can use solana web3 SDK.

  let seed = Uint8Array.from(
    SEED_STRING.split(",")
  ).slice(0, 32);

  // create keypairs
  let KEYPAIRS = web3.Keypair.fromSeed(seed);
  console.log(KEYPAIRS.privateKey);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading