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?
-
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.– Prashant Prabhakar SinghCommented 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.– goodvibrationCommented 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.– goodvibrationCommented 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.– Rob HitchensCommented Dec 10, 2019 at 18:54
Add a comment
|
1 Answer
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.