Code prevention of sending bitcoin to an address on the wrong chain btc/bch/bsv

0

Since they share several common addressing schemes, can I figure out in code how to send them to the right chain?

Miyamoto Mustashi

Posted 2019-03-29T12:17:55.847

Reputation: 1

Answers

1

There are three partial remedies:

  • bech32 addresses are invalid on BCH and BSV
  • CashAddr is an alternative encoding (inspired by bech32) for p2pkh and p2sh addresses that is only valid on BCH and BSV
  • You can check whether the recipient address is subject to address reuse: if it was previously used on another network, you should request confirmation or another address from the recipient

Unfortunately, BSV and BCH share all address formats, so you cannot distinguish which network an address was generated for between the two.

Likewise, the original p2pkh and p2sh addresses are valid on all three networks and there is no way to distinguish which network an address was intended for just from the address itself.

Murch

Posted 2019-03-29T12:17:55.847

Reputation: 41 609

0

Simply, they don’t support the same addressing schemes. They use a modified version of bech32 that is incompatible.

Anonymous

Posted 2019-03-29T12:17:55.847

Reputation: 10 054

I believe all three can do P2PKH, P2SH, AND Bech32? No?Miyamoto Mustashi 2019-03-29T17:49:57.267