📢 Gate Square #MBG Posting Challenge# is Live— Post for MBG Rewards!
Want a share of 1,000 MBG? Get involved now—show your insights and real participation to become an MBG promoter!
💰 20 top posts will each win 50 MBG!
How to Participate:
1️⃣ Research the MBG project
Share your in-depth views on MBG’s fundamentals, community governance, development goals, and tokenomics, etc.
2️⃣ Join and share your real experience
Take part in MBG activities (CandyDrop, Launchpool, or spot trading), and post your screenshots, earnings, or step-by-step tutorials. Content can include profits, beginner-friendl
CAT20 protocol: a breakthrough development of BTC ecosystem smart contracts
New Developments of Smart Contracts on BTC: In-depth Analysis of CAT20 Token Protocol
Recently, the Bitcoin ecosystem has welcomed an important development. After multiple rounds of testnet verification, Fractal BTC has officially launched on the mainnet in September. One of the highlights of Fractal is its capability of smart contracts, and at the time of its mainnet launch, it introduced a new token protocol CAT20. This article will delve into the ingenious design of CAT20 at the technical level and the insights it brings.
Fractal Bitcoin Introduction
Before diving into CAT20, we need to first understand its underlying platform, Fractal Bitcoin. Fractal Bitcoin, also known as 分形比特币, is a fully compatible second layer network with BTC. Compared to BTC, its block confirmation time is faster, taking only 1 minute. The basic principle is to replicate the BTC network multiple times, where each chain can process transactions, thereby increasing the overall processing speed.
A key feature of Fractal is the re-enabling of the OP_CAT opcode that was abandoned early in BTC for security reasons. This move greatly enhances the functionality of Fractal Bitcoin, equipping it with smart contracts capabilities and opening up vast space for future development.
Overview of CAT20 protocol
With the underlying support of OP_CAT, the CAT20 protocol has emerged. Currently, this protocol is running in a real environment and has added corresponding display panels on certain block explorers.
CAT20 is designed with the concepts of ERC20 in mind, but it also has its unique features. For example, CAT20 allows for setting a pre-mined amount and a cap on the number of coins minted each time, (Mint), which in ERC20 typically requires additional contract logic to implement.
The Lifecycle of CAT20
Deploy(
The deployment process of CAT20 is divided into two phases: "commit" and "reveal:"
Commit phase: Write the basic information of the Token, such as name, symbol, etc., in the transaction output script. The transaction hash generated in this phase will serve as the unique identifier for the Token.
Reveal Stage: Generate an OP_RETURN output containing the hash of the initial state of CAT20, as well as a Minter output for the subsequent minting process.
This two-step deployment method is a common practice in blockchain projects and helps protect certain key information of the project.
![Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin])https://img-cdn.gateio.im/webp-social/moments-c4ee2f9b3915fce9662f89bddd9ec195.webp(
) Mint ###
The main features of the minting process include:
It is worth noting that Minter's quantity management strategy has a significant impact on the minting activities of the entire network. To avoid minting congestion, it is generally recommended to output multiple Minters at a time. However, for economic reasons, users may tend to refrain from outputting new Minters, which requires some users to voluntarily bear additional costs to maintain network vitality.
( Transfer )
Transfer transactions need to ensure that the input and output Token quantities remain consistent. A single transaction can include transfers of multiple different Tokens, as long as their respective input and output quantities are balanced.
![Technical Interpretation of CAT20: A New Token Protocol on Fractal Bitcoin]###https://img-cdn.gateio.im/webp-social/moments-cbca62f8d46cd64c04aa94b61d0bde93.webp(
) Burn (
To destroy a token, simply transfer it to a regular address.
![Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin])https://img-cdn.gateio.im/webp-social/moments-e327f5fb8fe3f8d0f8762ee1d421a2d6.webp###
Technical Highlights
Flexible trading construction: All operations are autonomously constructed by the user, providing great flexibility. This also requires that the contract part needs strict verification logic to ensure safety.
Efficient Querying:
State Management: CAT20 uses OP_RETURN and smart contracts (Minter and Token ) to store and manage state information, achieving efficient state tracking and updates.
Summary
The CAT20 protocol demonstrates innovative attempts within the Bitcoin ecosystem in the field of smart contracts. Through clever design, it achieves functionality similar to ERC20 on the Bitcoin network while maintaining the characteristics of Bitcoin. This provides new ideas for the expansion of the Bitcoin ecosystem and brings more possibilities for developers and users. As technology continues to improve, we can expect to see more innovative applications based on CAT20.