TON roadmap
The technical part of the TON roadmap will continue to advance the speed and scalability advantages of TON.
Written by: Peking University Blockchain Association Kiwi
TON has a core technical logic focused on high-speed applications: TON was born in Telegram, and transactions are directly chained based on messages, supporting peer-to-peer.
Asynchronous message delivery: Due to the use of FunC as the development language, communication between nodes in TON is done through "message" transmission. However, TON is an asynchronous chain, so to correctly synchronize messages between chains, the concept of logical time (It) is introduced. This ensures the correct execution of information by strictly executing messages lt in order.
Hypercube message routing mechanism: TON adopts a combination of ordinary routing and fast routing. Ordinary routing transmits messages between shards through a hypercube structure and adjacent nodes, while fast routing adds Merkle proofs that can relay messages along the edges of the hypercube to improve speed.
PoS + BFT consensus facilitates ecosystem development: POS avoids a large amount of computation during the block generation process, resulting in higher efficiency, lower costs, and better network performance, which is beneficial for DAPP application landing. Although DPOS is faster, trust speed is slower than BFT systems, so TON chooses BFT.
TON's dynamic multi-shard architecture facilitates application scalability: TON improves speed through parallel queries, enhances query accuracy through dynamic sharding, and improves scalability through bag of cells.
Dynamic multi-shard architecture: TON has three layers, a single masterchain + multiple Workchains + shardchains that can be dynamically increased or split. Each shard chain is a collection of various account chains, and DAPPs can independently activate a certain shard chain.
Quickly updatable global state: The global state is updated through a "bag of cells" structure similar to a DAG, by combining new and old sets of cells and deleting the old root for rapid updates. It also uses vertical block repair to update blocks.
TON will continue to optimize the technical framework in the future: by parallel expansion, introducing chain sharding tools, and strengthening node checks to continuously advance TON's speed and scalability advantages.
Blockchain Scalability Challenges
Blockchain scalability is an important technical challenge and a key driver of blockchain technology development: As blockchain applications continue to grow and the number of users increases, existing blockchain networks often face issues such as insufficient throughput and long transaction confirmation times. Traditional blockchain designs limit their ability to handle large-scale transactions and user demands, leading to network congestion, high transaction fees, and inefficiency.
The challenge of blockchain scalability mainly stems from the distributed architecture and consensus mechanism: Firstly, the consensus mechanism and distributed nature of blockchain require every node in the network to verify and record all transactions, limiting the network's throughput. Secondly, the security and decentralization of blockchain require all nodes to maintain complete copies of the blockchain, increasing the burden of storage and transmission.
To address the challenge of blockchain scalability, researchers have proposed various scalability solutions: Such as sharding, sidechains, layer 2 solutions, etc. These solutions attempt to improve the network's throughput and performance by dividing the network into smaller parts, introducing independent blockchains, or building additional structures on the main chain. However, these solutions also bring new technical challenges and security issues, such as inter-shard communication, cross-chain asset transfer, and consensus mechanism design.
Sharding: The basic idea is to divide the entire blockchain network into smaller segments (or shards), each of which can independently process a portion of transactions and data. By dispersing transactions and data to different shards, the sharding mechanism can improve the overall network's throughput and performance. However, it still faces security and consistency issues in inter-shard communication and cross-shard transactions. Additionally, the sharding mechanism needs to address the design and implementation of the consensus mechanism to ensure the network's consistency and security.
Sidechains: Sidechain technology is a method of creating and running independent blockchains connected to the main chain within a blockchain network. Sidechains can perform bi-directional asset transfers with the main chain while having their own independent rules and functions. The basic principle of sidechain technology is to offload some transactions from the main chain to the sidechain for processing, thereby reducing the burden on the main chain and providing higher scalability and flexibility. However, sidechains require bi-directional asset transfers with the main chain, which requires security mechanisms and protocols to ensure the safety and consistency of assets. Additionally, the design and implementation of sidechains need to consider compatibility and interoperability with the main chain.
Rollup: The basic principle is to store a large amount of transaction data in a sidechain off the main chain, and then submit the summary information of these transactions to the main chain for verification. Its advantage lies in significantly improving the scalability and performance of the blockchain network. By storing transaction data in the sidechain and using the main chain for verification, Rollup technology can greatly reduce the storage and computational burden on the main chain. However, it also raises concerns about centralization and security.
New consensus mechanisms: Such as Solana's POH, which associates a timestamp with each transaction, providing a verifiable time sequence for the blockchain. This time sequence can be used to verify the order and time of transactions, reducing communication costs and delays during the consensus process. Although Solana claims its TPS can reach 65,000, the actual TPS is mostly for node-to-node communication, and the real data limit is only 6-8k (daily 4-5k).
TON's blockchain originates from Telegram, and its initial concept is to serve a large number of users: Telegram is one of the most popular social platforms globally, with over 800 million monthly active users and hundreds of billions of messages transmitted within the software every day. TON, as Telegram's web3 transformation, was designed from the beginning to serve billions of users, not just a small number of users.
TON's Technical Architecture
Adaptive Infinite Sharding Multi-Chain Design
TON's sharding is bottom-up: Traditional blockchain sharding schemes generally adopt a top-down approach, first establishing a single blockchain and then decomposing it into several interactive blockchains to improve performance. However, TON's sharding scheme takes a bottom-up approach: organizing these account chains into shardchains, making account chains (Workchains) exist purely in a virtual or logical form within the shardchain. TON achieves parallel transaction processing across multiple chains, known as "blockchain of blockchains." This effectively improves system performance.
TON's sharding is dynamic: It is divided into masterchain, workchain, and shardchain. The masterchain coordinates, and the workchains and shardchains handle actual transactions. Additionally, TON's sharding is dynamic, with each account serving as a shardchain, which can adaptively combine into larger shardchains based on the interaction between accounts to meet dynamic expansion needs.
Masterchain: There is only one masterchain, which contains protocol parameters, a set of validators, and their corresponding shares, recording the current working Workchains and their subordinate Shardchains. Lower-level chains submit the latest block hashes to the Masterchain to ensure the latest state can be determined when cross-chain message reading is required.
If the shards have reached their limit, then each shard chain will only store a single account or smart contract. This will result in a large number of "account chains" that describe the state and state transitions of a single account, and these account chains will communicate with each other, forming a Workchain composed of Shardchains.
Workchain: It is a virtual concept that exists as a collection of Shardchains, and the system can accommodate a maximum of 2^32 Workchains. Each Workchain can flexibly customize its rules, such as transaction types, token types, smart contracts, address formats, etc., while meeting interoperability standards. However, Workchains must have the same message queue format to facilitate message exchange, which also means that all Workchains must have roughly the same security guarantees.
Shardchain: To improve processing efficiency, Shardchains can automatically split when the load increases and merge when the load decreases. Each Workchain will be further divided into Shardchains (up to 2^60). Shardchains distribute work among all Shardchains, with each Shardchain serving only a portion of the account set.
Message Delivery Mechanism
Message: Since TON uses the FunC sendrawmessage function development language, the messages passed between TON nodes are called "messages." In TON, transactions consist of inbound messages that initially trigger them and a set of outbound messages sent to other contracts.
Hypercube Routing: A three-dimensional structure for message delivery that allows messages created in a shard chain block to be quickly transmitted and processed to the next block of the target shard chain.
Asynchronous Message Delivery
Asynchronous calls have synchronization issues: In synchronous blockchains, transactions can include multiple smart contract calls. In an asynchronous system, users cannot immediately receive a response from the target smart contract in the same transaction because the contract call may take several blocks to process. The length of the route between the source block and the destination block will affect this process.
To achieve infinite sharding, message parallelization must be ensured, leading to the concept of logical time: In TON, each transaction is executed on a single smart contract and communicates between smart contracts through messages. This introduces the concept of logical time in asynchronous chains to achieve message synchronization. Each message has its logical time or Lamport time (referred to as lt), which is used to track the relationship between events and the events that validators need to process first.
Message lt is strictly executed in order to ensure operational logic: Messages and transactions occurring on an account are strictly ordered, with the lt of the resulting transaction being greater than the lt of the message, and the lt of a message sent in a transaction is strictly greater than the lt of the transaction that triggered it. Additionally, if there are multiple messages, the message with the lower lt will be processed earlier.
Hypercube Routing Mechanism for Messages
TON uses fast routing + slow routing to run in parallel:
Slow Routing: A more stable and traditional method for processing cross-chain information, where information is packed into a block on the source chain and then relayed from one shard chain to another through a relayer, or multiple intermediate shard chains. All shard chains form a "hypercube" graph, and messages propagate along the edges of this hypercube. After being verified by validators, the information is packed into another block.
The advantage of slow routing lies in higher security and decentralization, as all information needs to go through a complete block confirmation process. For a hypercube network of shard chains with a scale of N, the number of routing hops required is hop = log16(N). Therefore, only 4 routing nodes are needed to support millions of shard chains.
Fast Routing: In fast routing, messages can be processed by the validators of the destination shard chain in advance, and a Merkle proof is provided to destroy the message being transmitted. Fast routing is faster (nodes can find the optimal path) and prevents double transmission, but it cannot replace slow routing because validators are not penalized for losing receipts, posing a certain security risk.
Global State of Shardchains
"Bag of Cells": A set of cells updated in a form similar to a DAG. The new state is represented as another "bag of cells" with its own root, and then the new and old sets of cells are combined, while the old root is deleted.
Vertical Block Repair: Each block in the TON shard chain is not just a single block, but a chain. When it is necessary to repair a block of an erroneous shard chain, a new block will be submitted to the "vertical block chain" and replace the block.
Consensus Mechanism
POS network has 3 roles:
- Validator nodes: Stake 300,000 TON after meeting hardware requirements to participate in maintaining network security.
- All blocks are created by 100 to 1000 selected nodes, which are elected monthly and need to lock the staked TON Coin during the election. The elected nodes are divided into multiple working groups to create new blocks. Each new block is considered successful if it receives signatures from over 2/3 of the staked nodes in the working group. If malicious behavior is detected, the nodes will be slashed and disqualified.
- Fisherman: Acts as a supervisor role by sending invalid proofs to check if the validator nodes have diligently completed their verification tasks.
- Curator: Suggests new candidate blocks for the validator nodes of the shard chain. If the block is elected, the curator profits. It is responsible for checking the state of the shard chain and the data of adjacent shard chains and sending them to the validator nodes.
BFT: After weighing the options, TON found that although DPOS is faster, its level of trust and speed are slower than BFT systems, so it ultimately chose BFT (Byzantine fault tolerance).
TON's new framework can support TG's high-speed message delivery
TON achieves high transaction speed and finality through dynamic multi-shard architecture: TON can create a chain for each user wallet, and the parallel computation of sharding, support for instant cross-shard communication, and TVM support for asynchronous computation form the theoretical basis for its high TPS.
TON brings higher scalability through the message delivery mechanism: In the TON blockchain, calls between smart contracts are asynchronous rather than atomic. This means that when one smart contract calls another, the call is not executed immediately but is processed in a future block after the transaction ends. This design allows for higher scalability because it does not require all transactions to be completed in a single block.
TON will continue to optimize the technical framework in the future…
The technical part of the TON roadmap will continue to advance the speed and scalability advantages of TON
- Separation of sorter and validators.
- Scalability and speed improvement: Allowing TON to achieve parallel expansion in handling a large number of transactions.
- Chain sharding guidelines and tools: Organizing guidelines and code examples for high-load TON work in exchanges, payment systems, and TON services.
- Strengthening coordination among validator nodes: Enhancing and improving the detection and punishment of underperforming validators.
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。