The solution to the problem of Blockchain Sharding

I propose to solve the problem in two steps:

1. Building a Protocol with a pure blockchain

Create a clean blockchain whose task is to inform all network participants about the order of blocks and information in it. Cryptocurrencies are built on top of this Protocol and are not mandatory for its operation (although it is recommended to encourage owners of nodes to maintain the network).

For example, in the blockchain TERA reinterpreted the classical blockchain. It is traditionally believed that it provides value transfer in an untrustworthy p2p environment. But if we dig deeper, we will see that the blockchain technically provides the same information to all network participants. The interpretation of the information is done by the participants themselves and they make decisions privately. If the program code is the same for everyone, the interpretation is the same for everyone. This allows you to split the blockchain into two components — the delivery Protocol information and system Dapps to interpret the information. Moreover, they can work almost independently-asynchronously from each other, which allows to reach about 1000 tps on ordinary users ‘ computers.

2. Add some sharding

In theory, Sharding is perhaps the only way to infinitely scale the blockchain — due to the separation of calculations and data between parts of the network (shards). But the main problem is the lack of trust of one shard to another, because calculations and data are separated, there is no known good way to check — malicious nodes can more easily (ie, having less than 50% of the resources from the entire network) to take control of a separate shard, which casts doubt on the reliability of the transfer of values between shards. At the moment there is no well-developed mechanism known to me with 100% security guarantee.

Therefore, we need to build the following Blockchain Sharding design:
- Each shard will be an independent chain. 
- Blockchain will not support the transfer of value between splinters. 
- But the blockchain will transfer information from one fragment to another, which in turn can be used in smart contracts and used to transfer values (but at your own risk, for example in the form of exchanges).

What is the information transmitted between the shards — this information is signed by the entire shard (building a chain of blocks) and it took enough time to make it impossible to cancel it (for example, on top of it built another 1000 blocks)

Thus, the blockchain, even as a part of shards, always remains integral for all network participants. And the interpretation of its state, which is the same for all, is engaged in the next layer-system and user smart contracts.

Interesting consequences:

  • The shards can maintain their own mechanisms of consensus
  • Shards can have their own currencies
  • Shards can be infinitely many (which means the total TPS network will be for example more than 1 million)

Simulation of practical use

Let’s say I want to create my own shard and enter my CAT token there. To do this, I run a network of new nodes that are connected to the common Tera network, but as it was written above, the common network is only needed to transmit cross-sharding information. No one knows about my network yet, so there are few transactions and they all go fast. I want the CAT token to be freely exchanged for a Tera at the rate of 1 to 1 and have liquidity, and I want this to happen automatically and reliably (i.e. everything happened inside the blockchain). I want the user in my shard to be able to send my CAT tokens to any ID in another shard.

To do this, I create two smart contracts, one in each shard. One of them accepted the token CAT and burned, but it creates a special cross-sharding transaction. In the second shard, the smart contract processes this information and transfers Tera coins to the specified ID. It should be noted that if the smart contract does not have the required amount in Tera, the coins will not be transferred - this is a builtin limitation of the platform. Thus, if the CAT shard is compromised, for example, malicious nodes have gained control and they forge blocks, then only one smart contract (and the corresponding users who believe in the CAT token) will be affected, and the entire blockchain will be safe.

Thus, the safety rules become clear:
- The shard should be large enough and well-known
- Shard must support a sufficiently large number of miners
- The owner of a smart contract that supports cross-sharding communication is obliged to monitor the validity of the two shards and must send a transaction to suspend the operation of the smart contract, if one of the shards is copied.


If you want to be more involved, join our Discord channel where we discuss all technical and non-technical aspects of TERA:
https://discord.gg/x6uB6gy