AI disclosure: drafted by Basis Desk's AI newsroom and machine-checked against the primary sources listed below — how we use AI. Originally published on Basis Desk.
A technical breakdown of The Open Network's multi-chain design, dynamic sharding mechanics, asynchronous actor-based smart contracts, and Telegram interface integrations.
Key points
- TON separates operations across a central masterchain, configurable workchains, and dynamic shardchains.
- The network uses an actor model where smart contracts communicate strictly via asynchronous messages.
- Dynamic sharding enables shardchains to split or merge automatically based on real-time computational load.
- Smart contracts execute on the stack-based TVM using directed acyclic graphs of immutable cells.
- Telegram @wallet operates as a custodial service by default, while TON Space provides non-custodial functionality.
The Open Network (TON) is a layer-1 proof-of-stake blockchain engineered to process transactions through a decentralized, multi-tiered sharding framework. Unlike monolithic blockchains that process smart contract states synchronously, TON operates as a distributed system of independent accounts using an actor model. This technical architecture allows the network to partition load across dynamically splitting shardchains while anchoring global state to a central coordination chain.
Originally designed by Telegram founders Nikolai and Pavel Durov before being open-sourced to an independent developer community, TON departs fundamentally from the execution environments popularized by Ethereum. Understanding TON requires examining its three-level chain hierarchy, its approach to message routing, its asynchronous virtual machine, and the protocol bridges connecting on-chain contracts to Telegram Mini Apps.
The Three-Tier Blockchain Structure
TON organizes consensus and data availability across three hierarchical layers: the masterchain, workchains, and shardchains.
The masterchain serves as the central administrative ledger. It records protocol parameters, the current set of network validators, their financial stakes, and the cryptographic block hashes generated across all sub-chains. It does not run user-facing decentralized finance applications or execute routine transfers. By isolating global consensus coordinates on the masterchain, TON ensures that validation rules and chain configurations remain strictly synchronized across the system.
Below the masterchain sit workchains. These are autonomous sub-blockchains capable of running distinct virtual machines, transaction fee structures, and cryptographic address formats. TON can technically support up to 2^32 independent workchains, though only a base workchain (Workchain 0) handles standard user transactions and smart contract code in normal production. Creating additional workchains requires validator governance approval, as each workchain adds distinct operational requirements to network nodes.
Workchains subdivide further into shardchains. Rather than requiring an entire workchain to process every user interaction, a workchain can divide its state among multiple shards. Each shardchain is responsible for executing transactions for a distinct mathematical subset of accounts, enabling horizontal scaling under sustained computational load.
Dynamic Sharding and the Split-Merge Mechanism
Most sharded distributed systems rely on static partitioning, where the network sets a fixed number of partitions during genesis. TON instead implements dynamic sharding, allowing shardchains to split and merge automatically in response to operational throughput.
When transaction volume across a particular shardchain exceeds designated capacity thresholds for a continuous sequence of blocks, that shardchain splits into two equal halves. The split occurs along account address prefixes. For example, if a single shardchain manages all addresses, high network congestion will trigger a division where accounts beginning with binary 0 are routed to one newly minted shardchain, while accounts beginning with binary 1 are routed to the other.
Conversely, when transactional velocity drops and block utilization across sibling shards remains low over a set duration, the network executes a merge. The two shards collapse back into a single chain, releasing validator resources.
Because validators are reassigned among shardchains randomly via cryptographic protocols on the masterchain, no single set of node operators can monopolize or compromise an isolated shard. The masterchain tracks these state transitions, ensuring that global block commitments remain deterministic.
The Actor Model and Asynchronous Execution
Traditional state machines like the Ethereum Virtual Machine (EVM) rely on synchronous execution. In an EVM transaction, a smart contract can invoke multiple external contracts sequentially, reading their balances, updating variables, and reverting the entire transaction atomically if any single step fails. This requires global state visibility during execution.
TON rejects this paradigm in favor of the actor model, a concurrent computing pattern first conceptualized in computer science in 1973. In TON, every account—whether a standard user wallet, a decentralized exchange pool, or an arbitrary decentralized application—is an isolated actor with its own private storage, code, and balance.
Actors cannot directly read the state of another account, nor can they directly modify variables held by external addresses. All communication occurs strictly through discrete, directed units of data called messages.
When Contract A needs to interact with Contract B, it emits an outbound message. This message enters a routing queue. In a subsequent block, the receiving shardchain ingests the message, executes Contract B's code, and updates Contract B's internal storage. If Contract B must return data or tokens to Contract A, it must emit a separate message back across the network.
This model enables genuine concurrent execution: transactions running on different shards proceed simultaneously without locking global state. Readers interested in how alternate networks approach transaction concurrency can consult our technical overview of parallel execution in blockchains.
Worked Example: Asynchronous Token Swaps
To see how the actor model operates in practice, consider a decentralized exchange (DEX) swap involving a user wallet, a token vault, and a liquidity pool across two separate shardchains.
Assume User Alice (Address prefix 0x0A..., Shard 0) wishes to swap 100 native $TON for 200 units of Token X managed by a Router Contract (Address prefix 0xF1..., Shard 1).
- Message Generation (Block N): Alice signs an external message to her wallet contract. Her wallet processes the message, deducts 100 $TON plus processing gas, and emits an internal message addressed to the Router Contract on Shard 1.
- Cross-Shard Transit (Instant Hypercube Routing): The message is routed from Shard 0 to Shard 1. TON utilizes hypercube routing protocols, allowing the message to pass between shards in logarithmic network hops relative to the total number of active shards.
- Router Execution (Block N+1): Shard 1 ingests the message. The Router Contract executes its swap algorithm, verifying that reserves support the requested exchange. It mints or releases 200 Token X and emits a credit message directed back to Alice's Token X account.
- Final Receipt (Block N+2): Alice's Token X account receives the credit message and updates its internal ledger.
Total execution spans three distinct block intervals. If the Router Contract in Step 3 lacks sufficient liquidity, it cannot revert Alice's initial debit from Step 1 retroactively. Instead, the contract must be written to handle failure branches explicitly by emitting a refund message containing the original 100 $TON minus gas back to Alice. Developers on TON must design state machines capable of handling partial states and rollbacks through asynchronous compensation messages.
Smart Contract Development: TVM, Fift, and FunC
The computational engine driving network state transitions is the TON Virtual Machine (TVM). TVM is a stack-based virtual machine designed to manipulate tree-like data structures called cells.
A cell is an immutable storage unit containing up to 1,023 bits of arbitrary data and up to four references to other cells. In TVM, code, persistent memory, incoming messages, and account states are all stored as directed acyclic graphs of cells. This uniform data representation allows the virtual machine to parse state proofs and slice complex data payloads with low overhead.
Developers write programs for TVM primarily in FunC, a statically typed, C-like systems programming language developed specifically for TON. FunC compiles into assembly-like bytecode executed by TVM. Beneath FunC lies Fift, a low-level, stack-oriented language used for deployment scripting, message serialization, and low-level debugging. Higher-level object-oriented languages such as Tact have also been deployed to simplify actor logic for application developers.
Smart contracts on TVM must also account for a mechanism absent in EVM networks: storage rent. Every contract must pay small periodic gas fees proportional to the number of cells it occupies in active validator memory. If a contract balance drops to zero, the contract becomes frozen, and its active data is deleted from validator RAM, leaving only a cryptographic hash descriptor. It can only be restored if a user provides the full historical cell tree alongside an unfreezing fee.
Telegram Integration and the Mini App Layer
While the blockchain layer functions independently of any single interface, TON is tightly integrated into the Telegram messaging platform through native application programming interfaces (APIs) and web application wrappers.
Telegram Mini Apps (TMAs) are client-facing web applications that run directly inside the Telegram desktop and mobile clients. Built using standard web standards (HTML5, JavaScript, WebAssembly), these applications interface with the blockchain via client-side connection standards like TON Connect.
When an end user accesses a Mini App inside Telegram, the application requests access to the user's wallet via a bridge protocol. Users interact through either custodial services, such as the default custodial @wallet service hosted inside Telegram, or non-custodial options like the self-custodial TON Space sub-feature and third-party software wallets like Tonkeeper.
Once authorized, the Mini App constructs cryptographic messages client-side, requests a cryptographic signature from the connected wallet, and transmits the signed payload to TON network nodes via standard remote procedure call (RPC) endpoints. Because the messaging client acts as a unified user-interface container, decentralized applications bypass traditional web3 hurdles like external browser extension installations while interacting with asynchronous on-chain actors.
Common Misconceptions
Misconception 1: TON transactions are atomic across multiple contracts.
Because Ethereum executes contract calls synchronously, many developers assume that multi-contract operations either succeed completely or revert entirely. On TON, execution across multiple contracts is strictly asynchronous. If a multi-step operation fails midway, state changes applied in earlier steps remain committed to the ledger unless developers explicitly implement compensatory refund messages.
Misconception 2: Sharding splits the total network security into smaller pieces.
In early proof-of-work sharding designs, assigning small validator subsets to specific shards left individual partitions vulnerable to single-shard takeover attacks. TON mitigates this by validating shardchain blocks via pseudo-random validator rotation managed by the masterchain. Validators are continuously shuffled across shards, and shard states are frequently finalized and referenced on the masterchain.
Misconception 3: @wallet is a native non-custodial blockchain wallet.
Telegram's integrated @wallet bot operates as a custodial service by default, meaning private keys are held by a third-party operating entity. Non-custodial operations on TON require users to enable self-custodial modules like TON Space within the bot or utilize independent non-custodial client applications.
How This Connects to the Market
TON's asynchronous, multi-chain architecture positions it uniquely in the broader layer-1 competitive landscape. By opting for the actor model over synchronous execution, the network avoids the state-access bottlenecks that challenge traditional monolithic systems under extreme throughput.
However, this architecture trades off execution simplicity for scalability. Building financial primitives—such as flash loans, automated market makers, and composable lending protocols—is significantly more complex on an asynchronous state machine than on an EVM or SVM network. Financial protocols must manage intermediate escrow states, address asynchronous race conditions, and account for ongoing cell storage fees.
Market observers tracking the development of the ecosystem monitor whether developer tooling and abstraction layers can successfully mask the complexity of asynchronous programming while leveraging the distribution capabilities of Telegram's consumer interface.
FAQ
What is the difference between the masterchain and a workchain on TON?
The masterchain coordinates global consensus, stores validator sets, and records block hashes from all shards. Workchains execute smart contracts and process user transactions under specific virtual machine rules.
How does dynamic sharding work during high congestion?
When a shardchain experiences heavy transactional volume, it divides into two new shardchains along binary account address prefixes. When volume subsides, sibling shards merge back together.
Can smart contracts on TON read another contract's balance synchronously?
No. Under the actor model, smart contracts cannot directly read or modify external state. All cross-contract interaction occurs via asynchronous messages passed between accounts.
What are cells in the TON Virtual Machine?
Cells are the primary unit of storage in TVM. Each cell holds up to 1,023 bits of binary data and up to four references to other cells, forming directed acyclic graph structures.
Is the @wallet bot in Telegram fully non-custodial?
No. The standard @wallet bot is a custodial service managed by an operating entity. Users seeking non-custodial control must use its TON Space feature or standalone wallets like Tonkeeper.
Sources
- The Open Network Technical Documentation — TON Foundation
- Telegram Mini Apps Documentation — Telegram
- TON Virtual Machine (TVM) Specification — TON Foundation
Basis Desk is a source-verified crypto newsroom. Market data, a free MCP server for AI agents and JSON APIs: basisdesk.news/developers. Not investment advice.
Top comments (0)