BlogMainnet
Bitcoin Cash Address Format: CashAddr vs Legacy
Why Bitcoin Cash addresses start with q, p, z or r, how CashAddr differs from legacy 1 and 3 addresses, and how to convert and check one safely.
If you've used Bitcoin Cash for a while you've probably seen at least two kinds of address: the long lowercase ones starting with q and, now and then, an older one starting with 1. Newer wallets may also give you one starting with z. They're all valid. They're just different ways of writing an address, and knowing which is which saves you from the one mistake that really hurts: sending coins to the wrong chain.
The short version
| Starts with | Format | What it is |
|---|---|---|
bitcoincash:q… | CashAddr | Regular single-key address (P2PKH) |
bitcoincash:p… | CashAddr | Script address (P2SH), used for multisig and contracts |
bitcoincash:z… | CashAddr | Token-aware P2PKH, for wallets that support CashTokens |
bitcoincash:r… | CashAddr | Token-aware P2SH |
1… | Legacy | Old P2PKH format, same as Bitcoin's |
3… | Legacy | Old P2SH format, same as Bitcoin's |
bchtest:… | CashAddr | Any of the above on a test network, not real money |
The bitcoincash: prefix is often left off in wallets, so an address that just starts with q is still a CashAddr.
Why Bitcoin Cash changed its address format
When Bitcoin Cash split from Bitcoin in August 2017, both chains used exactly the same address format. An address starting with 1 was valid on both. That caused a real problem: people sent BCH to BTC-only services and BTC to BCH addresses, and getting those coins back depended on someone holding the right keys and being willing to help.
The fix was CashAddr, specified in the Bitcoin Cash address format spec and activated in January 2018. A CashAddr can't be mistaken for a Bitcoin address, so wallets and exchanges can reject the wrong one before any money moves.
How a CashAddr is built
A CashAddr has three parts:
- A prefix that names the network:
bitcoincashfor mainnet,bchtestfor test networks,bchregfor regtest. - A separator, always
:. - A payload in base32: a version byte that says what kind of address it is, the hash itself, and a 40-bit checksum.
A couple of details make it nicer to use than the old format:
- It's all lowercase. No more squinting at
lversusI, and it fits QR codes well. - The checksum is strong. According to the spec it detects up to 6 errors anywhere in the address, or a run of up to 8 wrong characters in a row. A typo almost always makes the address invalid instead of sending money somewhere else.
- The prefix is part of the checksum. Even when the prefix is hidden, a mainnet address can't pass as a testnet one or the other way round.
The first character after the colon comes from the version byte, which is why the type shows up so clearly: q for P2PKH, p for P2SH, and since the 2023 CashTokens upgrade, z and r for the token-aware versions.
A real example: same address, three ways
The CashAddr spec includes conversion examples. Here's one of them:
- Legacy:
1BpEi6DfDAUFd7GtittLSdBeYJvcoaVggu - CashAddr:
bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a
Both encode the same 20-byte hash, so they control the same coins. If you paste the legacy version into the BlockExplorer.cash search, it takes you straight to the CashAddr page.
The same hash as a token-aware address is bitcoincash:zpm2qsznhks23z7629mms6s4cwef74vcwvrqekrq9w. Notice that only the first letter and the checksum at the end changed. On a test network it would be bchtest:qpm2qsznhks23z7629mms6s4cwef74vcwvqcw003ap, and that's a completely different address, because it lives on a different chain.
Script addresses follow the same pattern. The spec pairs 3CWFddi6m4ndiGyKqzYvsFYagqDLPVMTzC with bitcoincash:ppm2qsznhks23z7629mms6s4cwef74vcwvn0h829pq.
Token-aware addresses (z and r)
The CashTokens specification added two new CashAddr types: token-aware P2PKH (z) and token-aware P2SH (r). They don't change where the BCH goes. They're a signal. A z address says "my wallet understands tokens".
The spec also says token-aware wallets must refuse to send tokens to plain q/p addresses and to legacy addresses. That stops people from sending NFTs or fungible tokens to a wallet that would ignore them or burn them by accident. So if a token wallet refuses to send to your q address, that's working as designed: give the sender your z address instead. Most token wallets show both.
Sending plain BCH to a z address is fine. It ends up in the same place as the q version.
Converting between formats
Most of the time you don't need to convert anything. Modern wallets and exchanges accept CashAddr, and many also accept legacy. If you do need to:
- Use your wallet. Electron Cash, for example, can show addresses in either format.
- Use an explorer. Paste a legacy address into the BlockExplorer.cash search and it opens the CashAddr page. That doubles as a quick validity check: an invalid address simply won't resolve.
- Be careful with random websites. A converter only needs to do maths, but a malicious one could show you an address that isn't yours. Stick to software you trust and double-check the first and last few characters.
Longer addresses: P2SH32
Since May 2023, Bitcoin Cash also supports 32-byte script hashes (P2SH32), which give contracts stronger collision security. Their CashAddr form is longer than the 42 characters you're used to after bitcoincash:. If you see an unusually long p or r address, it's probably one of these, and it's valid. You'll mostly see them in DeFi and other contract transactions.
How to check an address before you send
- Check the network. Mainnet addresses start with
bitcoincash:(or justq/p/z/r). If it saysbchtest:, it's test money. - Check the chain. If someone gives you an address starting with
1or3, confirm it's a BCH address and not a Bitcoin one. If you can, ask for the CashAddr version. - Check the type if tokens are involved. Tokens need
zorr. - Look it up. Paste it into the explorer. A valid address opens its page with any transactions it has received.
- Compare the ends. Clipboard malware swaps addresses, so compare the first and last 5 or 6 characters with the original.
Summary
CashAddr is Bitcoin Cash's own address format: lowercase, with a prefix that names the network and a strong checksum. The first letter tells you the type (q, p, z or r). Legacy 1 and 3 addresses still point to the same coins, but they look exactly like Bitcoin addresses, which is why CashAddr exists. When in doubt, paste the address into a Bitcoin Cash explorer before sending anything.
Frequently asked questions
What does a Bitcoin Cash address start with?
In the CashAddr format, a mainnet address starts with bitcoincash: followed by q (regular), p (script), z (token-aware regular) or r (token-aware script). The prefix is often hidden, so you may just see an address starting with q.
Is a legacy Bitcoin Cash address starting with 1 still valid?
Yes. A legacy address and its CashAddr version point to the same coins. CashAddr is just a different encoding that can't be confused with a Bitcoin (BTC) address.
Can I send BCH to a BTC address?
Don't. Legacy BCH and BTC addresses look the same, which is why CashAddr was created. Sending to the wrong chain can make coins very hard or impossible to recover.
What is a token-aware address?
A CashAddr starting with z or r tells the sender's wallet that the receiving wallet supports CashTokens. Token wallets refuse to send tokens to plain q or p addresses.
