2
Probably a question that has been asked a lot before, but how do I know if an address I generate with bitcoind and bitcoin-cli is SegWit?
I take the following steps to (attempt to) generate a SegWit address with the command prompt:
$ bitcoin-cli -testnet getnewaddress
n2BC24zr3L5BwVazecnvPPh7NwgcV2Vfxa
$ bitcoin-cli -testnet -addwitnessaddress n2BC24zr3L5BwVazecnvPPh7NwgcV2Vfxa
2NBnkQpnPitDbE3evwZXGpNpRLE51cJpdGA
Now this confuses me because in this post it is stated that SegWit addresses start with a '3'. Yet in this address it is said that they start with 'bc'.
The address I've generated in the above example starts with 2N, which is neither of the above. How can I know if it is still SegWit? Or did I do something wrong while trying to make a SegWit address?
I generated the address as shown above: I first call 'getnewaddress' which returns the n2B address. Then I use that address as a seed for the 'addwitnessaddress' which gives me the 2N address. Is it because I am doing all this on the testnet, perhaps? – ImJustACowLol – 2018-01-08T19:51:01.920
Ah yes, 2N is indeed the default for the testnet. See https://testnet.smartbit.com.au/tx/d529ccb7c17557bb784e410bfffc1bf57b60991b86eb0f48028369182491c0fb for example
– Rutger Versteegden – 2018-01-08T19:54:06.457