Search code examples
bitcoincoinbase-api

What type off address should you create to accept payments?


I am looking at this library. https://github.com/bitcoinjs/bitcoinjs-lib

There are numerous type of addresses to choose from:

  • Generate a random address
  • Generate an address from a SHA256 hash
  • Generate a 2-of-3 P2SH multisig address
  • Generate a SegWit address
  • Generate a SegWit P2SH address
  • Generate a SegWit 3-of-4 multisig address
  • Generate a SegWit 2-of-2 P2SH multisig address

Why are there so many options and is it safe to choose any address type?

I heard coinbase does not implement SegWit yet. Does that mean if I choose SegWit address, I can't get payments from Coinbase users?

If someone sends me to my SegWit address from a non-SegWit address, will it result in bounce back or money being lost?


Solution

  • It is safe for you to choose any of those addresses however they all work slightly differently.

    Bitcoin-core has adopted Segwit and fortunately Segwit is backwards compatible so wallets that are segwit can still transfer funds to wallets that are not segwit enabled.

    You will still be able to get coins from non-segwit addresses however there is a chance they may have to pay higher transactional fees to have their purchases included in an earlier block.

    Technical justification: Segwit P2SH (Pay to Script Hash), multisig and Segwit must all support the original bitcoin transaction format of Version/txins/txouts/nLockTime allowing wallets on the same Blockchain to interact regardless of being a variation of Segwit or not.