I created an example address : 3AzHxHsjQUrJeo61zYXmrJrWNeyHxZ61PS (via GetNewAddress method)
And it's private key L4b7UBiKgM1nr1vn2xdJGupVmg77xKYGi8id7YneDmnopafciDkB (dumpprivkey)
When I go to an empty another bitcoin core wallet for import this private key (importprivkey) it creates another bitcoin address (1Mkw8Sa32VZTFyesrubYKSUTEmgVof4okq)
But I was expecting to give me first address (3AzHxHsjQUrJeo61zYXmrJrWNeyHxZ61PS)
what's weirder is that when I tried that privkey on bitaddress.org, I get different legacy address
it gives me 1CwQqU6fekhLCGxqVYLZqqNPJ8M4GzaDMX instead, which I think the correct compressed legacy address for that privkey
Can anybody tells me what is the problem ?
you created segwit address but you've only just imported a legacy address
after you've imported its legacy address, you can try use
addwitnessaddress on that legacy address
change the parameter of addwitnessaddress to whatever legacy address you get after importprivkey
> importprivkey L4b7UBiKgM1nr1vn2xdJGupVmg77xKYGi8id7YneDmnopafciDkB
1CwQqU6fekhLCGxqVYLZqqNPJ8M4GzaDMX
> addwitnessaddress 1CwQqU6fekhLCGxqVYLZqqNPJ8M4GzaDMX
null