The moment is approaching the full-scale launch of the most anticipated crypto project, which can really change the world. By early November, the TON network will be launched and everyone will be able to fully appreciate its advantages and begin to use it for its intended purpose: developers - create useful and profitable applications, users - use the functionality of useful applications, easily paying for it, if necessary.
A test network has already been launched and there are two interesting documents on the
official website that shed light on how this project will function. This is a
description of TON, 132 pages (links to pages in the text are indicated in parentheses, (45)) and a
description of the blockchain, 120 pages (links to pages are indicated in square brackets, [55]). The virtual machine and the programming language of smart contracts will not be considered in this article; those who need it will understand it, and those who do not understand it will not need it.
I read for you and tried to highlight the points of interest to a simple layman (me), leaving aside very important, but obscure calculations, formulas and proofs, all of which are stated in the original sources above. I hope that my summary will be useful to those who do not have the time or desire to personally study these interesting documents.
So what is the Telegram Open Network (TON)?
Telegram Open Network (TON) is a fast, secure and very cool blockchain-based network project that will do well for everyone at once. Itâs such a huge âsupercomputerâ distributed over thousands of servers, or rather a âsuper serverâ, on the basis of which tons of useful applications can be launched. Add to this your own GRAM token, support for microtransactions, constant (in theory) rate growth, well, hundreds of millions of existing Telegram users who will automatically gain access to all services on the TON platform to realize the full power of the Durovs intention.
The first thing to understand is that
TON is not a blockchain . This is its own version of the Internet, with blockchain and microtransactions. If the project is successful, then over time, just as you use a browser to access the Internet, where there are various sites and services, in the same way you will use some TON-browser to access the new network (something similar already exists in the form of a Tor-project or i2p, for which there are direct references in the text.
TON is a combination of the following components: (4)
- The TON P2P Network network provides access to the blockchain, storage system and allows services within the network to communicate with each other.
- TON DNS short name service so that you can use human-readable strings instead of bulky hash addresses.
- TON Storage distributed storage system , with P2P access on the principle of torrents, for storing blockchain data, as well as just any user files.
- TON Services application store , which allows users to access from a computer or smartphone to various useful and not so applications in the TON network. These services can be located and executed both directly on the blockchain (onchain) and outside it (offchain).
- The TON Payments micropayment service , which allows application authors to easily and efficiently receive payment from users for services, as well as make payments directly between TON users without paying network fees (similar to lightning network).
- The whole economy is built around the GRAM token , the native token (id = 0) of the TON core network.
- Most importantly, the multi-purpose blockchain platform TON Blockchain with unlimited bandwidth, smart contracts, custom sidechains and many, many others worthy of a separate article.
The architecture of the project allows for fairly simple integration with third-party applications, such as instant messengers or social networks. An example of such integration, in the near future, will be the Telegram messenger, on the website of which a
license agreement for using the wallet has already appeared.
Consider the main points of each component in a little more detail:
TON Network: protocol implemented
Like the MTProto protocol already implemented for Telegram, itâs just a wrapper over standard TCP / UDP, an abstraction that gives each node within the network its own address and sets the message standards between them (details of various subscriptions to messages, solving potential traffic tracking problems, and so on). A testnet is already running on this protocol, although there are no specifications yet, but they are not needed by anyone except low-level developers. Something similar has already been implemented in the
I2P project. (81)
An additional TON Proxy layer is described separately, allowing anonymous access to the TON network. Such attention to details in the field of anonymity at the whitepaper stage, it seems to me, shows in which direction the creators plan to develop the project, towards cooperation with regulators or towards decentralization and disclaimer of responsibility for everything that happens on the network. (84)
This simple but very important service solves the problem of human-readable addresses of services and counterparties, right now there is a competition for the development of this smart contract, so the implementation details are unknown, but, of course, there will be human-readable addresses on the TON network. (106)
TON Storage: plans
The time-tested concept of torrents, when one small hash can correspond to an arbitrarily large file, is implemented here. Indeed, if we have a lot of data that needs to be distributed, why not use torrents? Even in its current form, this technology is quite viable: there are people who are ready to provide their disk and network capacities absolutely free, so that you can download a specific file. What will happen if convenient monetization is applied to this technology through GRAM tokens? It will be great. (102)
Itâs even more cool that the concept of âcloud servicesâ is introduced within the network when a market is created where those in need of resources (such as disk space or processor time or network traffic) can buy these resources from those who want to provide them for a pre-agreed fee. With this approach, the same TON Storage will become fully decentralized and unlimitedly scalable. Something similar should have been implemented in projects like Golem and Sonm, but in the end it remained on paper, let's see what happens here. (103)
TON Services: plans
Blockchain is needed in order to be used. The headache of the creators of smart contracts and various applications has always been interaction with the client. Usually you need to start your own website somewhere, ask the user to install a browser extension such as Metamask or some other foul-smelling program, and then you can use it. Of course, there was no talk of any wide distribution of such products; people are used to the fact that everything should âjust workâ and donât agree on anything else. Itâs all the more pleasant to see that the whole section is devoted to the creation and interaction with applications. Two types are distinguished, the first is services, applications and other services interact with them, and, in fact, applications in which live users will poke buttons. (99)
The concept of standard interfaces is introduced in a smart contract, so that you can interact with them from any standard client. You can describe the data you need from the user, and he just needs to click a couple of buttons in the form to form and send the transaction to the blockchain and change the status of the smart contract. The question remains, how complex interfaces can be implemented using this method, but the fact that everything will be done directly from Telegram or another standard TON client is certainly pleasing. (110)
We are again told in direct text that it is possible and necessary to create TON-WWW, a new Internet, with an implemented payment system, unambiguous verification or complete anonymity, as you like, well, and the absence of any censorship, due to the decentralization of the platform. We all dreamed about this Internet. (112)
TON Payments: there is a competition
TON Payments is a network of virtual banks where each user establishes a relationship with at least one counterparty. These relations are fixed by a smart contract, which freezes the amount of contributions, as a guarantee of honesty of the parties. After that, you can transfer money to anyone, it is only important that there is a chain connecting the two agents. For example, sending money from Vasya to Peta actually looks like a chain Vasya -> Bank 1 -> Bank 2 -> Bank 3 -> Petya, well, or Vasya -> Bank 1 -> Petya, if both are clients of the same Bank (that is, they signed smart service contracts and contributed funds). This is necessary in order not to spam the network with frequent microtransactions, but to record there only updated balances, who owes what to whom. For example, at the beginning of cooperation Vasya and Bank 1 create their own contract. Vasya puts 100 coins that he is going to spend on it, the Bank puts 10 coins in the contract, which may be returned to Vasya (for example, in the form of interest or cashback). Then Vasya starts sending requests for payments, and the bank through its channels through TON Payments makes these payments to other banks, and they to the final counterparties. All of these hundreds of transactions are recorded off-chain. Then, at some point, Vasya runs out of money, the smart contract receives a message about updating the balance, that now Vasya has 20 coins left, and the bank has 90, then, for example, the bank withdraws 80 coins, and Vasya adds another 100, for subsequent expenses. Only changes in balances are recorded on the blockchain, which is now Vasyaâs 120 coins, and the bankâs 10 and everything starts all over again. Or Vasya receives a large transfer, then the bank increases its share in the smart contract by the required amount in order to transfer this money to Vasya. Payments by this principle will be practically free, while no one bothers to directly transfer tokens through the blockchain, if it is a large or important transaction, having paid the corresponding network commission. (120)
GRAM token: awaiting release
The monetary unit of the network, in GRAM there is a payment for transactions, for a place, for data, for the opportunity to become a validator, and much more. In total, the initial circulation is five billion coins, of which about 2.7 billion were sold in two rounds of closed sale (plus or minus, unofficial estimates from various sources). The first round of sales was about $ 0.3, the second - $ 1 with a tail. Grams have an interesting distribution system. The first coins were sold directly to a narrow circle of investors, a total of 1.7 billion US dollars was collected. Further, the coins remaining for a small share of developers and operating expenses will be sold from TON Reserve according to a
formula that depends on the number of tokens in circulation. You can see from the link that with a circulation of 2.7 billion tokens, the sale price will be about 1.5 dollars, however, it will grow exponentially and after a billion sold tokens, the sale price will increase to four dollars. This is approximately the price that is now held in the derivatives markets, which, however, cannot boast of large volumes, due to the dubious nature of most organizers. So, the price of the token is determined by two parameters: on the one hand, it is a free market in which there are initial investors, some of whom want to take profits, on the other hand, it is TON Reserve, in which the price can only increase. True, it can also decrease, this will happen if the market price becomes less than half the âofficialâ, in which case the TON Foundation, the legal entity that carried out the initial sale and owns the TON Reserve, reserves the right to start buying back tokens from the market at the expense of funds received earlier from investors. Then the number of tokens in circulation will fall, and with it the official price. Speculation about the dynamics of the price of grams and generally about the economy of TON is a thing worthy of a separate article, which I will soon write if you are interested. For now, itâs important to understand that the GRAM rate will be âgentlyâ regulated, due to the presence of a large player in the market, this will protect the coin from a sharp fall, but it will also not allow the price to rise sharply. (128)
TON Blockchain: testing in progress
Even if there werenât all of the above infrastructure, if there werenât contests with a prize pool of hundreds of thousands of dollars to create this very infrastructure, as well as a platform with hundreds of millions of users who will automatically gain access to the new blockchain, then it would still be extremely interesting from a technical point of view. He literally absorbed the entire experience of the crypto industry accumulated over the past five years and plans to implement a large number of technological innovations that previously were only on paper.
I highly recommend reading 10 pages in the original whiterpiper to better understand what blockchains are. If you donât want / cannot read, at least watch a
video with an overview. (62)
Then just some technical points, indicating the page in the description of the blockchain, so that you can study the primary sources. Signed by Nikolai Durov on August 20, 2019, straight from the tin.
- All data are described using cells. Each cell is 1023 bits of data and up to four references to other cells. These data blocks and links between them are tied into a bag, using DAG (directed acyclic graphs) to organize the links between them and prevent circular links. Each block in the blockchain, and its current state itself, is just a collection of ordered pieces of data with clearly defined relationships between them. Moreover, for each cell, the SHA256 hash is calculated, which uniquely determines the contents of this cell. These hashes make it possible, among other things, to refer to some data outside the current block, which opens up many opportunities for the creators of smart contracts. [four]
- The concept of Infinite Sharding Paradigm is introduced, which implies that each account is in its own virtual blockchain, creating cells that describe each operation on this account. After that, these cells are tied into a bag and recorded in a block. Theoretically, this could be done separately for each account, but in practice shardchains are used, each of which serves a specific set of accounts (depending on their identifiers). At the same time, itâs important that the function determines which accounts to which shard can change for different blocks. This means that with an increase in load, accounts will spread to a larger number of shards, and if they decrease, to a smaller one, which ultimately gives unlimited opportunities for horizontal scaling, it is expected that the network will never hang (or extremely rarely). [7]
- At the same time, each block located in the shard also represents a small blockchain, and can be changed if necessary, then the changed data will be saved in a new block linked to the old one, and all blocks associated with the old one will be changed accordingly. This is a very effective potential way to solve problems that may arise without resorting to forced network separation (hardfork). (6)
- Accounts in the TON blockchain (what is usually called a "wallet" or "address") consist of the code (or link to the code) of the smart contract, the data store for it, the description of the contract commands (for services) or information about the owner (for people), records about the balance of tokens and statistics on the use of a place in the network and its payment. That is, each account is always a smart contract! Even simple wallets are primitive smart contracts with the function of sending funds. It is interesting that in all "just wallets" you can and should use the same standard contract code that implements the functionality of receiving / sending funds. [eleven]
- Masterchain (main network) contains information about all shardchains, along with data on the latest blocks in them. After the block has been accounted for in the main network, it becomes âreliableâ and can be referenced. In addition, a smart contract code is stored in the main network to select validators (servers that determine whether to include the new block in the blockchain or not) and change the network operation parameters (gas price necessary for transactions, list and accounting for the number of issued tokens, including GRAM and other important things, such as the procedure for selecting new validators). In a word, the current âgame rulesâ are stored in the main network, on the basis of which the network works. To change these rules, you need the consent of at least 2/3 of the validators. [12]
- Further, there is a certain number of Workchain (we will simply call it a ânetworkâ), each of which has its own rules of work, different address formats, different virtual machines for smart contracts, different tokens and so on. However, all of these blockchains have the ability to communicate with each other, as they are required to use the specified format for sending messages. Something similar (different blockchains capable of communicating with each other) we have already seen in EOS. The network is divided into 1 or more shards in order to more efficiently serve all the accounts in it. The number of shards and the principle of distributing accounts between them are dynamically changing, which allows solving the problems of increased load simply by increasing the number of computers that process requests. Anyone can create a new network, ready to pay a fairly high commission on the main network and able to convince 2/3 of the validators to inform them of their readiness to work with the new network (update software that can support it). (5)
- There is a basic working chain on the TON network (number zero). It has a GRM token and implements the Telegram Virtual Machine with Fift language support for writing smart contracts. There can be any number of such workchains, with their virtual machines, tokens and other things. (9)
- New blocks are generated approximately every five seconds. Roughly speaking, this is the time that you need to wait for your payment or request for a smart contract to be processed and executed. It is not worth waiting for this interval to drop below 3-4 seconds for technical reasons related to the BFT consensus used on the network. (9)
- A smart contract has write access to its code. That is, in any smart contract, you can embed an explicit ability to edit it in the future. If this is not possible, then nothing can be changed. But there is an opportunity to create mutable smart contracts. [thirty]
- Please note that since each smart contract takes some place for its data, this place must be paid from time to time. When the money on the contract ends, it becomes âfrozenâ, that is, inactive, to freeze it, you need to send him money to pay for gas. Accounts can be frozen for several weeks, when the amount of debt grows to a critical value defined in the network settings, the contract is destroyed, and all balances are transferred to validators. [70]
- Data and even a smart contract code can be stored outside the blockchain. In the blockchain, only a hash of this data is stored, which allows you to check the validity of the sent code / data. Binding data to a hash allows you to use "libraries", that is, some standard implementation of contracts (for example, a wallet), which, probably, will be of high quality and will be used everywhere so as not to reinvent the wheel. [31]
- Much attention is paid to the transfer of data between shards, so that messages are not lost or faked, apparently the question is well developed theoretically and network scaling should not be buggy. [42]
- The internal format for storing GRAM amounts in an account relies on the fact that the total declared number of grams (5 billion) will grow very slowly, that is, hyperinflation due to additional release cannot be stupid for technical reasons. The possibility of creating your own tokens is also indicated there. [55]
- The gas price is not specified by the user, unlike Ethereum, instead it is set as a single parameter for the entire network (workshop). Thus, there may be networks where messages are expensive (various kinds of ledgers, books of accounting for important transactions), but may cost a little (for example micropayments), with this parameter you can quite effectively deal with spam. [58]
As you can see, a lot of interesting structures and concepts are being introduced and the most important thing is not just a declaration of intent, the network is already being tested, people are already trying to write smart contracts for the competition, and now the movement is starting, which will be very interesting to participate in!
Update: information and analysis of the possible dynamics of the GRM token price
here