➜ tmp solana-keygen new --outfile tmp1.json --no-bip39-passphrase
Generating a new keypair
Wrote new keypair to tmp1.json
====================================================================
pubkey: eC86BRbWX6rmqv5d4AWQ22DLKxbXeaPZ4nZDn6xWqcM
====================================================================
Save this seed phrase to recover your new keypair:
okay prison law quantum kiwi blouse when thumb rapid cover end vapor
====================================================================
➜ tmp
This saves the private key to tmp1.json and shows the corresponding public key. It also shows a seed phrase which can be used to recover the public/private keypair
➜ tmp solana-keygen recover ASK --outfile recover.json
[recover] seed phrase:
[recover] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
Recovered pubkey `"eC86BRbWX6rmqv5d4AWQ22DLKxbXeaPZ4nZDn6xWqcM"`. Continue? (y/n):
y
Wrote recovered keypair to recover.json
➜ tmp diff recover.json tmp1.json
➜ tmp
If you import the seed phrase into e.g. Phantom wallet, you will get a different wallet address than the one above. That keypair can be recovered like this:
➜ tmp solana-keygen recover "prompt://?full-path=m/44/501'/0'/0'" --outfile recover-web.json
[recover] seed phrase:
[recover] If this seed phrase has an associated passphrase, enter it now. Otherwise, press ENTER to continue:
Recovered pubkey `"2xdXy3LCbg2ixsTU8eMcTQoV9pDReS6GANniVirjGdXy"`. Continue? (y/n):
y
Wrote recovered keypair to recover-web.json
This will use a different "derivation path" from the seed phrase to derive the public/private key.