Since they share several common addressing schemes, can I figure out in code how to send them to the right chain?
2 Answers
There are three partial remedies:
bech32
addresses are invalid on BCH and BSVCashAddr
is an alternative encoding (inspired by bech32) forp2pkh
andp2sh
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.
Simply, they don’t support the same addressing schemes. They use a modified version of bech32 that is incompatible.