2

probably this will be a very stupid question... So be careful :)

from eth_account import Account
while True:
    newAccount = Account.create()
    f = open("File.txt", "a")
    f.write("\nAddress: " + newAccount.address + "\nPrivate Key: " + Web3.toHex(newAccount.privateKey))
    f.close()

In this infinite loop it will create for each cycle a new Eth Address (+ Private Key).

Is this means that i can know potentially all the private key of all eth address o.O ?

Giuseppe
  • 185
  • 1
  • 2
  • 9

1 Answers1

2

Yes, if ALL of the following conditions hold:

  • Your file-system supports a file size of O(2 ^ 256) bytes
  • Your hard-drive has a capacity of O(2 ^ 256) bytes
  • Your life-expectancy is O(2 ^ 256) micro-seconds

Please note, however, that the number of atoms in the known universe is O(2 ^ 256), so with the current technology at hand it is quite impossible to store O(2 ^ 256) bytes of information.

Also note that O(2 ^ 256) micro-seconds is approximately the estimated age of the universe (13.7 billion years) times 8498555383074661855146468745466005103866 (that's an "8" followed by 40 digits).

You're not likely to live that long, and if the expansion of the universe will continue to accelerate at its current rate, then so is our planet, our solar system, and our galaxy (in fact any astral formation that we know of will be torn into elementary particles).

So of my statements above are possibly inacurate, so you might wanna post that on StackExchange site for astrophysics...

goodvibration
  • 26,003
  • 5
  • 46
  • 86
  • xD ok perfect. Thanks. As i said at the beginning "probably this will be a very stupid question... So be careful :)" – Giuseppe Jul 24 '19 at 14:14
  • Btw, is still possible to RE-generate some address that is used yet? – Giuseppe Jul 24 '19 at 14:16
  • @CrowdsaleGuy: You mean, generating a pair of [private key / public address] which someone else in the world is already using? – goodvibration Jul 24 '19 at 14:55
  • Also it will need a uniform PRNG that hast at least a cycle of 2^256. – Ismael Jul 24 '19 at 18:17
  • @goodvibration yes – Giuseppe Jul 25 '19 at 09:01
  • @CrowdsaleGuy: Well, let's over-exaggerately assume that there are 10 billion people on the planet (there are less of course), and that each one of them owns 10 billion wallets (and saves them in a file with a size of more than 1 TeraByte, by the way). Then the probability that you will generate one of these private keys is 10 ^ 9 * 10 ^ 9 / 2 ^ 256 which is more or less 1 / 10 ^ 60. Just so you get the unimaginable size of 10 ^ 60, if you subtract from it the number of seconds since the beginning of the Christian count (year 0), you will get... well, more or less the same number... – goodvibration Jul 25 '19 at 11:51
  • @goodvibration thanks for the explanation but also for the great example that you made xD – Giuseppe Jul 25 '19 at 12:00