This deep dive expands on the token layer mentioned in "Tokens on the cash layer." It covers the technical foundation of CashTokens: category IDs, consensus rules, composability, and how tokens integrate with BCH. This is technical content for developers and the deeply curious.
Category IDs
Every CashToken belongs to a category, identified by a unique 32-byte ID. The category ID is derived from the transaction that created the token: specifically, the outpoint (transaction ID + output index) of the first output in the transaction that minted the token.
This gives every token family a unique, verifiable identity tied to its origin. You can look up the creation transaction and see exactly when and how the token was issued. The category ID is immutable โ once a token family is created, its ID is fixed forever.
Two token types
CashTokens adds two primitives to BCH:
- Fungible tokens: Divisible and interchangeable. Each unit is identical to every other unit in the same category. Fungible tokens have an
amountfield measured in the smallest unit (like satoshis for BCH). A category can have up to 9.22 quintillion units (2^63 - 1). - NFTs: Indivisible and unique. Each NFT carries a
commitmentโ a short piece of data (up to 40 bytes before 2026, 128 bytes after) that the network can verify. NFTs also have acapabilityfield that controls whether they can be modified or whether more NFTs can be minted in the same category.
Three NFT capabilities
Each NFT has one of three capabilities:
- Minting (0x01): Can create more NFTs in the same category. A minting NFT is like a master key for the token family. The holder can issue new NFTs with new commitments.
- Mutable (0x02): Can update its own commitment when spent. A mutable NFT can change its data payload, making it useful for state that needs to evolve (a score, a status, a timestamp).
- Immutable (0x00): Cannot change once created. An immutable NFT is permanent. Its commitment is fixed, making it suitable for certificates, receipts, or any claim that should never be altered.
Tokens travel in UTXOs
Tokens don't exist as separate objects. They're attached to UTXOs (unspent transaction outputs), the same locks that hold BCH. A single UTXO can hold:
- BCH (the base currency)
- Any amount of one fungible token category
- One NFT (with its commitment and capability)
This means a single transaction can move BCH, fungible tokens, and an NFT all at once. That's composability: a contract can require payment in BCH and a token transfer in the same step, without coordinating multiple transactions.
Consensus enforcement
The token rules are enforced at the consensus level. Every full node validates:
- Category integrity: Tokens can only be created in a valid category (one that exists on-chain).
- Supply rules: Fungible token amounts must balance (inputs = outputs + fees). You can't create fungible tokens out of thin air unless you hold a minting NFT for that category.
- NFT rules: Only a minting NFT can create new NFTs in its category. Only a mutable NFT can change its commitment. Immutable NFTs cannot be modified.
- Separation: Tokens can't be mixed across categories. Each UTXO holds tokens from one category only (plus BCH).
This is what makes CashTokens different from token layers on other chains. The rules aren't enforced by a separate network or a bridge. They're enforced by the same computers that validate BCH. Every full node checks the token rules as part of block validation.
No separate gas token
On many smart contract platforms, you need a second token to pay for transaction fees. On BCH, the fee is just BCH. A token transfer costs a fraction of a cent in normal conditions, paid in BCH. There's no separate "gas" token to acquire before you can use the network.
This is a meaningful UX difference. A community currency, a loyalty program, or a ticket system doesn't need to teach users two assets. They hold BCH for fees and the token for the application. The wallet shows both, and the transaction moves both at once.
BCMR: metadata at the edges
CashTokens are minimalist by design. The on-chain data is small: category ID, amount, commitment, capability. Rich metadata โ names, descriptions, icons, images โ lives off-chain in Bitcoin Cash Metadata Registries (BCMR).
BCMR is a standard for publishing authenticated metadata. A token issuer can register their token's name, symbol, description, and icon in a BCMR registry. Wallets and explorers fetch the metadata and display it alongside the on-chain data. The result is a compact on-chain primitive with rich presentation around it.
BCMR registries are separate from the chain, so they can be updated without modifying the blockchain. But the on-chain token data is immutable and verifiable. The metadata is presentation; the token is the truth.
Composability with contracts
Tokens can be used in BCH contracts (scripts). A contract can:
- Require payment in both BCH and a specific token
- Check that an NFT has a specific category and commitment
- Enforce token transfer rules (e.g., only to verified addresses)
- Use minting NFTs to control token issuance
This composability is what makes CashTokens powerful. Tokens aren't just assets; they're programmable. A contract can use tokens as receipts, tickets, memberships, or state. The token layer and the contract layer are the same layer.
Why native matters
You could build tokens on top of any blockchain using add-on layers, metadata, and indexers. CashTokens takes a different route: put the rules directly into the consensus layer. Every full node checks the token rules. There's no separate indexer you have to trust for validity.
Native tokens are cheaper (no extra transaction for a separate layer), safer (enforced by consensus, not by policy), and easier for contracts to use (tokens are first-class citizens in the script system). That's the BCH pattern: keep the core small, but make the core enforce the things people actually need.
For the technical foundation of BCH scripts, see The script under every wallet. For NFTs specifically, see BCH NFTs in detail.
We do not provide financial advice.