Bitcoin Cash
- create
- create("bitcoincash")
- family
- UTXO · utxo
- symbol
- BCH · 8 decimals
- bip44
- 145
- caip2
- bip122:000000000000000000651ef99cb9fcbe
- explorer
- blockchair.com/bitcoin-cash
Address format
CashAddr, the same encoding eCash uses, with the checksum verified under the bitcoincash prefix whether the address carries bitcoincash: or not. The rules are the ones Bitcoin Cash Node decodes by. q… is pay-to-pubkey-hash over a 20-byte hash, p… is pay-to-script-hash over 20 bytes or over 32, the longer P2SH32 form. z… and r… are the token-aware twins CashTokens added, same hashes, same rules. Mixed case fails, all lowercase or all uppercase passes.
A bare eCash address fails here, and a bare Bitcoin Cash address fails on eCash. The two differ in the checksum alone, and the checksum is exactly what gets verified, so identify names one chain and not both.
Legacy 1… and 3… addresses aren't accepted. Wallets still read them, but the bytes are Bitcoin's, so a legacy address says nothing about which chain it's for. Convert it to CashAddr first.
The CAIP-2 reference isn't Bitcoin's genesis. Bitcoin Cash shares that block, so BIP-122 keys the chain by block 478559, the first one after the split.
import { getChain } from "@agntn/chains";
const chain = getChain("bch");
chain.assertAddress("bitcoincash:qz3yjg59ypg6jqpwhaxgvjj44jm4hdx0w5wsxw2qez"); // returned unchanged
chain.bip44; // 145
chain.caip2; // "bip122:000000000000000000651ef99cb9fcbe"
Spellings
bitcoincash, bch, bitcoin-cash, Bitcoin Cash. The key is bitcoincash, the rest resolve through getChain.