3

On the forum there were some threads about people creating multiple public keys from one private key. I am wondering if the reverse is possible as well. Can 2 private keys create 1 public key. I am talking about two private keys of 64 characters.

Is this possible and if so how?

2 Answers 2

2

There are three different terms:

  • Ethereum private keys are 32 bytes
  • Ethereum public keys are 64 bytes
  • Ethereum addresses are 20 bytes

The address is derived from the public key. The public key is derived from the private key.

Since address is shorter than a private key, multiple private keys map into the same address. Therefore an Ethereum address can have multiple valid private keys.

Of course it's next to impossible to find a private key for an address (or for a public key) even if you already have one valid private key.

5
  • Thanks so much for the explanation. There is one thing that confuses me though. Lets say it happens and there are 2 valid private keys for the wallet. How would you sign that transaction. Because you need the private key to sign it, but you can only have one private key sign the transaction. right?
    – IsmailK
    Commented Jan 1, 2023 at 21:22
  • In that case either of the private keys can be used to sign the transaction - from the blockchain's perspective the resulting address is the same so it doesn't matter what key was used. The blockchain only cares that the transaction was signed by a valid key (and has enough Ethers for gas and other irrelevant stuff) Commented Jan 1, 2023 at 21:27
  • I saw in the link you provided the following: Private Key: A randomly selected positive integer (represented as a byte array of length 32 in big-endian form) in the range [1, secp256k1n − 1]. In case you were to try sign and submit the transaction, wouldnt you end up with a scalar that is not in the interval?
    – IsmailK
    Commented Jan 1, 2023 at 22:22
  • Sorry, I'm not sure what you're asking. But in any case, please post a new question if you have new questions. The comment section is not very well suited for this kind of stuff Commented Jan 2, 2023 at 6:12
  • 1
    Probability of 160 bit collision is 1/2^80 due to birthdays paradox when remembering all the generated ≈2^80 addressed. And you’re looking for collision to specific address probability is 1/2^160.
    – k06a
    Commented Jan 4, 2023 at 7:57
0

In short, no. The process of creating a key pair is pretty much one-directional, and the reverse is hardly possible. By the way, why would you like to pull off a reverse?

Here's a good example of how this all works under the hood. It's YAD's interactive guide for beginners where you create the key pair step by step. But if you don't want to click, here's a short version:

  1. Generate a private key using some degree of randomization. Along the lines of bitaddress.org or similar services.

  2. Generate a public key from your private key using ECC (specifically the secp256k1 curve, which is a good fit for Ethereum).

  3. Generate a public address out of the public key, which might also consist of generating a compressed public address, then refining this address, etc

See now how the right order of these steps is actually important, right? Hopefully, now you don't want to mess with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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