MOAC Technical Column “ Introduction of Sharding”

David Chen
MOAC
Published in
5 min readJun 29, 2018

Sharding is dividing all of the nodes of a network into several subgroups, each executing processing tasks meant for the original nodes in a predefined way, improving overall system processing capacity.

Requirements for sharding are listed below:

1.

Subgroups for sharding are restricted by size, as the system fault tolerance must be maintained; the quantity of nodes for sharding has a lower limit. For example, there must be at least 50 nodes.

2.

The sharding consensus is restricted. POW may be unsuitable due to the small quantity of nodes.

3.

Sharding must guarantee data consistency.

Ethereum’s sharding policy is to divide all nodes into several portions of one cycle and distribute the contract to each shard. Sharding will be redone after the cycle. But this has the following defects:

1.

It needs global memory to save the sharding information.

2.

The cycle is usually long and the sharding information will be out of date if the quantity of nodes is featured with a high dynamic change.

3.

After the cycle, the contract processed by current shard must be redistributed to a new shard, thus causing unnecessary operation for resource switching.

4.

The sharding consensus is the same to the lower level consensus, so the sharding function will not be available unless the main net is switched to POS.

Sharding is realized through MOAC’s layered architecture.

The lower level of MOAC uses POW to ensure the consistency of all data. The lower level consists of v-nodes. Nodes processed by sharding are calle SCS nodes. Each SCS node corresponds to a v-node. This way, the SCS node can obtain the globally consistent block information through v-node.

The SCS node and v-node are divided to process different tasks.

SCS features:

1.

Each shard has its own memory which is the blockchain of sharding.

2.

SCS can be integrated with a consensus mode such as POS or PBFT, different from that at the lower level.

3.

The SCS block generating time can be different from that at the lower level, for example, the processing rate can be further improved by a rapid block cycle.

4.

SCS periodically flushes the result to the lower level to achieve the stated global consistency.

Different from the sharding method of ETH, MOAC sharding adopts a contract-driven mode.

This means that a contract corresponds to a system shard. When a contract is created, a corresponding quantity of nodes will be randomly selected to form a shard to execute this contract. The contract existing period can be actualized in this shard from being created to being terminated. Of course, new sharding nodes can be shuffled and selected again at any time if necessary.

MOAC sharding flow:

The MOAC system will guarantee the actualization of PBFT sharding. The user can also create his/her own consensus contract and use it as a plugin of SCS. This is the concept behind microchains (see MOAC Series — Microchain).

What is the advantage to employing sharding? It will mainly improve the system processing rate.

The processing rate of ETH is now restricted as follows: the total gas volume is 7 million. Each payment trade needs 21k, but the contract calling fluctuates highly, and may be about 200k on average. 350 pure payment is available for each block, and 35 for each block if all contracts are called. If it takes 20s for each block, 2~10 transactions can be processed per second.

As sharding technology is used in MOAC, as many contracts are possible are processed through SCS nodes. V-nodes only processes payment trading and necessary contract calling. If there are 100 shards, the contract processing rate will be improved by 100 times or more. At the same time, most of the lower level will process payment trading with simple logic, and we can also completely reduce the gas volume for payment trading to further improve the processing capacity without attaching too much load to the system.

Impact of sharding on the evolution of mining in the MOAC system

If the whole system processing rate improves, the requirements for v-nodes will be higher. One of the requirements is for the network band width and the other is for the memory capacity. The GPU computing capability at each node is obviously another requirement. With the popularization of fiber optic and 5G networks, band width isn’t going to be a bottleneck. The cost for memory won’t be an issue either. The ordinary user doesn’t need to deploy a v-node so long as there is a trustable and connectable v-node, because SCS nodes are capable of mining on their own. As a result, two levels of mining nodes will be formed within MOAC system:

1.

POW is executed through a v-node with a powerful computing capacity, high network band width, high memory and connectable SCS to maintain the mining capacity for the whole network, and the quantity is from one or two thousand to ten thousand.

2.

he mass CPU-based SCS is used to process the contract execution. For the Microchain consensus diversity, such SCS nodes can be mobile devices including mobile phone (see details in MOAC Series — Application: Human Blockchain). The maximum quantity of SCS nodes will become unlimited. In the current setup, thousands or even millions of SCS can participate without detrimentally affecting system performance.

Where to Find Us

Website: https://moac.io/

GitHub: https://github.com/MOACChain/moac-core

Twitter: https://twitter.com/moac_io

Reddit: https://www.reddit.com/r/MOAC/

Medium: https://medium.com/moac

Steemit: https://steemit.com/@moac-official

Telegram(International): https://t.me/moacblockchain

Telegram(Developers): https://t.co/8m3m9RD5ix

Telegram(China): https://t.co/73rU9sHWLH

YouTube (Event Channel):https://www.youtube.com/channel/UCBU405W7vfOPBicLwW9-QOA

Youtube (Technical Channel) :

https://www.youtube.com/channel/UC_U54wsGNrm_Yivj5bH9i7Q?view_as=subscriber

Facebook: https://www.facebook.com/moacchain/

--

--