Bitcoin Forum
May 27, 2024, 10:15:39 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Calculating the storage that would be needed to store all addresses.  (Read 95 times)
BlackHatCoiner (OP)
Legendary
*
Online Online

Activity: 1526
Merit: 7450


Farewell, Leo


View Profile
October 26, 2020, 07:26:09 PM
 #1

All private keys are 2256, but all addresses that can exist are 2160, which is an enormous difference. This means that there must be some address collisions.

If I wanted to calculate the storage that would be needed for 1M of addresses I would do that on a csv file:
Code:
PRIVATE_KEY1,ADDRESS1_LEGACY,ADDRESS1_BECH32,ADDRESS1_P2SH
PRIVATE_KEY2,ADDRESS2_LEGACY,ADDRESS2_BECH32,ADDRESS2_P2SH
...
PRIVATE_KEY10000000,ADDRESS10000000_LEGACY,ADDRESS10000000_BECH32,ADDRESS10000000_P2SH

One line is 165 bytes:
Code:
L1CaDFTppeWGoz7pstPR1B8GUCTa2vw5C2fHBGp1G33vQd9PepBM,1BUp7h85TuZxPFarjD2zjChPpr5Upwnj1A,bc1qwtearx8uglkvf2ehv37na5k7myl9sll9uyjqx0,3PE7q99B22vj3qHYesF8YSioTpwC1EYCtk

So, 1 million of addresses would be 165 million bytes which is equal with 165 megabytes. Pretty heavy csv file, my computer would crash if I opened it.

_______________________________________________

But how about 2256 lines? Well, that's:

115​792​089​237​316​195​423​570​985​008​687​907​853​269​984​665​640​564​039​457​584​007​913​129​639​936 times 165.

= 1910569472415717224488921252643350479578954746983069306651050136130566639058944 0 bytes

We can't pretend to understand that number, but let's try. Based on this quora link, the 2018's 3D flash drives contain 1600 bits per cubic nanometer. This means that we will need:

9,552,847,362,078,586,122,444,606,263,216,752,397,894,773,734,915,346,533,255,250,680,652 cubic meters of pure hardware.

Universe has been calculated that it's 1.8 x 10^28 cubic meters. That's 1/530713742337699229024700347956486244327 of the needed hardware space. Have I made any mistakes? Because it seems too huge to me.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
October 26, 2020, 08:12:58 PM
 #2

That's only 700 square light years though if it's right (you should've used a factor of 10^-27 for converting metres to nanometers).
BlackHatCoiner (OP)
Legendary
*
Online Online

Activity: 1526
Merit: 7450


Farewell, Leo


View Profile
November 04, 2020, 08:08:24 PM
 #3

That's only 700 square light years though if it's right (you should've used a factor of 10^-27 for converting metres to nanometers).
So, will I get an even bigger number? Isn't it going crazy?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
November 04, 2020, 10:48:14 PM
 #4

That's only 700 square light years though if it's right (you should've used a factor of 10^-27 for converting metres to nanometers).
So, will I get an even bigger number? Isn't it going crazy?

Yeah if you didn't cube the 10^-9 then it'll be out by a factor of 10^18...

If you need an explanation, a decimetre square is 10cmx10cmx10cm. This is 1000cm2 but is also 0.1x0.1x0.1=0.001m2.
odolvlobo
Legendary
*
Offline Offline

Activity: 4326
Merit: 3241



View Profile
November 05, 2020, 04:56:04 AM
Last edit: November 05, 2020, 05:07:39 AM by odolvlobo
 #5

All private keys are 2256, but all addresses that can exist are 2160, which is an enormous difference. This means that there must be some address collisions.

An address is an encoding of a 1-byte network value plus a 20-byte hash, plus a checksum. So, the space needed to store an address is 21 bytes. Since there are 28 possible network values and 2160 possible hashes, the amount of space needed to store all of the addresses is 21 x 2168 bytes, or approximately 8x1051 bytes. That's equivalent to 8,000,000,000,000,000,000,000,000,000,000,000,000,000 1 TB drives.

However, it raises the question, why would you want to store every address, when any address can easily be generated?

As for collisions... Yes. Each possible address can be derived from an average of 297 private keys, which is an extraordinarily small number compared to the 2256 possible private keys.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
odolvlobo
Legendary
*
Offline Offline

Activity: 4326
Merit: 3241



View Profile
November 05, 2020, 05:20:52 AM
Last edit: November 05, 2020, 05:37:34 AM by odolvlobo
 #6

So, 1 million of addresses would be 165 million bytes which is equal with 165 megabytes. Pretty heavy csv file, my computer would crash if I opened it.

I see. You are really asking about how much space is needed to store a private key for every address.

Since a private key is 256 bits (plus a checksum and an 8-bit prefix that we can assume is always 0x80), it requires 32 bytes. The space required to store a private key for every address is 32 x 2160 bytes, or approximately 4.7x1049 bytes.

Assuming that you can store 200 bytes (1600 bites) in a nm3, that means that the volume required is 235,000,000,000,000,000,000 m3 ( 4.7x1049 / 200 / 1027 ).

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!