Hello, everyone, it’s CAT here. Recently, Telegram started a smart contract development coding competition and therefore publicly announced its involvement in the development of a blockchain for the first time. Yesterday, a minimalistic wallet for the GRAM cryptocurrency was added to the alpha version of the messenger. As a result, the general interest in Telegram Open Network has grown. That is why today, we want to give you a detailed insight into the inner workings of a new project of the Durov brothers from the validator’s perspective.

Our story with TON started in December 2017. Back then, someone published a paper outlining a global blockchain project, and it got us thinking for the next couple of months. In 2018, our thoughts eventually brought us to the Minter network—which was similar to TON in its concept—and we decided to use the situation to our benefit.

By the way, the blockchains of Minter and Telegram Open Network have been in the works for approximately the same time: from the beginning of 2017. We launched our first masternode on the Minter network once the project went live in May this year. It helped us locate weak spots in our infrastructure, learn to avoid common mistakes, and overall gave us a priceless experience that we later leveraged in other networks.

How TON Test Network Operates Today

Getting back to TON. At the moment, we have several operational full nodes [the same as masternodes on the Minter Network.—DeCenter] on the TON public test network for targeting specific validation periods. Let’s focus on this one for a while as TON’s global validator set election system deserves special attention.

On the test network, the blockchain elects validators based on available funds on their balance for a period of 4,000 seconds (~1 hour). Two thousand seconds (~30 minutes) before the end of the validation period, new elections begin; they end 500 seconds (~8 minutes) before the end of the first period, after which the second period begins. Such a system gives new validators an opportunity to “get in.” Validator funds from the first period are returned after an additional 1,000 seconds (~15 minutes) along with the reward.

On the main network, 100 validator slots are planned in each period. This would allow a higher number of independent teams to take part in the validation process while a well thought out election system will eliminate the possibility of centralization of power in the hands of “whales.”

There are currently more than 100 validators operating on the public test network. Nevertheless, this fact does not impact the correct work of the blockchain as blocks are generated fast (5 seconds), and transactions are processed as required. Even in spite of test loads and the early build, the network is surprisingly stable.

But the objective of getting into the list of validators is challenging. For that, one would need no less than 100,000 test GRAMs, and as of now, one can receive the coins exclusively through a special smart contract. It appears, however, that the smart contract in question is intended for small amounts only, and to get over 100,000 coins out of it, we had to automate the process and be smart. The trick is currently no longer possible as there are no coins left on the “giver” address, though it is sometimes replenished with insignificant sums.

TON Pros

We would also like to stress some vital competitive advantages of TON that are rarely mentioned in other articles.

1. TON has an outstanding internal structure with several roles: validator, fisherman, and collator. Let’s take a closer look at each of them:

Validators are engaged in the generation and confirmation of new blocks. In fact, any node can become a validator. Validators receive rewards for their work and get punished for cheating attempts and long idling times. The latter also leads to being excluded from the list of validators. These obligations make validators take their responsibilities more seriously.

Fishermen are engaged in overseeing the work of validators. A fisherman is a node that can request the block to be re-checked, and if the majority of validators confirm that it is not valid, the validator who signed it gets penalized. For that, a fisherman receives a portion of the sum that a validator has been punished for.

Collators are other participants in the generation of new blocks. These are nodes that can form blocks and send them to a validator, thus making the work of the latter easier as it is only left for them to confirm the block. For that, a validator can award a portion of its reward to a collator.

2. Sharding and the blockchain of blockchains concept. Sharding is one of the most complex to implement and, at the same time, incredibly useful features of the Telegram Open Network. You can learn more about it here. Generally speaking, TON will most likely be something more than just a blockchain; rather, it will become a platform for blockchains. Pavel Durov is a visionary and a man building global projects fixing his sights on the future. The evidence is right in front of us: sometime in the future, the project intends to rebrand as “The Open Network.”

3. The vertical structure of the blocks. A block containing an error is very likely to be a death sentence for the blockchain. In this case, they often decide to fork in order to roll back and fix the error. We all saw how this happened on the Ethereum blockchain several years ago. Obviously, this is not the most elegant approach. In TON, the solution to this problem is different—once an “incorrect” block has been detected, its “correct” version is formed, which is added “on top” of the previous one. After that, for each block that refers to the corrected one, the corrected version is also formed; then the blocks that refer to the corrected blocks are corrected; and so on. This approach allows for resolving issues on the fly without resorting to forks and stopping the blockchain.

4. Hypercube routing. It is a system that allows for building an optimal and reliable exchange network between shardchains. This algorithm guarantees the delivery of data across the entire TON network, regardless of the number of existing shardchains. With 250 shardchains, only one intermediate link is needed to transfer a message from one shard to another. At 4,000, a maximum of 2. With four intermediate nodes, the TON blockchain can support up to 1 million shardchains, which allows it to be scaled almost endlessly.

5. TON is one of the first large blockchains combining smart contracts and the best consensus algorithm to date, Proof-of-Stake. This indicates the great potential of the project as a “universal” blockchain containing all the necessary functionality for development, coupled with high network reliability.

6. It is also worth noting that developers are frequently updating the documentation on the official website test.ton.org and are highly active on the GitHub page.

7. The way Telegram Open Network plans to implement services in its ecosystem deserves a dedicated item on this list. TON will enable users to launch fully autonomous, smart contract-based services inside the blockchain (DApps) and incur no costs at all due to the ADNL and RLDP protocols. This will allow the applications to work inside the blockchain without using the chain of blocks itself. Telegram Messenger can become one of such services, the fact already stated in tech WP.

The community is also active in joining the process of development. As of today, there are already:

API for Python;

API for Rust;

Node SE toolkit;

Dockerfile for FullNode.

I am sure that we are on the verge of something big; something that will reshape the Internet landscape significantly and with it, our future.

For all the up-to-date news on our progress and launch deadlines, join our Telegram channel @CATnode.

For developer news and notifications on critical blockchain upgrades and changes to the documentation, follow @catchain.