Skip to main content

Infinity Sharding Paradigm

Understanding Split Merge in TON Blockchain

The TON (Telegram Open Network) Blockchain introduces innovative concepts for blockchain scalability and efficiency. One such concept is the Split Merge functionality, integral to its blockchain architecture. This short article explores the key aspects of Split Merge in the TON Blockchain, focusing on its role within the Infinite Sharding Paradigm (ISP).

Infinite Sharding Paradigm (ISP) and its Application

ISP underpins the TON Blockchain's design, treating each account as part of its separate "accountchain." These accountchains are then aggregated into shardchain blocks for efficiency. The state of a shardchain comprises the states of all its accountchains. Thus, a shardchain block essentially is a collection of virtual blocks of accounts assigned to it.

  • ShardState: Approximated as Hashmap(n, AccountState), where n is the bit length of the account_id.
  • ShardBlock: Approximated as Hashmap(n, AccountBlock).

Each shardchain, or more precisely, each shardchain block, is identified by a combination of workchain_id and a binary prefix s of the account_id.

Sharding Example

In the provided graphic scheme:

  • The black line represents the masterchain.
  • Shards of a workchain are divided by time and denoted in black dashed line.
  • Blocks 101, 102, 103, and 80 relate to the masterchain block with seqno=29. Here, 101, 102, and 103 are in one shard, while 80 is in another.
  • If a split or merge event happens, the affected shards pause until the next masterchain block.

In summary, Split Merge in TON Blockchain is a complex yet efficient mechanism that enhances scalability and interaction within the blockchain network. It exemplifies TON's approach to resolving common blockchain challenges, emphasizing efficiency and global consistency.

Sharding Details

Split and Non-Split Parts of Shardchain

A shardchain block and state are divided into two parts:

  1. Split Part: Complies with the ISP form, containing account-specific data.
  2. Non-Split Part: Involves data pertaining to the block's interaction with other blocks and the outside world.

Interaction with Other Blocks

The non-split parts are crucial for ensuring global consistency, reduced to internal and external local consistency conditions. They are significant for:

  • Message forwarding between shardchains.
  • Transactions involving multiple shardchains.
  • Delivery guarantees and validation of a block's initial state against its predecessor.

Inbound and Outbound Messages

Key components of the non-split part of a shardchain block include:

  • InMsgDescr: Descriptions of all messages imported into the block.
  • OutMsgDescr: Descriptions of all messages exported or generated by the block.

Block Header and Validator Signatures

The block header, another non-split component, contains essential information like workchain_id, binary prefix of account_ids, and various hashes (e.g., of the immediate predecessor). Validator signatures are appended to the unsigned block, forming the signed block.

Outbound Message Queue

OutMsgQueue in the shardchain state is a critical non-split part. It holds undelivered messages from OutMsgDescr until they are processed or delivered to their destination.

Shard Split and Merge Mechanics

In the context of dynamic sharding, shard configurations may change due to split and merge events. These events are synchronized with the masterchain block. For instance, if a split or merge occurs, the affected shards wait for the next masterchain block before proceeding.

See Also