Question related to createkeypairs command

+1 vote
Hello,

I have a couple of questions:

1. Is there any way to find out private key value if we generate it via 'createkeypairs'. How does the blockchain know that this key is related to created address? Is that information stored somewhere and vulnerable?

2. Can we somehow validate that generated key? For example if it is mandatory to insert address and private key in order to log in, what is the best way to validate that private key if it is related to that address?

Thank you in advance for answers.
asked Mar 10, 2017 by Mile

1 Answer

0 votes
  1. The connection between the private key and the address is mathematical, based on the cryptography schemes used on the blockchain, so it does not need to be stored anywhere.
  2. You can use challenge someone to prove they own the private key corresponding to a particular blockchain address by sending them a random challenge string. They can use the signmessage API to sign that string using their private key, and you can use the verifymessage API to check it.
answered Mar 10, 2017 by MultiChain
...