Each node in TON is responsible for storing and verifying only its own data, not the data of the entire blockchain. blog.ton.org
Here are examples that will help understand how sharding works in TON, how the division into shards occurs, and how shards are merged.
Example 1: General principle of sharding in TON. Let's imagine that TON is a large city. Sharding in TON is like dividing a large city into districts. Instead of having one mayor manage the entire city, each district has its own manager who takes care of local affairs.
Masterchain: This is the city administration. It coordinates the work of all districts, ensuring overall order and consistency of actions.
Workchains: These are different departments within the district administration. Each department is responsible for its specific area, such as education and healthcare.
Shardchains: These are the city districts. Each district handles its own affairs, but they all adhere to common rules and the city administration.
Example 2: Division into shards in TON. Let's say there is a large apartment building where each staircase represents a shard.
Residents in each staircase communicate with each other, solve everyday issues—these are transactions within the shard. However, all staircases are in the same building and adhere to the common rules set by the tenants' council, i.e., the masterchain.
If something important happens in one staircase that affects the entire building, the information is passed to the tenants' council, which then informs the other staircases, i.e., the shards.
Example 3: Merging shards in TON. Sometimes, there is a need to address an issue that requires the agreement or involvement of residents from all staircases. For example, coordinating the installation of a new playground.
Information and decisions are gathered from representatives of each staircase and passed to the tenants' council.
The tenants' council then coordinates actions and ensures that the decision is executed in the interest of the entire building.
Thus, each staircase, which is also a shard, operates autonomously, but important decisions are coordinated and made at the level of the entire building, i.e., the masterchain.