0

I did the following in my html file in the chrome console. After I get the following public and private keypair. How do I convert it into a base58 or seed phrase?

The docs below don't state how to go about it:

https://solanacookbook.com/references/keypairs-and-wallets.html#how-to-restore-a-keypair-from-a-mnemonic-phrase

enter image description here

2
  • Are you following a guide? You can not go from a keypair to a mnemonic.
    – Bryon M
    Commented Aug 12, 2022 at 4:58
  • it is unclear what the screenshot is representing. ed25519 private (secret) keys are 32-bytes, but this claims to be 64. either way, if there are any assets controlled by that keypair, they should be moved to a new wallet and this keypair destroyed. private means private.
    – trent.sol
    Commented Aug 20, 2022 at 4:35

2 Answers 2

2

For converting your Public Key into base58, look at this reference.

Also, it is not possible to generate a mnemonic from a Keypair.

However, the vice-versa is true, as highlighted in the docs you linked.

1
  • Good answer, teach 'em to fish!
    – Frank C.
    Commented Aug 12, 2022 at 7:53
1
const keypair = solanaWeb3.Keypair.generate();
const base58 = keypair.publicKey().toBase58();
1
  • I'm getting: publicKey is not a function -- Was I suppose to add more libraries to make this work? I only have solana web3.js Commented Aug 12, 2022 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.