TON/TVM Sidechains Overview
TON CoreIntro
For scenarios that require instantaneous response to user action, such as trading or some kind of games, specialised TON Layer 2 solutions or TON Sidechains can be useful. These solutions may be inferior in scalability but provide higher single transaction speeds.
Types of Sidechains
Sidechains/Layer 2 can be implemented in many different ways. For example, it can be a DeFi sidechain with support for any TVM smart contracts, a dedicated sidechain for a popular game, or a sidechain-exchange that provides functionality and UI/UX experience identical to centralised exchanges (CEX) but retains the principles of decentralisation.
Sidechain does not need to have the same architecture as TON Layer 1.
The simplest TVM Sidechain
Due to the flexible configuration of TON blockchain, the simplest variant of a TVM sidechain is a standalone TON blockchain running on a small number of validators (1 to 20) with sharding disabled, with only the masterchain running.
Any TVM smart contracts can be deployed in such a blockchain. If your smart contract is already running on a Layer 1 TON, you can run it on the TVM sidechain without modifications. The lack of sharding and messages between shards reduces scalability but allows any transaction sequence (e.g. token exchange on a decentralised exchange) to be executed in just one block (~3-5 seconds). Such a sidechain can handle hundreds of millions of smart contracts and execute tens of thousands of transactions per second.
The TON Core team has developed a mylocalton-docker solution that makes it easy to run such a TVM sidechain even on a laptop. Of course, a more powerful infrastructure will be required for production deployment.
Interaction between TON Layer 1 and the sidechain
Several approaches can be used to transfer assets between TON Layer 1 and sidechains:
1. Simple bridge
The simplest and fastest to implement is the oracle-based (multisig) bridge. It allows fast transfer of assets between networks, but requires trust in the oracle operators.
2. Trustless Bridge
Trustless Bridge is an bridge without intermediaries where validity checking takes place entirely on smart contracts. This provides maximum security and decentralisation.
Note: In the latest TVM update we have added new registers (`PREVMCBLOCKS_100`) that can be useful when creating TVM-to-TVM bridges.
3. Workchains — seamless interaction between chains
The original TON concept incorporates Workchains technology to create native, seamless interaction between Layer 1 and the various sidechains. The TON code already includes some elements of this technology. The TON Core team is planning to actively develop the Workchains technology starting 2025 Q4, after the first sidechains are available in the TON community.
Once this technology is finalised, the transfer of assets into a Workchain will be as simple as it is inside TON Layer 1.
Users won't need to select networks, use bridges or understand complex cross-chain transfer mechanics — just open any TON wallet and send assets to the right address. Everything will work seamlessly as if the transaction were taking place within a single blockchain.
TON Core x Telegram Contest
The TON team with the Telegram team held a contest on the contest.com platform. One of the key tasks of the contest was to develop a trustless bridge between TON Layer 1 and a sidechain. However, the participants were not supposed to create a full-fledged bridge, but to focus on its most difficult part — block verification.
The contest attracted a large number of talented developers and was widely publicised.
The simplest TVM sidechain for the contest
For the contest, we used the mylocalton-docker tool we developed and ran a specialised contest sidechain, which we called "fastchain".
In addition to the sidechain itself, we also deployed all the necessary additional services, including a blockchain explorer and HTTP API. It was with this sidechain that contest participants were invited to create a trustless bridge code.
This experience clearly demonstrates that it only takes a couple of hours to deploy a simple TVM sidechain with basic services.
Contest results
We received several dozen solutions and studied each of them. The results of the contest are available here.
The complex trustless block validation solution was done in just a few weeks, so we believe that the 1st and 2nd place developers or teams are qualified to run and maintain a real sidechain.
In addition, we have obtained various code implementations for block checking, which is a key component of trustless-bridge.
These solutions are published under a free licence, allowing any developers to use them in creating real sidechains.
Other solutions
It's worth noting that other solutions have emerged in the community to run sidechains for TON.
Tycho by Broxus
The Broxus blockchain development team has created Tycho, a sidechain based on TON but with a modified consensus. It is a TVM sidechain that is inferior to TON Layer 1 in scalability, but has a faster single transaction execution speed. It supports the deployment of standard TVM smart contracts.
One of the largest gaming projects, Hamster Kombat, which held on TON the most massive token minting in blockchain history last year, chose Tycho to launch its Hamster Kombat Layer 2. The clicker mechanics are now fully functioning onchain on this TVM Layer 2.
TAC's EVM sidechain
Another project is TAC, an EVM-compatible sidechain for TON. It allows EVM-smart contracts to be launched. In the short term, TAC may make it easier to migrate existing products from EVM networks to TON.
Conclusion
At the moment, the TON community has all the necessary components to run useful TON sidechains:
- More than ten skilled development teams capable of launching and maintaining real sidechains.
- mylocalton-docker free open-source tool for easy running TVM sidechains.
- Primitives for creating a trustless bridge that enables safe and secure asset exchange between Layer 1 and sidechains.
- Several already running sidechains from various teams in the community and some proprietary solutions for running new sidechains.
We expect from TON community more task-oriented sidechains to be launched soon - be it gaming, trading, DeFi or other areas.
Of most interest to the TON Core team are TVM sidechains that:
- Support the execution of TON TVM smart contracts.
- Use Toncoin as a native coin.
TON Core has no plans to launch sidechains on its own and remains focused on improving TON Layer 1.
Once sidechains are available and distributed, we will plan to start finalizing a Workchains technology that will provide a seamless connection between sidechains and TON Layer 1.