I am using PolkadotJS, I can sign the message, and get the public key, but I don't know the way to get the private key. Could you please let me know how to get the private key? Thank you so much.
1 Answer
Polkadot js apps does not support this. The only instance where you can have access to the private key is when generating the account. Once generated, you are asked to save a json in a safe place. In this file, you can find the private key, encoded by the password that you set for your account.
Perhaps this feature can be added, although my guess is that currently Polakdot js apps is doing this to protect the users and prevents them from leaking their private key. Storing and displaying the private key in online web app sounds like the last thing you want to do.
-
I saw the encode string in the json file when created the address. Is it the private key?– TigerTJun 16, 2022 at 13:35
-
It is the private key, encrypted with the password that you have provided. I don't exactly know the format of the encryption used. Jun 16, 2022 at 16:31
-
Based on this, the encoded key seems to be written using the
TweetNaCl.js
library. Jun 16, 2022 at 16:39