2

Ethereum uses asymmetric public/private key pairs to generate its accounts. So does GPG.

GPG key generation takes ages and needs lots of time/entropy. Ethereum doesn't. Why the big difference?

4

By default, GPG generates a 2048-bit RSA key. This requires generating a very large random number that has structural requirements to make it a valid RSA private key. So not any random number will do. You might have to try several before you find one that meets the requirements.

GPG also typically creates both a master key and a subkey. So you're creating two keys, not just one.

By contrast, Ethereum's private keys are only 256 bits long and require no particular structure. Almost any random 256 bits will do, and the majority of the time you only need 256 random bits to generate one.

This is kind of an apples to oranges comparison though because GPG keys are suitable for both encryption and digital signatures while Ethereum keys are not intended for encryption.

5
  • Nitpick: Not any random 256 bits key will do. Ethereum uses secp256k1 curve, see crypto.stackexchange.com/questions/30269/…. – Ismael Jun 30 '17 at 18:50
  • True, I'll clean it up. – David Schwartz Jun 30 '17 at 18:51
  • Note it's not really a practical issue: the chance of randomly generating an invalid key is less than 2^-128. – Tjaden Hess Jun 30 '17 at 19:04
  • Are you citing The all-zero bitsring, and the bitsring representing n or more in big-endian convention, have no corresponding public key per the standard. They are in a proportion about 2^−128 for secp256k1? It sounds like it should be trivial to test and regenerate bad keys. So why the uncertainty? – spraff Jun 30 '17 at 19:12
  • If you grab 256 random bits and they produce an invalid private key, you have two choices. You can generate 256 new random bits. Or you can fold the key into valid key space. The more common solution is to grab 256 more random bits, which would mean that sometimes you'll need more than 256 random bits to generate a private key. – David Schwartz Jun 30 '17 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.