0

For example i create a contract first, and then i generate a private key that map to the contract address. I know that is hard to achieve but is it possible theoretically?

4
  • I don't think that's possible, doesn't matter if for contract or EOAs. The public key and hence address is derived from private key. There is no reverse way or getting a private key corresponding to an address. Commented Dec 10, 2019 at 7:32
  • Possible theoretically - of course, you could simply try all possible private keys until you find the one that matches your contract address. Keep in mind that the number of different private keys (2^256) is more or less equal to the number of atoms in the known universe (10^80). So you might not be able to obtain the amount of energy required for your computer in order to generate all those private keys. Commented Dec 10, 2019 at 7:39
  • In addition to that, assuming you could cover 1 billion keys every second (which I sincerely doubt), it would still take you around 10^60 years to complete the task. In case you don't understand what this number means - the age of the universe is around 13.8 billion years. If you subtract this number from 10^60 years, you get approximately......... 10^60 years. Commented Dec 10, 2019 at 7:40
  • Theoretically possible with infinite resources, practically impossible, by design. If you do a bunch of stuff that cannot be done then it work, but you can't so it won't. As a side note, if those impossible things were doable then every account would be compromised and the platform would fail. Commented Dec 10, 2019 at 18:54

1 Answer 1

0

There's a difference between 'hard to achieve' and 'you could run your computer for a quadrillion years and probably not find one'. This falls into the second category.

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