Fractal Bitcoin and CAT20 protocol: New breakthroughs in BTC ecosystem smart contracts

robot
Abstract generation in progress

Smart Contracts on BTC: Analyzing Fractal Bitcoin and CAT20 Protocol

Recently, the Bitcoin ecosystem has welcomed a significant advancement. After multiple rounds of testnet validation, Fractal BTC officially launched its mainnet in September. One of the highlights of Fractal is its smart contracts functionality, and it introduced the new token protocol CAT20 upon the launch of the mainnet. This article will delve into the technical design of CAT20 and its potential impact.

Technical Perspective on CAT20: New Token Protocol on Fractal Bitcoin

Fractal Bitcoin Introduction

Before discussing CAT20, we need to understand its operating environment, Fractal Bitcoin. Fractal Bitcoin, also known as 分形比特币, is a layer 2 network that is fully compatible with BTC. Compared to BTC, it has a shorter block confirmation time, taking only 1 minute. Its basic principle is to replicate multiple BTC networks, with each chain able to process transactions, thereby increasing the overall processing speed.

One of the major innovations of Fractal is the enabling of the OP_CAT opcode, which was abandoned in the early days of BTC for security reasons. This move greatly enhances the functionality of Fractal Bitcoin, giving it smart contract capabilities and providing a broad space for future application development.

Technical Interpretation of CAT20: A New Token Protocol on Fractal Bitcoin

CAT20 Protocol Analysis

deployment process

The deployment process of the CAT20 protocol is divided into two stages: "commit" and "reveal":.

  1. Commit phase:

    • Write the basic information of the token (such as name, symbol, etc.) into the transaction output script
    • The generated transaction hash ID serves as the unique identifier for the token.
  2. Reveal Stage:

    • Output an OP_RETURN to save the hash of the initial state of CAT20
    • Output a Minter for the subsequent minting process.

This two-stage deployment method helps to protect sensitive project information until it is fully disclosed in the reveal stage.

Technical Perspective on CAT20: New Token Protocol on Fractal Bitcoin

minting mechanism

The minting process of CAT20 has several key features:

  • Each minting transaction has only one minter as input.
  • Multiple minters can be output, but it may also be zero.
  • Each minting produces a token
  • The output order is fixed: token must follow minter

The design of the minting process affects the dynamic balance of the entire network. Outputting more minters can increase network liquidity, but it also means higher transaction costs. The CAT20 V2 version defaults to generating two minters with similar states to balance this contradiction.

Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin

technical details of transaction construction

The CAT20 protocol achieves control over non-user address UTXOs through clever script design:

  • In the reveal phase, by adjusting the public key generation algorithm, the same private key can control the UTXO of different addresses.
  • The Minter stage utilizes the smart contracts capability of OP_CAT, allowing anyone to use these UTXOs as inputs.

Technical Interpretation of CAT20: A New Token Protocol on Fractal Bitcoin

state management

The CAT20 V2 version has made innovations in trade status management:

  • Status information is stored in OP_RETURN and smart contracts.
  • The Minter contract records the remaining minting times.
  • After each minting, the minting quota for the new Minter is half of the remaining total.

This design ensures the fairness and predictability of the minting process.

Technical Interpretation of CAT20: New Token Protocol on Fractal Bitcoin

transfer and destroy

  • When transferring, the number of tokens for transaction input and output must be 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 the CAT20 protocol fully leverages the smart contracts capabilities of Fractal Bitcoin, providing users with flexible operational space. This design brings several obvious advantages:

  1. Simplify the query process for token holdings
  2. Easy to monitor the current minting status

However, this flexibility also requires strict verification logic at the contract level to prevent potential vulnerabilities. As more developers participate and review, the CAT20 protocol is expected to continuously improve in security and functionality, bringing new vitality to the Bitcoin ecosystem.

Technical Interpretation of CAT20: A New Token Protocol on Fractal Bitcoin

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
  • 6
  • Share
Comment
0/400
GateUser-3588bf00vip
· 4h ago
The means have expired! No matter how good the story is, it’s useless!!!
View OriginalReply0
HypotheticalLiquidatorvip
· 19h ago
Be aware of the risk of vulnerability reproduction and participate in the public testing period with caution.
View OriginalReply0
BlindBoxVictimvip
· 19h ago
Another altcoin is here to play people for suckers...
View OriginalReply0
SchrodingerWalletvip
· 19h ago
Is there another new gimmick to Be Played for Suckers?
View OriginalReply0
FarmHoppervip
· 20h ago
The crypto world also plays this trap, what's going on?
View OriginalReply0
SundayDegenvip
· 20h ago
BTC can be played like this, bull!
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)