[SOLVED] Is there a way export generated key file to .json account file?


#1

Is there a way export generated key files in bin/aeternity console to .json account?

Or just export the privatekey of generated_keys.


#2

There should be a way to export private key as keystore file like ethereum


#3

The account generated by sdk is similar with keystore file, but the console generated key files are stored in some binary format that are not identical with json file’s hex string


#4

Hey @Liu

For now I haven’t found a way to achieve what you request, I am assuming you’re using aecli to generate the keystore.

In aepp-playground I needed to get the priv-key of the keystore.json, I’ve taken the ‘recovery’ function from the aecli and updated it a bit to do just that:

Take a look: https://github.com/aeternity/aepp-playground/blob/master/faucet/utils.js


#5

Thanks so much~ you’ve enlightened me!

I found “aecli crypto decrypt” command in the js sdk, and decrypted the generated_keys which I generated by “bin/epoch keys_gen” at the very beginning of mainnet.

priv-key and password is enough for me to re-generate keystore.json account file.


#6

My pleasure! :smile: