Chialisp Guide Pt 5: CATs: Design and Mint

9 min read

Chialisp CATs design three-layer architecture showing outer puzzle, inner puzzle, and TAIL program

Key Takeaways

  • CATs use a three-layer design: an outer CAT puzzle enforces supply rules, an inner puzzle controls ownership, and a TAIL program defines minting and melting rules1,2
  • Every CAT equals 1,000 mojos, providing a minimum physical value on the blockchain while enabling precise token accounting3
  • Single-issuance TAILs create fixed-supply tokens that cannot be melted, while multi-issuance TAILs allow creators to mint more tokens using a secret key3
  • Unlike Ethereum’s contract-based ERC-20 tokens, CATs use Chia’s coin set model where token logic lives directly inside individual coins2
  • CAT owners have complete control over spending – creators cannot freeze or confiscate funds without the owner’s permission, unlike many ERC-20 implementations5

Article Summary

Chialisp CATs are fungible tokens built on Chia’s blockchain using a unique layered architecture that wraps an inner ownership puzzle with an outer CAT puzzle and a TAIL program to enforce supply rules.2 This design gives token holders complete spending control while allowing creators to define custom issuance and melting logic through Chialisp programming.

What Are CATs and Why They Matter

Chia Asset Tokens are fungible tokens that live on the Chia blockchain. Think of them like digital poker chips – each chip of the same type has the same value and can be swapped for any other chip of that type. CATs follow the CAT2 standard, which replaced the original CAT1 standard at block height 2,311,760 (July 26, 2022) after Trail of Bits security audit uncovered vulnerabilities.1

The current CAT2 standard allows you to create tokens that represent divisible assets or currencies on top of Chia’s blockchain.2 You can use CATs to build stablecoins like Stably USD, meme tokens like Spacebucks, or custom tokens for any project that needs fungible digital assets.1

What makes CATs special is how they handle ownership and supply. Unlike Ethereum’s account-based contracts, CATs are part of Chia’s Coin Set model. The token’s logic is embedded directly into individual coins.2 This means you truly own your tokens – the creator cannot freeze or take them back without your permission.

CATs work differently than most other blockchain tokens. Every CAT equals exactly 1,000 mojos.3 This one-to-one-thousand ratio ensures that every CAT has a minimum physical value on the blockchain. If you want to create one million tokens, you need one billion mojos (which equals 0.001 XCH).

CAT Architecture: The Three-Layer Design

Understanding how CATs work requires learning about their three-layer design. Each layer has a specific job, working together to create secure, programmable tokens.2

The Outer Puzzle (CAT Layer)

The outer puzzle is the CAT layer that enforces supply rules. This layer makes sure the total supply of a specific CAT never changes unless specific issuance rules are met.2 Think of it as a wrapper that keeps track of all the tokens.

When you spend a 100-token CAT coin, the outer puzzle ensures the resulting output coins total exactly 100 tokens. The CAT layer uses a ring of coins and lineage proofs to verify that each coin in the spend is the same CAT type. It tracks subtotals so the total CAT amount stays conserved with a net delta of zero across the entire spend.2

The outer puzzle also handles something called “wrapping.” Whenever the inner puzzle creates new coins through a CREATE_COIN condition, the CAT layer wraps the new puzzle hash again with the same TAIL. This ensures outputs remain CATs of the same type instead of silently melting back to XCH.2

The Inner Puzzle (Ownership Layer)

The inner puzzle manages who can spend the coin. This is usually the Standard Transaction puzzle, which allows users to send CATs to their Chia wallet addresses just like sending regular XCH.2

The CAT puzzle treats your spending logic as an inner puzzle. It passes the remaining solution to your puzzle and then processes the conditions your inner puzzle creates. This design keeps user logic separate from CAT logic, preventing conflicts and making the system more secure.2

The CAT layer reserves a special prefix for its own coin announcements. This prevents your inner puzzles from spoofing or interfering with CAT-level coordination.2 The sandboxing between CAT logic and user logic protects the integrity of the token system.

The TAIL (Token Issuance Rules)

The Token and Asset Issuance Limiter is a separate Chialisp program that defines the unique characteristics of your CAT. The TAIL dictates how tokens are minted or melted (destroyed and converted back to XCH).2

Supply rules are defined in your TAIL Chialisp program, which is curried into the CAT puzzle. The TAIL only runs when special “magic” issuance or melt conditions are present, so normal transfers do not need to run the TAIL.2 This makes regular CAT transactions faster and cheaper.

The magic condition that triggers the TAIL looks like this: a CREATE_COIN condition with -113 as the amount.2 When the CAT layer sees this magic value of -113, it filters it, takes note of the tail reveal and solution, and runs your TAIL program to verify the issuance or melting rules.

Standard TAIL Design Patterns

Chia provides two standard TAIL designs that cover most token use cases. Understanding these patterns helps you choose the right approach for your project.3

Single-Issuance TAILs

A single-issuance TAIL creates a fixed supply of tokens that can only be minted once. This TAIL uses the genesis_by_coin_id pattern, which ties the token creation to a specific XCH coin.3 Since coins can only be spent once on Chia’s blockchain, the CAT can only mint tokens once.

Single-issuance CATs provide a guaranteed fixed supply. They are perfect for projects that need provable scarcity, like collectible tokens or limited edition digital assets. The creator cannot mint more tokens later, giving holders confidence in the total supply.5

These CATs cannot be melted back into XCH.3 Once created, they exist as CATs permanently unless explicitly programmed otherwise in the TAIL. This immutability makes them suitable for use cases where token permanence matters.

Multi-Issuance TAILs

A multi-issuance TAIL allows the creator to mint more tokens at any time using a specific secret key or signature.3 This pattern uses a delegated_tail, which is much more flexible than the single-issuance version.

The delegated TAIL lets you sign a puzzle hash that you specify, allowing you to issue new tokens using whatever TAIL you want.5 You maintain control over the issuance process as long as you keep your secret key secure. This flexibility supports projects with growing token needs.

Multi-issuance CATs can be melted with a custom spend bundle.3 The creator can remove tokens from circulation if backing funds are reduced (for stablecoins) or if tokens are exchanged for something of value (for redemption tokens).2 This melting capability provides essential flexibility for many real-world use cases.

Standard TAIL patterns include single-issuance (fixed supply, no melt), multi-issuance (mint more with a key), and delegated TAILs where the creator can delegate evolving rules.2 All these patterns enforce how much can be minted or melted through Chialisp logic that runs on-chain.

Minting Your First CAT Step-by-Step

Creating your first CAT involves several steps using the CAT Admin Tool. This hands-on process teaches you the practical side of token creation on Chia.3

Start by installing the CAT Admin Tool from GitHub. Clone the repository and set up a Python virtual environment. Install the required dependencies using pip.3 The tool provides reference TAILs for both single-issuance and multi-issuance patterns.

Decide how many tokens you want to create. Remember that creating a single token takes 1,000 mojos.3 If you want one million tokens, you need one billion mojos (which is 0.001 XCH). This mojo-to-CAT ratio ensures every token has physical value on the blockchain.

For a single-issuance CAT, use the genesis_by_coin_id TAIL. First, run the cats command with the –select-coin flag to choose a coin from your wallet. The output shows you the coin ID. Then run the same command again with the –curry flag and your coin ID prefaced with 0x.3 This creates your tokens with a guaranteed fixed supply.

For a multi-issuance CAT, use the delegated_tail. You need your master public key from your wallet. Run the cats command with your public key curried into the TAIL.3 This setup lets you mint more tokens later by signing with your secret key.

After minting, you receive an Asset ID. This unique identifier is the hash of your TAIL program.2 Wallets use this Asset ID to recognize and track your specific token balance. Add your new CAT to your wallet using the Asset ID so you can see your balance.

The minting process pushes your transaction to the blockchain. Once confirmed, your new CAT coins exist on-chain with all the rules defined by your TAIL. You can now send these tokens to other addresses, create offers to trade them, or use them in any way that follows your TAIL’s logic.3

CATs vs ERC-20 vs SPL Tokens

Understanding how CATs compare to other token standards helps you appreciate their unique design. Each standard reflects different blockchain architectures and design philosophies.8,9

ERC-20 tokens on Ethereum use smart contracts that maintain a mapping of addresses to balances. Every new token holder costs 32 bytes of storage.8 Creating an ERC-20 token means writing Solidity code, customizing functions like mint and burn, and paying gas to store that code on-chain. Large airdrops can be expensive since each new storage slot costs substantial gas.

SPL tokens on Solana follow a unified standard where you call the existing Token Program to initialize a Mint account rather than deploying new code.9 Solana’s parallelized runtime enables near-instant transactions with fees typically below one cent. SPL tokens work well for gaming, real-time apps, and high-frequency use cases where speed matters most.

CATs take a different approach. Instead of account balances, CATs use Chia’s coin set model where each coin contains its own logic.2 The CAT2 standard wraps user spending logic with supply enforcement logic. This architecture gives token holders complete control – creators cannot freeze funds or implement backdoors like some ERC-20 tokens allow.5

Transaction speed varies significantly. Ethereum confirms blocks every 12 seconds under its Proof of Stake consensus mechanism, maintaining consistent timing even during network congestion.8 Solana processes transactions in roughly 400 milliseconds with practical throughput of 1,500-4,000 transactions per second, though the network’s theoretical maximum reaches 65,000 TPS.9 Chia targets an average of 18.75 seconds per block (32 blocks per 600-second sub-slot), adjusted dynamically through its Proof of Space and Time consensus mechanism.

Cost structures differ too. Ethereum’s ERC-20 tokens have the highest fees, often ranging from dollars to hundreds of dollars during network congestion.8 Solana’s SPL tokens cost fractions of a cent per transaction.9 Chia’s CAT transactions typically cost less than a cent, with fees primarily dependent on transaction complexity rather than network congestion.

The choice between standards depends on your project needs. Ethereum’s ERC-20 offers the most mature ecosystem with the deepest liquidity and widest exchange support. Solana’s SPL provides unmatched speed for consumer applications. Chia’s CAT2 offers unique ownership guarantees and energy-efficient security for infrastructure operators and institutions.8,9

Real-World CAT Use Cases

CATs power various real-world applications on the Chia blockchain. These examples show how the token standard supports different use cases.

Stably USD (USDS) was Chia’s first stablecoin, backed one-to-one with US dollars.1 The token used a multi-issuance TAIL allowing Stably to mint tokens when users deposited dollars and melt tokens when users redeemed them. This use case demonstrates how CATs support regulated financial assets with compliance requirements.

The stablecoin model requires careful TAIL design. The issuer needs the ability to mint new tokens as demand grows and melt tokens when backing is reduced.2 However, the issuer cannot freeze or confiscate user funds – only token holders can initiate melting by following the TAIL’s redemption logic.5

Spacebucks (SBX) serves as Chia’s first meme token.1 Using a single-issuance TAIL, Spacebucks has a fixed supply with no ability for the creator to mint more tokens. This guarantees scarcity and prevents inflation, making it suitable for community-driven projects where trust in the supply cap matters.

Marmot Coin (MRMT) demonstrates creative distribution mechanics. The token was distributed based on “Proof of Marmot” – donating to the Marmot Recovery Fund or donating a Marmot toy to children’s charities.1 This use case shows how TAILs can enforce custom rules beyond simple minting and melting.

Carbon credit tokenization represents an emerging enterprise use case. The World Bank’s Climate Warehouse program, in partnership with the International Emissions Trading Association and the Government of Singapore, established the Climate Action Data Trust (CAD Trust) on Chia’s blockchain infrastructure. This enables tokenization and transparent retirement tracking of carbon credits.10

The CAD Trust integration demonstrates how CATs can support environmental finance applications. Carbon credits need verifiable creation, transparent trading, and permanent retirement tracking. The CAT standard’s composable design (outer CAT plus inner puzzle plus TAIL) handles these requirements while preserving the credits’ integrity.

Revocable CATs introduce a new standard for real-world assets. This emerging pattern adds a revocation layer that allows issuing entities to reclaim custody when needed for security or regulatory reasons.7 Asset-backed stablecoins like Circle USD and tokenized securities benefit from this revocation capability while maintaining the CAT2 foundation.

“CATs are an artifact that are actually built on top of XCH. It’s a separate type of asset altogether.”
— Paul Hainsworth, Former Chief Product Officer at Chia Network4

Conclusion

Chialisp CATs represent a unique approach to fungible tokens on blockchain infrastructure. The three-layer design – outer CAT puzzle, inner ownership puzzle, and TAIL program – creates a flexible system that balances creator control with holder security.2 You have learned how CATs use the coin set model instead of account balances, giving you true ownership of your tokens. The standard TAIL patterns provide proven solutions for fixed-supply and flexible-supply tokens.3 Minting your first CAT requires understanding mojos, choosing the right TAIL, and using the CAT Admin Tool properly. When compared to ERC-20 and SPL tokens, CATs offer distinct advantages in ownership guarantees and composability.8,9 Real-world use cases from stablecoins to carbon credits demonstrate the standard’s practical utility for crypto miners and blockchain infrastructure operators building the next generation of decentralized applications.1,10

Chialisp CATs Design FAQs

What is the difference between CAT1 and CAT2?

CAT2 is the upgraded token standard that replaced CAT1 at block height 2,311,760 (July 26, 2022) after a security audit by Trail of Bits discovered vulnerabilities.1,4 CAT1 reached end-of-life, and all original issuers reissued their tokens on the CAT2 standard to patch the security issues.

How does chialisp cats design prevent token supply inflation?

The chialisp cats design uses an outer CAT puzzle that enforces supply conservation through a ring of coins and lineage proofs.2 The puzzle tracks subtotals ensuring net delta zero across spends, so total supply remains constant unless the TAIL program explicitly permits minting through the magic -113 condition.

Can CAT creators freeze or confiscate my tokens?

No, CAT creators cannot freeze or confiscate your tokens without your permission.5 Only the CAT owner can run the TAIL program because the owner controls the coin’s spend. This differs from some ERC-20 implementations where creators can include freeze functions in their smart contracts.

Why does every CAT equal 1,000 mojos?

The 1,000 mojo-per-CAT ratio ensures every token has a minimum physical value on the blockchain and enables precise accounting.3 This design decision provides a melt value baseline and standardizes token creation across all CATs on Chia’s network.

What happens to chialisp cats design when coins are spent?

When a CAT coin is spent, the inner puzzle creates conditions for new coins, and the CAT layer automatically wraps each new puzzle hash with the same TAIL.2 This wrapping ensures outputs remain CATs of the same type instead of melting back to XCH, maintaining the token’s identity through all transactions.

Chialisp CATs Design Citations

  1. Chia Documentation: CAT2 Intro and FAQ – https://docs.chia.net/guides/cat2-intro/
  2. Chialisp.com: CATs Primitive Documentation – https://chialisp.com/cats/
  3. Chia Network: CAT Creation Tutorial – https://docs.chia.net/guides/cat-creation-tutorial/
  4. CoinDesk: Chia Network Reissues Its Asset Token to Address Security Vulnerability – https://www.coindesk.com/business/2022/07/25/chia-network-reissues-its-asset-token-to-address-security-vulnerability
  5. Chia Network Blog: The CAT’s Out Of The Bag – https://www.chia.net/2021/11/15/the-cats-out-of-the-bag-chia-releases-the-cat1-standard/
  6. Chia Network: Upgrading the CAT Standard – https://www.chia.net/2022/07/25/upgrading-the-cat-standard/
  7. GitHub: Chia CHIP-0038 Revocable CATs – https://github.com/Chia-Network/chips/blob/bb897ef6f3ed17958c70128d0896de766690d24d/CHIPs/chip-0038.md
  8. Bitquery: ERC vs SPL Token Standards – https://bitquery.io/blog/erc-vs-spl
  9. Solana Developer Documentation: ERC20 on Solana – https://solana.com/developers/evm-to-svm/erc20
  10. Chia Network: From Carbon Market to One Market – https://www.chia.net/2024/08/28/from-carbon-market-to-one-market-2/