3

Specifically, if I had valid, secure keys stored in variables from somewhere else, could I use those to initialize a wallet? Or do keys have to be generated by the wallet software?

Thank you for your insight. Working on a project with friends to learn about Ethereum.

gator
  • 31
  • 3
  • Here are some examples with code - http://ethereum.stackexchange.com/questions/3169/how-to-get-address-from-private-key-in-java and http://ethereum.stackexchange.com/questions/4264/how-to-create-an-account-in-ethereumj . – BokkyPooBah Aug 20 '16 at 01:17

1 Answers1

1

An ethereum private key is just a random number, and the process to turn that into a public key and an address is publicly available and implemented by lots of different software, including libraries that you can easily call from code.

Edmund Edgar
  • 16,897
  • 1
  • 29
  • 58
  • More specifically, I will have public/private key pairs generated from something else (off of Ethereum) and I want to try to use that same key pair for a new account each time our code makes one for the user. It's a tricky idea for sure, but it would allow two disparate parts of our application talk to each other so much more easily. – gator Aug 19 '16 at 23:30
  • An account corresponds to a (hashed) public key, so you will need a different keypair per account. However, you may want to look into using ECC key derivation to create distinct keypairs from the same root key. There's a lot of bitcoin code to help with this kind of thing - look at HD wallet derivation for example - and you can create keypairs using tools intended for bitcoin then use them to create Ethereum addresses. That said, I wouldn't be surprised if there was a more ethereumy way to to whatever it is that you're trying to do. – Edmund Edgar Aug 20 '16 at 00:06
  • Excellent, that is a very helpful suggestion. We'll investigate going down that route. I appreciate your input. – gator Aug 20 '16 at 02:39