Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Kostelooscoin on October 14, 2021, 03:55:41 PM



Title: All addresses with one private key
Post by: Kostelooscoin on October 14, 2021, 03:55:41 PM
Hello I would like to know if from a private key we could know all the addresses of type "1" "3" "bc" ....... if yes how?


Title: Re: All addresses with one private key
Post by: BlackHatCoiner on October 14, 2021, 04:36:04 PM
Yes.

If you're asking which are the technical stuff behind these procedures, then I'd recommend you to look on these three:

  • Technical background of version 1 Bitcoin addresses (https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses)
  • Step by step guide to go from public key to a Bech32 encoded address (https://bitcointalk.org/index.php?topic=4992632.0)
  • Step by step guide to creating a P2SH-P2WPKH and P2SH-P2WSH addresses (https://bitcointalk.org/index.php?topic=5229211.msg53930214#msg53930214)

If you're asking how can you do it too, then take a random number:
Code:
e9aec0c369cd1eb781a78225bada4b67e0c8a3e6037abd583ac4236bd4c5e13e

Get its WIF (https://learnmeabitcoin.com/technical/wif) (Wallet Import Format):
Code:
L53xbbK7B2N7FQJbrmP6jFktNj3vnPXhpGUH1KmGJNfSrTqcpL6m

Open up Electrum: “New/Restore” --> Name your wallet and click next --> “Import Bitcoin addresses or private keys” and enter the following:
Code:
p2pkh:L53xbbK7B2N7FQJbrmP6jFktNj3vnPXhpGUH1KmGJNfSrTqcpL6m
p2wpkh-p2sh:L53xbbK7B2N7FQJbrmP6jFktNj3vnPXhpGUH1KmGJNfSrTqcpL6m
p2wpkh:L53xbbK7B2N7FQJbrmP6jFktNj3vnPXhpGUH1KmGJNfSrTqcpL6m

Once you click next, you'll get an address starting with 1 called “Legacy”, another starting with 3 called “Segwit Nested” and another starting with bc1 called “Segwit Native”.



Title: Re: All addresses with one private key
Post by: Kostelooscoin on October 14, 2021, 04:37:58 PM
OK thanks 😉