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

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

Or just export the privatekey of generated_keys.

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

1 Like

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

Hey @LiuYang.chain

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

1 Like

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.

2 Likes

My pleasure! :smile:

1 Like