Private key securities

  1. Where is the private key of the user stored? (Check for tKey)
  2. What part of the key is kept in user’s system?
  3. What is used for constructing the private key and what happens if you change the password.
  4. If we want to export the actual private key to be imported in another wallet, how do we do that?

Hey @samarth, sorry for the delays.

  1. The private key of the user is never stored anywhere, it’s always reconstructed on the frontend using the SSS architecture, you can read more about it. To give a gist of the SSS architecture, two draw a line on x,y plane you always require two points, similar to get the secret in SSS architecture you require two shares. By default, your first share is always the OAuth login share which is managed by Web3Auth nodes. Even if someone has access to your OAuth login, they can’t access the account because they won’t have second share. Read more here: Web3Auth Shamir Secret Sharing Architecture | Documentation | Web3Auth
  2. As I said in SSS architecture you require two shares at least to reconstruct the key, the second share is stored on user’s device but that can be customised as well, whether you want to keep on device, or add any other share like social login, authenticator, etc.
  3. The Lagrange interpolation is used to reconstruct the key on the frontend. You can read more about it.. When you change the password, it basically changes the recovery share, and hence next time you can use this new share to reconstruct key.
  4. In tKey SDK you do get the private key upon successful reconstruct, you can export that private key to any other wallet provider. Please note that private key would be using SEC1 curve, so it’ll be only compatible with blockchains using SEC1.