diff --git a/Chapter 1/Lesson 5.md b/Chapter 1/Lesson 5.md index 60f0bcf..a4337a7 100644 --- a/Chapter 1/Lesson 5.md +++ b/Chapter 1/Lesson 5.md @@ -1,34 +1,63 @@ -# Chapter 1, lesson 5 -## Tokens +# Tokens -Important aspects of the TON platform is that it allows you to create custom types of assets. This means not only custom currencies, but all sorts of things of value that can be transferred and transformed and passed around not as applications but as things of value. Collectively they are called tokens. And this is a technical term, that means a lot of things. Basically, everything of value is token, splitting the value of certain systems into transferable chunks is referred as *tokenization*. +###### tags: `Chapter 1` -### Fungible vs non-fungible token -What types of tokens could we imagine? First of all, there's a well-known division into **fungible** and **non-fungible** tokens or NFT's. -First of all, the main difference is that non-fungible tokens are unique. They have a property called owner, but they cannot be sliced down into equally interchangeable parts. So unique tokens are *collectibles*. Examples: -* Tickets -* TON DNS records -* Usernames -* Financial contracts -* Subscription system money collecting object +In this lesson, we will talk about tokens. -By being a token, it permits its owner to change the owner, rotate the keys, and sell the business. +> :tada: An important aspect of TON platform is that you can create your own custom assets! -As for fungible tokens, they are those which don't have just the owner, they do have a counter and number of items. The obvious example of such are currencies. They are: -* Stable coins -* Cryptocurrencies -* Monopoly money +*This means really all sorts of things of value that you are going to transfer in your application:* +- Currencies +- Stablecoins +- Receipts +- Any types of tickets +- Any financial contract -All of these are examples of fungible tokens. Further in the course we will talk about the concept of their work in a more detailed way. -Fungible tokens, they have the owner, and the way they are implemented is that each token has a contract for each owner. Instead of switching the owners instead, in those instances they *transfer messages* between each other to update the balances. It means that each contract holds the balance for each owner. In case you want to transfer a certain amount, then it simply decrements this amount in its own storage, and sends a message to its sibling contract to increment its counter. +> :green_book: ***Tokenization*** – process of breaking down the value stored in the system into transferable chunks. -### Tokens in TON -Concerning both fungible tokens and non-fungible tokens, they're all scalable in TON. This is an important aspect of TON. Non-fungible tokens and fungible tokens are implemented in a way that they can scale to billions of users. And transactions between them don't create bottlenecks in some specific place. +:eyes: Let's take a look at what kind of tokens exist in TON. -Let's say you have a system where the balances may have different states. So you may have money that is temporarily unavailable, but you want to record that the user has deposited it. The scalable way is to implement extra tokens. You may have your primary token – that is what your system is designed around your main stable coin or cryptocurrency; auxiliary tokens that represent those in a different, for example temporary state; smart contracts that would convert one form or another. -Hence, from the users' perspective, these auxiliary tokens are not really things of value, they probably don't even have to see them as different assets in their wallets, instead, they would probably just see their normal tokens in just different states. +##### First of all, the tokens could be: +- fungible +- non-fungible -### Conclusion +*What does it mean?* -As seen, even the token is still in some cases could be a low level building block for a higher level of concept. So on one hand, you have this low level notion of a contract that allows you to implement the token and then it may turn out that the token itself is a low level building block for some other thing we could do to implement tokens in the different states. -This is something to be kept in mind while designing applications in TON. +## Non-fungible tokens. + +> ***NFTs (Non-fungible tokens)*** - tokens that satisfy following properties: +> - Unique +> - Have an owner +> - Cannot be split or merged and freely interchanged + +##### Non-fungible tokens implement a lot of important features in the TON ecosystem: +- TON DNS records +- Telegram usernames + +## Fungible tokens. + +*The fungible tokens add one more dimension – they also have multiple units that could be interchangeably transferred between the users.* + +##### In Ton, the fungible tokens are used to implement a lot of things: +- Currencies +- Cryptocurrencies +- Shares +- Voting rights + +> :orange_book: **In TON fungible tokens are implemented in a scalable manner.** + +*In TON you don't have the single contract that keeps a track of all the accounts that own portions of the token or the units of the token. Instead, there is a multitude of independent contracts with the same code that are called token balances or token wallets. And every user's wallet communicates directly with their own token wallet.* + +## Scalability of tokens + +> **What does scalability of tokens mean?** +> *It means that while :dancers: two users are making a transfer of one token between themselves, this transfer doesn't interfere with the transactions of some other :two_men_holding_hands: two users who are doing the transfer of the same tokens on some other end of the network.* + +> :fire: In TON, all these custom assets that you create inherit the full unlimited scalability of the network without any shortcuts. + +## Conclusion + +###### Based on the above, the following conclusions can be drawn: +- :money_with_wings: Fungible and non-fungible tokens allow you to implement all sorts of assets that you could transfer directly to the users. +- :gem: Together with contracts, tokens that are built with contracts become one of the building blocks in the arsenal of an app developer. +- :books: Understanding how the tokens work is important to make your system scalable and performant for all the users at any scale.