Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: BlackHatCoiner on July 20, 2020, 09:20:34 AM



Title: Can 1 private key create 2 addresses?
Post by: BlackHatCoiner on July 20, 2020, 09:20:34 AM
One legacy and one segwit. Can it?


Title: Re: Can 1 private key create 2 addresses?
Post by: math09183 on July 20, 2020, 09:26:19 AM
One legacy and one segwit. Can it?

Yes
Try this: https://iancoleman.io/bip39/
generate key and check different Derivation Path path.

Also this same key may generate compressed/uncompressed address (2 different ones).


Title: Re: Can 1 private key create 2 addresses?
Post by: RXUser on July 20, 2020, 09:27:55 AM
2 legacy (compressed & uncompressed), 2 segwit (Native & Nested)


Title: Re: Can 1 private key create 2 addresses?
Post by: ABCbits on July 20, 2020, 09:39:00 AM
1 private key create 2 public key (compressed and uncompressed), which creates 5 type of addresses (P2PK, P2PKH, P2SH, P2WPKH & P2WSH). Take note that P2PK technically is just your public key.

However, there are various limitation which prevent specific public key/address combination, but i can't remember it.


Title: Re: Can 1 private key create 2 addresses?
Post by: pooya87 on July 20, 2020, 09:58:11 AM
1 private key create 2 public key (compressed and uncompressed),

actually each private key only creates one public key and that public key can be represented in 3 different forms: compressed, uncompressed and hybrid.
that public key in different form can be used in different scripts (which has virtually no limit in count) and create just as many addresses.

keep in mind that private key is just a number and public key is a point with (x,y) coordinate computed by adding G to itself private key times.


Title: Re: Can 1 private key create 2 addresses?
Post by: TheArchaeologist on July 20, 2020, 10:17:35 AM
One legacy and one segwit. Can it?
Absolutely! Bitcoin uses the Elliptic Curve secp256k1 algorithm to calculate exactly one public key that goes along one private key. However the public key in turn can be used in different ways to make up a human readable format.

In short:
Code:
1 Private Key -> 1 Public Key -> N addresses


Most used and standard address types:
  • Legacy, P2PKH based on non-compressed public key
  • Legacy, P2PKH based on compressed public key
  • P2SH wrapped P2WPKH (Nested Segwit)
  • Bech32 Native Segwit

But since addresses can be viewed as a readable form of an input script you could use the same public key to use more exotic and non-standard addresses like:
  • P2SH-P2PK
  • P2SH-P2PKH
  • P2SH-1of1MultiSi
  • P2SH-(locktime)
  • 2WSH(locktime)
  • ...

Basically you can come up with an umlimited amount of addresses all based on the same public key which is derived from a single private key. Internally however bitcoin does not use addresses so you should keep in mind every different type from above needs a different unlocking script.





Title: Re: Can 1 private key create 2 addresses?
Post by: pooya87 on July 21, 2020, 04:08:24 PM
I don't remember any wallet specifically mention they used hybrid public key as well.

i don't think any wallet supports hybrid public key format at all. in fact i don't think that many people even know about it. i found it myself by accident looking at the source code of bitcoin core. it is one of those tiny details that are buried in the protocol and by the way it is non-standard and will be rejected if you try using it by this line (that's a standard-rule flag) (https://github.com/bitcoin/bitcoin/blob/2c0c3f8e8ca6c64234b1861583f55da2bb385446/src/script/interpreter.cpp#L218).


Title: Re: Can 1 private key create 2 addresses?
Post by: OcTradism on July 23, 2020, 12:52:38 PM
How Bitcoin transactions work and what are their types? (https://bitcointalk.org/index.php?topic=5183979.0)
Bitcoin Address (Bitcoin.it/wiki) (https://en.bitcoin.it/wiki/Address0)

Quote
There are currently three address formats in use:

P2PKH which begin with the number 1, eg: 1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2.
P2SH type starting with the number 3, eg: 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy.
Bech32 type starting with bc1, eg: bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
Example with Bitamp wallet, 1 private key and you can get 3 address types.


Title: Re: Can 1 private key create 2 addresses?
Post by: BlackHatCoiner on July 23, 2020, 01:15:53 PM
What does electrum create? Compressed or uncompressed?


Title: Re: Can 1 private key create 2 addresses?
Post by: ranochigo on July 23, 2020, 01:28:24 PM
What does electrum create? Compressed or uncompressed?
Compressed. It's much more practical for people to adopt compressed addresses as they are far more economical and segwit addresses derived from uncompressed keys are also non-standard.



Title: Re: Can 1 private key create 2 addresses?
Post by: HCP on July 24, 2020, 12:11:17 AM
What does electrum create? Compressed or uncompressed?
Additionally, you'll find that most, if not all, "modern" wallets default to compressed... I can't think of any that default to using uncompressed addresses.


Title: Re: Can 1 private key create 2 addresses?
Post by: igor72 on July 30, 2020, 07:13:49 AM
I can't think of any that default to using uncompressed addresses.
Armory.


Title: Re: Can 1 private key create 2 addresses?
Post by: HCP on July 30, 2020, 08:23:53 AM
I can't think of any that default to using uncompressed addresses.
Armory.
Does it really? Well damn... I never actually noticed! Fairly obvious now that I think about it... all those WIFs starting with "5" in my screenshots!  :-[ ::)