Nov 8, 2024

CashTokens are a very cool new feature that many have gotten a taste of.

The number one confusion we have in BitcoinCash tokens is the token-specific address format. People are not entirely sure what the point is and how to migrate.

Its actually quite simple, so take a look:

The basic idea of an address, naturally, is to request someone sending you funds. So to receive funds, I publish an address like this:
bitcoincash:qrejlchcwl232t304v8ve8lky65y3s945u7j2msl45
Notice that it starts with ‘q’.

This address format has several neat features:

  1. the entire address has a checksum in it. It will not verify if there is a typo in there.
  2. due to the above, you can just skip the ‘bitcoincash:’ part since any wallet or exchange can re-append it and verify. Easier for users.
  3. There are two pieces of data embedded in this. The actual address and a 4-bit number which is the address-type.

Point 3 is the important here. One address can be shown in 16 different ways. The main one can be recognized to start with a ‘q’. We call this the ‘pubkey-type’.

But you can take the same address and instead use the pk-token-type and the result is an address like: bitcoincash:zzlwl0h0hmhmama7a7lwl0h0hmhmama7audnwlly67

Conclusion: one address can be shown in different ways, either as ’token’ or as ’normal’.

How to use this new address format?

For practically all normal payment you keep using the existing ‘q’ based address type. This is compatible with all existing Bitcoin Cash wallets.

When a new wallet that supports cashtokens requests a payment it should also default to using the default ‘q’ based address type.

When a new wallet specifically requests a cash-token based transaction, things change. The normal QR code / bip21 payment request now will allow you to request payments of a specific token.

Example usecase; I’m at a convert venue and I need to send the NFT-based entrance ticket to them. Their payment request then shows their address using the new token-type and includes the token-category that indicates the concert ticket.

In this case you need to use the new token type addresses. A not-tokens supporting wallet will just not work, which is a lot better than the alternative of it sending money instead of tokens.

The short version is thus that you need to use the ‘z’ based token address if you want to explicitly disallow wallets that don’t understand tokens to use the request.

There are actually 4.

The above talks about normal and token addresses, I limited myself to those main groups to avoid this becoming confusing.

To be exact, there are two of each type.

  1. Public-key based addresses: ‘q’.
  2. pay-to-script addresses: ‘p’.
  3. token pubkey addresses: ‘z’.
  4. token pay-to-script addresses: ‘r’.

One address can still be converted into each of these types, the one you ask for is thus entirely based on the usecase. Pick wisely!