Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: hugeblack on February 10, 2018, 07:37:56 PM



Title: import SegWit address private key
Post by: hugeblack on February 10, 2018, 07:37:56 PM
Technically:
-what will happen "to the address format "if i import SegWit private key [P2SH or Bech32] into un-SegWit wallet "not support SegWit"?
-Can sign message using that private key "if new wallet support signing message"?


Title: Re: import SegWit address private key
Post by: LoyceV on February 10, 2018, 08:02:20 PM
-what will happen "to the address format "if i import SegWit private key [P2SH or Bech32] into un-SegWit wallet "not support SegWit"?
That's easy to test: create a new segwit address from segwitaddress.org (note: I do not know if this site can be trusted for real use, do your own research!), and enter the private key for Wallet Details on bitaddress.org.
Result:
Segwit Address: 34mUxBdWrXzjuCy3iwHypQm1bZhJ7oCnJZ
Segwit Private Key: L1F1mh5m7rzYEsdioVHJRMZcrwss1AHwhCd3owDUnD33CAw7JiXa (don't use this one!)
Bitaddress.org:
Bitcoin Address Compressed: 1CqC1x4ZkwH1HTDAe7UpsEu6c545udvBPr

Quote
Can sign message using that private key "if new wallet support signing message"?
You can sign a message from 1CqC1x4ZkwH1HTDAe7UpsEu6c545udvBPr, but that doesn't prove anything about your SegWit address.


Title: Re: import SegWit address private key
Post by: TheQuin on February 11, 2018, 10:42:45 AM
-what will happen "to the address format "if i import SegWit private key [P2SH or Bech32] into un-SegWit wallet "not support SegWit"?
That's easy to test: create a new segwit address from segwitaddress.org (note: I do not know if this site can be trusted for real use, do your own research!), and enter the private key for Wallet Details on bitaddress.org.
Result:
Segwit Address: 34mUxBdWrXzjuCy3iwHypQm1bZhJ7oCnJZ
Segwit Private Key: L1F1mh5m7rzYEsdioVHJRMZcrwss1AHwhCd3owDUnD33CAw7JiXa (don't use this one!)
Bitaddress.org:
Bitcoin Address Compressed: 1CqC1x4ZkwH1HTDAe7UpsEu6c545udvBPr

Quote
Can sign message using that private key "if new wallet support signing message"?
You can sign a message from 1CqC1x4ZkwH1HTDAe7UpsEu6c545udvBPr, but that doesn't prove anything about your SegWit address.

The Segwit addresses starting with 3 are nested inside a legacy address (staring 1). When you sign a message you are signing it with the private key, not the address. This is why these Segwit addresses cannot be used to sign messages. The bech32 addresses are native (not nested) so you can use their private keys to sign messages. Their private keys can only be imported into a wallet that supports Segwit with bech32 addresses.