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?

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

  • 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 Jan 8 '18 at 19:51
  • Ah yes, 2N is indeed the default for the testnet. See testnet.smartbit.com.au/tx/… for example – Rutger Versteegden Jan 8 '18 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.