Open idoor88 opened 3 years ago
Hello,
I am facing a similar issue and raised the following issue. I was told to basically store the entropy that is used to generate the keypair initially. Like so:
import { Keypair, utils } from '@helium/crypto'
const keypairEntropy = await utils.randomBytes(32)
const keypair = await Keypair.fromEntropy(keypairEntropy)
I would prefer to have some ability to regenerate the keypair from the privateKey hex string, so I'll keep you updated if theres a separate method in the underlying libsodium-wrapper
method that can be used.
Yes, I ended up doing the same thing. Thanks
Is there a solution? Are there any examples? Thanks
Hi, I created a KeyPair from: let keypair = await Keypair.makeRandom(); then I have the pubilcKey, privateKey and address saved, later on I need to restore the keypair object so I can use it when sign: const signedPaymentTxn = await paymentTxn.sign({ payer: keypair });
it seems I can not find a way to restore the keypair from the pubilcKey, privateKey and address I saved.
Any clues? Thanks in advance