New Breakthrough in BTC Ecosystem: Fractal Bitcoin Launches CAT20 smart contracts protocol

robot
Abstract generation in progress

The BTC ecosystem welcomes a new breakthrough in smart contracts

The Bitcoin ecosystem has recently welcomed an important development. After multiple rounds of testnet validation, Fractal BTC officially launched its mainnet in September. One of the highlights of this new system is its smart contracts capability, and at the launch of the mainnet, a new token protocol called CAT20 was introduced. So what are the clever aspects of CAT20's technical design? What insights can we gain from it?

Technical Perspective on CAT20: A New Token Protocol on Fractal Bitcoin

Fractal Bitcoin Introduction

Before diving into CAT20, we need to briefly understand Fractal Bitcoin. The relationship between the two is similar to that of ERC20 and ETH; the CAT20 protocol is deployed on Fractal Bitcoin.

Fractal Bitcoin, also known as fractal BTC, is a "Layer 2" network that is fully compatible with BTC. Compared to BTC, it has a faster block confirmation speed, taking only 1 minute. Its basic principle, as the name suggests, is to replicate the BTC network multiple times, with each chain capable of processing transactions, thereby increasing the number of nodes that can handle transactions to enhance speed. However, specific details on how different chains communicate are currently unclear, and the official has not provided relevant technical documentation.

Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin

One important feature of Fractal is the re-enablement of the OP_CAT opcode, which was abandoned in the early days of BTC for security reasons. This re-enablement greatly enhances the functionality of Fractal Bitcoin, and there are views that OP_CAT can grant BTC smart contracts capabilities, opening up more possibilities for future development.

Currently, developers have implemented a protocol similar to ERC20 on Fractal Bitcoin.

Overview of CAT Protocol

With the underlying support of OP_CAT, the corresponding protocol was quickly introduced, namely the CAT Protocol. The CAT20 protocol is already in operation, and a trading platform has also added the corresponding functional panel.

The name CAT20 evokes thoughts of ERC20, and indeed, there are similarities between the two. How does CAT20 achieve a similar token lifecycle compared to the mature ERC20 protocol?

Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin

deployment process

Before deployment, users need to specify the wallet address and basic information of the token. Similar to ERC20, the token information includes name, symbol, etc. The difference is that CAT20 allows setting the pre-mined quantity and the limit on the quantity minted each time.

The deployment is divided into two phases: "commit" and "reveal". In the commit phase, the basic information of the token is written into the transaction output script. The hashId of the transaction in this phase serves as the token identifier, used to distinguish it from other tokens.

In the reveal phase, there will be two UTXO inputs corresponding to the first two outputs of the commit phase. This transaction first outputs an OP_RETURN to save the hash of the initial state of the CAT20. It then outputs a Minter to maintain state changes during the subsequent minting process.

The entire deployment process uses the common commit-reveal two-step on the blockchain, which is a typical project deployment method.

Technical Perspective on CAT20: A New Token Protocol on Fractal Bitcoin

minting mechanism

The minting process has the following characteristics:

  • The input is a minter, initially generated during the deployment phase.
  • Each minting has only one minter as input, but can have multiple minters as output.
  • Each minting generates a token
  • The output order requires minter before token.

This design makes the minting process interesting. For example, each minting can output multiple minters, increasing the number of available minters and avoiding congestion in minting. However, considering economic factors, more people may tend to not output new minters, which requires some users to voluntarily pay more to maintain the system's operation.

In version V2, two Minter with similar states are generated by default.

Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin

transaction construction

There are several noteworthy technical details in the trading construction of CAT20:

  1. reveal UTXO: By cleverly rewriting the script logic, achieve the control of UTXO at different addresses using the same private key.

  2. minter UTXO: It is speculated that the smart contracts functionality is implemented using OP_CAT, allowing everyone to use these UTXOs as inputs.

Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin

state management (V2)

The minter retains state information, stored in OP_RETURN and smart contracts. OP_RETURN stores the Hash of the current transaction output state, while the contract stores the remaining minting count. After each minting, the newly generated minting quantity of Minter is half of the remaining mintage.

The CAT20 token itself is also a smart contract, containing two basic states: quantity and owner's address. Unlike BRC20 or inscriptions, CAT20 does not directly exist on the UTXO of the user's address.

Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin

transfer and burn

When transferring, the input and output amounts of each token in the same transaction must remain consistent. To burn a token, simply transfer it to a regular address.

Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin

Summary

The design of CAT20 provides users with great flexibility, but also places higher demands on contract verification logic. This design brings several advantages:

  1. To check the token holding status, simply inspect the token's UTXO without needing to trace back.
  2. By searching for transactions containing "cat" in OP_RETURN, you can easily view the current minting status.

The innovation of CAT20 brings new possibilities to the Bitcoin ecosystem, and it is worth our continued attention to its development and application prospects.

Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 7
  • Share
Comment
0/400
WuDivip
· 6h ago
Bitcoin ecosystem amazing class
View OriginalReply0
WuDivip
· 6h ago
Hurry up and enter a position!🚗
View OriginalReply0
FromMinerToFarmervip
· 6h ago
Mining Rekt changed to suckers
View OriginalReply0
ThatsNotARugPullvip
· 6h ago
New tricks again~ Uh-huh
View OriginalReply0
LiquidityNinjavip
· 6h ago
A hint of ERC influence
View OriginalReply0
AirdropworkerZhangvip
· 6h ago
Let's go, it's just a scamcoin with a different skin.
View OriginalReply0
failed_dev_successful_apevip
· 6h ago
cat Ah, another shib clone.
View OriginalReply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)