Author

Topic: Multiple public adresses for one private key? (Read 1480 times)

sr. member
Activity: 300
Merit: 253
Ok Check!
Ahh Gotcha! Thanks!  Smiley
legendary
Activity: 3472
Merit: 4801
So it generates 100 priv+pub key pairs at the time of installation but does not show them up.

Correct.

Once I click on generating new addresses, it picks one of those and show it to me?

Correct.  It also uses one of those addresses every time you send a transaction (for the change from the transaction).

If I go beyond 100, it generates new priv+pub key everytime?

Is that how it works?

Not quite.

Each time it takes a priv+pub key from the pre-generated pool, it generates a new one to add to the queue.  That way there continues to be a pool of 100 available.

Because of this, you can create a backup at any time, and as long as you haven't used up more than 100 addresses since the backup, you can recover your entire wallet balance from the backup.
sr. member
Activity: 300
Merit: 253
Ok Check!
So does that mean everytime I create a new address on the Bitcoin core, a new Priv+Pub pair is generated?

Yes. (Although with default settings, Bitcoin Core pre-generates 100 addresses)

If yes, how are they all tied to my own wallet? How does the application keep them together for me?

Bitcoin stores all the private keys in a file called wallet.dat.

So it generates 100 priv+pub key pairs at the time of installation but does not show them up. Once I click on generating new addresses, it picks one of those and show it to me? If I go beyond 100, it generates new priv+pub key everytime?

Is that how it works?
legendary
Activity: 3472
Merit: 4801
So does that mean everytime I create a new address on the Bitcoin core, a new Priv+Pub pair is generated?

Yes. (Although with default settings, Bitcoin Core pre-generates 100 addresses)

If yes, how are they all tied to my own wallet? How does the application keep them together for me?

Bitcoin stores all the private keys in a file called wallet.dat.
sr. member
Activity: 300
Merit: 253
Ok Check!
The private key in Wallet Import Format (WIF) as most of us are used to seeing it actually has 3 important parts.

https://en.bitcoin.it/wiki/Wallet_import_format

  • (1 byte) A version number.
  • (32 bytes) The ECDSA private key.
  • (4 bytes) A checksum.

By changing the version number, you can generate different bitcoin addresses (one for an uncompressed public key, and the other for a compressed public key) with the same ECDSA private key.  This will result in a different WIF (both the version number and the checksum will be affected) for that private key though, so when viewed in the typical format it will appear to be a different private key.




So does that mean everytime I create a new address on the Bitcoin core, a new Priv+Pub pair is generated? If yes, how are they all tied to my own wallet? How does the application keep them together for me?
legendary
Activity: 3472
Merit: 4801
As far as I know:

Private ECDSA key:  256 bits
generate public key from that:  2 32 byte numbers
SHA-256 hash of public key:  256 bits
RIPEMD-160 hash of that:  160 bits
SHA-256 hash that twice and encode in base 58 to get your address.

Throw in some checksums and magic numbers along the way.

The double SHA-256 is for the checksum.  That and the version number are both part of Base58check encoding.

  • Private key:(256 bits)
  • ECDSA public key from that: two 32 bit numbers (512 bits), or one 32 bit number (256 bits) for compressed key
  • SHA-256 hash of public key: 256 bits
  • RIPEMD-160 hash of that: 160 bits
  • Encode in Base58check (Add version byte in front, checksum behind, and encode with special base 58 rules)
cp1
hero member
Activity: 616
Merit: 500
Stop using branwallets
As far as I know:

Private ECDSA key:  256 bits
generate public key from that:  2 32 byte numbers
SHA-256 hash of public key:  256 bits
RIPEMD-160 hash of that:  160 bits
SHA-256 hash that twice and encode in base 58 to get your address.

Throw in some checksums and magic numbers along the way.
legendary
Activity: 3472
Merit: 4801
No, it is not possible.

One private key has one public key. So each address has only one private key.

Ok. I stand corrected. I previously thought that you could have lots of private keys hashing to a single bitcoin address, but that collisions would still be so rare as to render that non-problematic.

The thing that I find interesting is that a private key is enormous compared to the size of a bitcoin address, leading me to believe that it would be possible to hash multiple private keys to the same bitcoin address.

You are correct.  There are potentially nearly 2256 public keys, and there can't be more than 2160 bitcoin addresses.  Therefore, there are likely to be multiple public keys (and therefore multiple private keys) that all result in the same bitcoin address.  Fortunately, there is no known way to find these additional keys that result in the same address.
newbie
Activity: 30
Merit: 0
No, it is not possible.

One private key has one public key. So each address has only one private key.

Ok. I stand corrected. I previously thought that you could have lots of private keys hashing to a single bitcoin address, but that collisions would still be so rare as to render that non-problematic.

The thing that I find interesting is that a private key is enormous compared to the size of a bitcoin address, leading me to believe that it would be possible to hash multiple private keys to the same bitcoin address.
newbie
Activity: 56
Merit: 0
No, it is not possible.

One private key has one public key. So each address has only one private key.
newbie
Activity: 30
Merit: 0
No, you cannot have multiple public addresses from a single private key.

However, over 28 million private keys can produce the same bitcoin address. Seriously.

However, the chance of every producing a collision is so astronomically rare that you would have to be bitten by a shark, hit by a bus, shot by a gunman, struck by lightning and win the lottery all within a single day.

Trying to get a collision? Forget it, it's virtually impossible!
cp1
hero member
Activity: 616
Merit: 500
Stop using branwallets
Stealth addresses are similar too.
legendary
Activity: 3682
Merit: 1580


Is it possible to have multiple public addresses for one private key?
If yes how to do it ?

Tanks !!

If I were to stretch things a little I could say that a deterministic wallet is an example of unlimited addresses derived from a single private key. That private key is called a seed. Examples of deterministic wallets are electrum and armory. Try them out if you want to see it in action.
legendary
Activity: 3472
Merit: 4801
The private key in Wallet Import Format (WIF) as most of us are used to seeing it actually has 3 important parts.

https://en.bitcoin.it/wiki/Wallet_import_format

  • (1 byte) A version number.
  • (32 bytes) The ECDSA private key.
  • (4 bytes) A checksum.

By changing the version number, you can generate different bitcoin addresses (one for an uncompressed public key, and the other for a compressed public key) with the same ECDSA private key.  This will result in a different WIF (both the version number and the checksum will be affected) for that private key though, so when viewed in the typical format it will appear to be a different private key.

hero member
Activity: 742
Merit: 502
Circa 2010
I am pretty sure that's impossible.

My understanding is the public key is calculated from the private key in a unique fashion.

Correct, Bitcoin's current implementation means that it is impossible for you to have more than a single public key from each of your private keys. Mathematically, I believe you might be able to - but this has been addressed by the way Bitcoin has been coded.
legendary
Activity: 4214
Merit: 1313


Is it possible to have multiple public addresses for one private key?
If yes how to do it ?

Tanks !!

The reverse question is a different matter.
full member
Activity: 224
Merit: 100
I am pretty sure that's impossible.

My understanding is the public key is calculated from the private key in a unique fashion.
member
Activity: 85
Merit: 10


Is it possible to have multiple public addresses for one private key?
If yes how to do it ?

Tanks !!
Jump to: