What Do SegWit Addresses Look Like?

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?

ImJustACowLol

Posted 2018-01-08T18:29:05.280

Reputation: 21

Answers

1

You are using the testnet which uses 2 instead of 3, but as far as i know it is impossible to tell if something is a multisig or segwit adress when they both start with 3 on the "real" bitcoin chain, It could be both..

However you can indeed be sure that it is a segwit adress when they start with BC1, these are so called bech adresses. See more here, https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki

Rutger Versteegden

Posted 2018-01-08T18:29:05.280

Reputation: 966

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