In-depth Analysis of The Open Network TON Part 1: Innovation and Vision of TVM
Some readers may recall Telegram's coin offering project from a few years ago. The blockchain set to launch at that time was called the Telegram Open Network, with its native token being Gram. However, the accusations from the U.S. Securities and Exchange Commission (SEC) led Telegram to abandon the development of this blockchain and refund the investments received to investors.
Recap: Telegram settles with SEC! Required to pay a $18.5 million fine, must notify before issuing any coins within three years
Later on, Telegram open-sourced the code of this blockchain, allowing many teams and communities to continue its development. The most well-known among them is "NewTON," which is now known as The Open Network today, supported by the TON Foundation. The native token of TON, TONCOIN, has now reached a market value close to the top 10. Telegram has also integrated support for TON's cryptocurrency wallet into the Telegram app.
Advertisement - Please scroll down for more content
(Related: Telegram launches digital asset auction platform Fragment, users can bid for usernames using TON tokens)
Table of Contents
More Than Just Blockchain
The name TON represents not just a blockchain, but a larger WEB3 ecosystem that includes:
- TON Blockchain
- TON Payment Lightning Network
- TON Storage Decentralized Storage Network
- TON Network (ADNL Protocol) Native Cryptographic Network Protocol
- TON DNS Decentralized Domain Name System
All of the above infrastructure was fully launched in 2022. This article will introduce the unique features of these foundational elements of the TON ecosystem and focus on their impact on users and applications.
TON Blockchain
Consensus Mechanism and Staking
TON Blockchain uses a POS consensus mechanism. In addition to traditional methods such asrunning nodes and staking through third-party services, users can also participate in staking pools through the decentralized staking contract calledNominator introduced by the TON Foundation to earn POS rewards.
TVM and Development Language
On the TON Blockchain, the virtual machine used to execute smart contracts is called TVM, which differs significantly from EVM in design concepts and is not natively compatible. The native language for developing smart contracts on TVM is FunC, and for managing, debugging, and developing smart contracts, there is a unique Fift language. However, in most cases, JS and TS can be used instead of Fift to accomplish tasks, and if FunC is too difficult to write, a higher-level Tact language can be chosen.
Although it is a new language, there are already many SDKs and APIs available for developers to use. In addition, token standards such as homogeneous tokens (TEP74), non-fungible tokens (TEP62), soul binding (TEP85), and royalties (TEP66) were proposed early on.
Actor Architecture
Drawing inspiration from the design architecture of large applications in Web2, the design philosophy of TON believes that users should not be forced to pay for all services. This is similar to how Instagram or Twitter do not require users to pay a server fee every time they post or like. Therefore, in the world of the TON Blockchain, anyone can directly interact with smart contracts, and users do not necessarily need an "account" to pay fees to send messages.
TON adopts the concept of Actors, where:
- User sends a message
- Smart contract processes the received message according to its code
- Smart contract changes its attributes (e.g., balance) based on the received message or sends out additional messages
Because transaction fees can be paid by the smart contract receiving the message, users do not need to have an account. This design structure benefits some applications that will be mentioned later, such as native AA wallets or more secure and convenient automatic payment mechanisms.
Transaction Fees and Deflation Mechanism
In the world of TON, deploying smart contracts is not a one-time event. To ensure that smart contracts can be called at any time, they need to be continually stored on the chain, which is a continuous burden on the network. Therefore, TON designs the deployment fee for smart contracts as rent. The contract needs to maintain a sufficient balance to pay the rent. If the balance runs out, the contract will be removed from the network. However, replenishing the fee can restore the contract. This design prevents the network from being burdened by smart contracts that are idle or abandoned for too long.
Additionally, after a vote in mid-2023, half of the transaction fees in the current TON Blockchain will be burned. As of the time of writing, a total of 63,000 TONCOIN has already been burned.
Asynchronous and Non-Atomic Transactions
In the EVM world, interactions between contracts are atomic, meaning that all actions in a transaction are considered a whole. If any action fails, all actions in the transaction fail, as if nothing happened. This atomicity is useful in many DeFi scenarios, such as flash loans, which bundle borrowing, trading, and repayment in a single transaction to reduce risks from price fluctuations or other factors.
However, TON maintains a skeptical attitude towards this practice's scalability. While making all transactions atomic is convenient, conceptually it is like executing all contracts on the same "machine." In pursuit of higher scalability, TON treats each contract as an independent server, and different servers do not wait for each other during execution and do not roll back their own transactions due to errors in other servers' executions. Therefore, this design, although called asynchronous, allows the blockchain to execute multiple actions simultaneously, increasing scalability.
Modifiable Smart Contracts
The immutability of blockchain is a common impression for most people. However, this does not align with the reality of application development, as code that cannot be changed also means it cannot be upgraded or updated. Therefore, many DAO and DeFi projects use Proxy contracts to indirectly modify contract contents.
As a next-generation blockchain, TON considered this phenomenon during design. Since users are aware and accept that smart contracts can be modified, there is no point in rigidly setting smart contracts as unchangeable. Thus, on the TON Blockchain, smart contracts can be modified, and immutability becomes an option.
Native Account Abstraction, Smart Contract Wallets
Every Wallet/Account Is a Contract
On the TON Blockchain, wallets are not generated off-chain with a set of public and private keys to produce an address. Wallets for users are also smart contracts that need to be written and deployed to be used (although in practice, this is done through wallet software). Before deploying the wallet contract, users can preview the wallet address with their public key and receive payments with this address. When assets need to be accessed, users must deploy the wallet contract on-chain and manage assets according to the rules of their deployed contract.
In Ethereum, the management rules for wallets are directly written into the protocol and do not require users to deploy contracts for management, but this also means they cannot be changed. For TON users, they have complete control over wallet management. Since each wallet is a smart contract, users can set their desired rules during deployment, such as automatic transfers, multisig, or locking functions.
In other words, in the popular account abstraction and smart contract wallet ecosystem of EVM, on the TON Blockchain, every user's wallet is a smart contract wallet. This is possible because the Actor model of TON allows users to interact with the blockchain before having a wallet to complete the deployment of the wallet.
Public Key No Longer Equals Wallet Address
In most blockchains, wallet addresses are directly calculated from public keys, making the relationship between public keys and addresses one-to-one. However, TON's wallet addresses are generated by adding the public key to the content of the wallet contract. Therefore, using the same public key with different wallet contract rules will result in different addresses. Of course, users can also simply add an identifying serial number within the same contract to generate multiple addresses. This approach can replace complex HD (hierarchical deterministic) wallets in some simpler scenarios, allowing the same set of public and private keys to manage multiple addresses more intuitively.
Expanded Wallet Functionalities
Due to the freedom of smart contract wallets, developers continue to innovate in imagining TON wallet usage scenarios. As of October 2023, mainstream wallet contracts have undergone four iterations, evolving from the V1 version to the most widely used V4R2 version. The V1 version already included basic functionalities for receiving and sending all assets, while the V2 and V3 wallets added features for time-sensitive transactions and single public key managing multiple addresses, respectively. The R2 updates for each version mainly differ in whether the wallet contract can obtain its public key via a get-method.
As for the V4 version that has been in use since 2022, it more prominently demonstrates the characteristics of the TON Blockchain. Users can install "plugins" for their V4 wallet contracts, adding modular additional "functions" or "rules" to their wallets. For example, a user can install a subscription deduction plugin that allows designated service providers to charge their wallet according to specific rules. Since the wallet is also a smart contract, third-party servers can directly interact with this contract for billing, eliminating the need for manual periodic payments (or transferring funds to another contract for automatic payments).
Additionally, the TON Foundation and other community developers provide wallet contracts with features such as multisig and linear unlocking. This includes templates for "high traffic" wallets for use by exchanges and other large institutions, where the contract can receive up to 254 transactions in a single call and can handle multiple calls simultaneously, theoretically enabling thousands of transactions per second.
Related Reading: ABCDE Research Partner Lao Bai's Commentary: TON Overvalued