Our favorite wallet software Electrum requires a little help when importing a private key to include all its possible four public addresses. In other words the two legacy P2PKH adresses (one uncompressed, one compressed), one segwit P2WPKH-P2SH address, and one native segwit P2WPKH (bech32) address.
Let’s consider this randomly generated private key (never use this exact one, as it has been disclosed here):
Private Key (HEX):
Private Key Uncompressed (WIF):
Private Key Compressed (WIF):
In order to make Electrum read and understand all four different public addresses that belong to this one private key, we must prepend the base58 encoded private keys with certain prefixes (“p2pkh:” for both the uncompressed and the compressed private keys, “p2wpkh-p2sh:” once for the compressed private key and finally “p2wpkh:” for the compressed private key). Does it sound complicated? It really isn’t! Simply copy these four lines
into Electrum (under Wallet/Private keys/Import).
Finally, look under the Address tab (if needed: View/Show Addresses), and you should see all four public addresses
Boom, done! Four public addresses from one private key. (Now, actually using the uncompressed legacy address isn’t a great idea, due to high transaction fees, but that is a topic for another article.)
Comments or questions?
One more thing!
Consider the donation address at the bottom of the page. We re-invest all contributions into new projects for btcleak.com. Help us create new content and remain ad-free forever. Thank you.