Member-only story

Export Solana Phantom wallet key as Json

Girish
Aug 4, 2023

--

solana-keygen recover ‘prompt:?key=0/0’ -o phantom_wallet.json

An account may have many wallets the command above access the first wallet , if we need to access wallet number 10 for example we need to change the ‘prompt:?key=0/0’ to ‘prompt:?key=10/0’ “only the first 0 is changing”

let seed = Uint8Array.from(
phantomKey.toString().split(",")
).slice(0, 32);
let wallet = web3.Keypair.fromSeed(seed);
const publicKey = new PublicKey(wallet._keypair.publicKey)
const secretKey = wallet._keypair.secretKey

You can use the above javascript

--

--

Girish
Girish

No responses yet