Урок 1

Deep Dive into Tokenization on Tezos

Welcome to the second course in our series on Tezos development! In the first course, we navigated through the basics of Tezos, its native language, SmartPy, and how to deploy your first smart contract. Now, we're ready to venture further into the world of tokenization on Tezos.

The Concept of Tokens

In the realm of blockchain, the term “token” denotes a type of digital asset. Tokens can represent a plethora of assets or utilities within a particular ecosystem, ranging from native currencies of a blockchain to ownership rights in a digital or physical asset.

Fungible Tokens

Fungible tokens are interchangeable with each other. Consider them as identical items in a blockchain network, each having the same value. This feature closely aligns with traditional currencies where every unit holds an identical value to any other unit. Cryptocurrencies like Bitcoin (BTC), Ether (ETH), and even Tezos (XTZ) are all examples of fungible tokens. You can freely exchange one Bitcoin for another without any loss of value or difference in utility.

Semi-Fungible Tokens

Semi-Fungible tokens are a hybrid, offering the best of both fungible and non-fungible tokens. They’re fungible within their class (like tickets for a specific concert) but non-fungible when compared across classes (a concert ticket is not interchangeable with a football match ticket). They provide the flexibility needed in many real-world scenarios, like ticketing and certain types of games.

Non-Fungible Tokens

Non-Fungible Tokens (NFTs), on the other hand, represent unique assets. Unlike fungible tokens, NFTs are distinguishable from each other, with each token holding a unique value. They’re akin to collectibles, where each item has a unique characteristic, and hence, non-replaceable. This uniqueness has led to the rise of NFTs in areas like digital art, music, and virtual real estate, where each piece, song, or property is unique and holds individual significance. Read more: What are NFTs?

Token Standards in Tezos

In the Tezos blockchain platform, tokens standards are primarily classified into three categories: FA1, FA1.2, and FA2. These standards are part of the Tezos Interoperability Proposal (TZIP) documents here.

Tezos Interoperability Proposals (TZIPs)
TZIP (pronounced "tee-zip") stands for Tezos Interoperability Proposal, which are explanations of how the Tezos blockchain can be enhanced with new and modern standards and ideas, such smart contract requirements.

FA1 (TZIP 5 Abstract Ledger)

FA1 was the initial Tezos token standard, essentially serving as a minimal version of a ledger. It aimed to map identities to balances, providing a mechanism for interacting with fungible assets for contract developers, libraries, client tools, and others. However, there is no mandatory inheritance among Tezos token standards, and as such, all subsequent standards don’t need to maintain compatibility with FA1. This standard has since been deprecated.

FA1.2 (TZIP 7 Approvable Ledger)

The FA1.2 standard combines elements of the FA1 standard and the EIP-20 standard utilized in Ethereum. Its defining feature is the ability to approve the spending of tokens from other accounts, though it exclusively applies to fungible tokens. When implementing a token using the FA1.2 standard, you need to include the following entry points in its interface:

  • transfer (from, to, value)
  • approve (spender, value)
  • getAllowance (owner, spender)
  • getBalance (owner)
  • getTotalSupply

While the FA1.2 standard does not restrict developers from incorporating additional functionalities into the token contract. For instance, the SmartPy template of FA1.2 includes supplementary entry points for activities such as minting and burning tokens, and governance management.

FA2 (TZIP 12 Multi-Asset Interface)

The FA2 standard, the most recent Tezos token standard, provides more flexibility and supports multiple types of assets, accommodating both fungible and non-fungible tokens. It’s crucial to understand that FA2 is not a direct successor to FA1.2, given the following distinctions:

  • Unlike FA1.2, FA2 accommodates multiple asset types, including fungible and non-fungible tokens, mirroring the capability of Ethereum’s EIP-1155 multi-token standard.
  • FA2 handles token transfer permissions differently from FA1.2. In FA2, permissions can be granted using the update_operators entry point. According to the FA2 specification, an operator is an address that can initiate transactions on behalf of the owner of the tokens.
    The interface of the FA2 standard includes the following necessary entry points:
  • transfer (transfer_list)
  • balance_of (requests, callback)
  • update_operators (operator_updates)
  • getBalance (owner, token_id)
  • total_supply (token_id)
  • all_tokens

Now that we’ve delved deeper into these Tezos token standards, we are ready to move on to the practical part of the course. As the FA1 standard is already obsolete, we will center our focus on the FA1.2 and FA2 standards moving forward. In the next lessons, we will learn how to write a smart contract that can interact with both FA1.2 and FA2 standards.

What’s Next?

In this course, we’ll primarily focus on the FA1.2 token standard. We will guide you through the creation of an FA1.2 token contract, allowing you to mint your token, add administrative controls, and extend the contract with custom functionalities.

As we proceed, we will delve into the specifics of the FA1.2 contract and expand it with minting, burning, pausing, and other features. By the end of this course, you’ll have a comprehensive understanding of the process and mechanics behind creating a fungible token on the Tezos blockchain.

Keep in mind, tokenization on Tezos and, indeed, blockchain as a whole can seem challenging at first. But with time and practice, you’ll start to unravel the intricacies and see the potential in these digital assets. So, let’s buckle up and delve deeper into the fascinating world of tokenization on Tezos!

As we did for the first course, we are going to use SmartPy and below here you can find a quick intro on it and how it works!

SmartPy: Smart Contract Language for Tezos

To create smart contracts on Tezos, we use a language called SmartPy. SmartPy is a Python library to develop smart contracts for the Tezos blockchain. It is an intuitive and effective language for expressing contracts and their associated test scenarios.

The most notable feature of SmartPy is its integration with Python, which is one of the world’s most popular and fastest-growing programming languages. If you’re already familiar with Python, you will find SmartPy quite easy to pick up.

Getting Started with SmartPy and Your First Contract

Accessing the SmartPy IDE

SmartPy includes a full-featured Integrated Development Environment (IDE) accessible from your web browser. Go to the SmartPy IDE to start writing your first smart contract.

Отказ от ответственности
* Криптоинвестирование сопряжено со значительными рисками. Будьте осторожны. Курс не является инвестиционным советом.
* Курс создан автором, который присоединился к Gate Learn. Мнение автора может не совпадать с мнением Gate Learn.
Каталог
Урок 1

Deep Dive into Tokenization on Tezos

Welcome to the second course in our series on Tezos development! In the first course, we navigated through the basics of Tezos, its native language, SmartPy, and how to deploy your first smart contract. Now, we're ready to venture further into the world of tokenization on Tezos.

The Concept of Tokens

In the realm of blockchain, the term “token” denotes a type of digital asset. Tokens can represent a plethora of assets or utilities within a particular ecosystem, ranging from native currencies of a blockchain to ownership rights in a digital or physical asset.

Fungible Tokens

Fungible tokens are interchangeable with each other. Consider them as identical items in a blockchain network, each having the same value. This feature closely aligns with traditional currencies where every unit holds an identical value to any other unit. Cryptocurrencies like Bitcoin (BTC), Ether (ETH), and even Tezos (XTZ) are all examples of fungible tokens. You can freely exchange one Bitcoin for another without any loss of value or difference in utility.

Semi-Fungible Tokens

Semi-Fungible tokens are a hybrid, offering the best of both fungible and non-fungible tokens. They’re fungible within their class (like tickets for a specific concert) but non-fungible when compared across classes (a concert ticket is not interchangeable with a football match ticket). They provide the flexibility needed in many real-world scenarios, like ticketing and certain types of games.

Non-Fungible Tokens

Non-Fungible Tokens (NFTs), on the other hand, represent unique assets. Unlike fungible tokens, NFTs are distinguishable from each other, with each token holding a unique value. They’re akin to collectibles, where each item has a unique characteristic, and hence, non-replaceable. This uniqueness has led to the rise of NFTs in areas like digital art, music, and virtual real estate, where each piece, song, or property is unique and holds individual significance. Read more: What are NFTs?

Token Standards in Tezos

In the Tezos blockchain platform, tokens standards are primarily classified into three categories: FA1, FA1.2, and FA2. These standards are part of the Tezos Interoperability Proposal (TZIP) documents here.

Tezos Interoperability Proposals (TZIPs)
TZIP (pronounced "tee-zip") stands for Tezos Interoperability Proposal, which are explanations of how the Tezos blockchain can be enhanced with new and modern standards and ideas, such smart contract requirements.

FA1 (TZIP 5 Abstract Ledger)

FA1 was the initial Tezos token standard, essentially serving as a minimal version of a ledger. It aimed to map identities to balances, providing a mechanism for interacting with fungible assets for contract developers, libraries, client tools, and others. However, there is no mandatory inheritance among Tezos token standards, and as such, all subsequent standards don’t need to maintain compatibility with FA1. This standard has since been deprecated.

FA1.2 (TZIP 7 Approvable Ledger)

The FA1.2 standard combines elements of the FA1 standard and the EIP-20 standard utilized in Ethereum. Its defining feature is the ability to approve the spending of tokens from other accounts, though it exclusively applies to fungible tokens. When implementing a token using the FA1.2 standard, you need to include the following entry points in its interface:

  • transfer (from, to, value)
  • approve (spender, value)
  • getAllowance (owner, spender)
  • getBalance (owner)
  • getTotalSupply

While the FA1.2 standard does not restrict developers from incorporating additional functionalities into the token contract. For instance, the SmartPy template of FA1.2 includes supplementary entry points for activities such as minting and burning tokens, and governance management.

FA2 (TZIP 12 Multi-Asset Interface)

The FA2 standard, the most recent Tezos token standard, provides more flexibility and supports multiple types of assets, accommodating both fungible and non-fungible tokens. It’s crucial to understand that FA2 is not a direct successor to FA1.2, given the following distinctions:

  • Unlike FA1.2, FA2 accommodates multiple asset types, including fungible and non-fungible tokens, mirroring the capability of Ethereum’s EIP-1155 multi-token standard.
  • FA2 handles token transfer permissions differently from FA1.2. In FA2, permissions can be granted using the update_operators entry point. According to the FA2 specification, an operator is an address that can initiate transactions on behalf of the owner of the tokens.
    The interface of the FA2 standard includes the following necessary entry points:
  • transfer (transfer_list)
  • balance_of (requests, callback)
  • update_operators (operator_updates)
  • getBalance (owner, token_id)
  • total_supply (token_id)
  • all_tokens

Now that we’ve delved deeper into these Tezos token standards, we are ready to move on to the practical part of the course. As the FA1 standard is already obsolete, we will center our focus on the FA1.2 and FA2 standards moving forward. In the next lessons, we will learn how to write a smart contract that can interact with both FA1.2 and FA2 standards.

What’s Next?

In this course, we’ll primarily focus on the FA1.2 token standard. We will guide you through the creation of an FA1.2 token contract, allowing you to mint your token, add administrative controls, and extend the contract with custom functionalities.

As we proceed, we will delve into the specifics of the FA1.2 contract and expand it with minting, burning, pausing, and other features. By the end of this course, you’ll have a comprehensive understanding of the process and mechanics behind creating a fungible token on the Tezos blockchain.

Keep in mind, tokenization on Tezos and, indeed, blockchain as a whole can seem challenging at first. But with time and practice, you’ll start to unravel the intricacies and see the potential in these digital assets. So, let’s buckle up and delve deeper into the fascinating world of tokenization on Tezos!

As we did for the first course, we are going to use SmartPy and below here you can find a quick intro on it and how it works!

SmartPy: Smart Contract Language for Tezos

To create smart contracts on Tezos, we use a language called SmartPy. SmartPy is a Python library to develop smart contracts for the Tezos blockchain. It is an intuitive and effective language for expressing contracts and their associated test scenarios.

The most notable feature of SmartPy is its integration with Python, which is one of the world’s most popular and fastest-growing programming languages. If you’re already familiar with Python, you will find SmartPy quite easy to pick up.

Getting Started with SmartPy and Your First Contract

Accessing the SmartPy IDE

SmartPy includes a full-featured Integrated Development Environment (IDE) accessible from your web browser. Go to the SmartPy IDE to start writing your first smart contract.

Отказ от ответственности
* Криптоинвестирование сопряжено со значительными рисками. Будьте осторожны. Курс не является инвестиционным советом.
* Курс создан автором, который присоединился к Gate Learn. Мнение автора может не совпадать с мнением Gate Learn.