Harmony protocol Blockchain

Harmony ONE Protocol: A Blockchain of Multiple Chains- Complex Sharding (Simple Explanations for beginners)

July 8, 2020 Off By Ayobami Abiola

Harmony ONE protocol implements cutting edge solutions to combat blockchain scalability challenges without giving up security and privacy instead, reinforcing them. The protocol is focusing on community participation as they intend to increase the adoption of blockchain technology. Harmony took blockchain sharding up a notch to make the blockchain faster without sacrificing its security and makes onboarding of new nodes easier for any accepted node. 

Scenario 1

Imagine in a class, there are photographers who take pictures of different people (one at a time) that come in front and save all the pictures in a big album that belongs to each of them every ten minutes. It’ll be impossible to change the pictures unless one can convince almost all the recorders to change the pictures they have taken before it is recorded in the album. 

Bitcoin Network 

For bitcoin, the photographers are nodes or miners scattered all over the world, the people whose pictures are taken are transactions made by people. The album is the distributed ledger where blocks are recorded and the ten minutes time frame is the block times.

Blockchain Sharding

At some point, it was noted that though Bitcoin is secure, the processes are inefficient, slow, and the energy consumption was too high.

There were many propositions to combat this challenge, these propositions gave birth to different algorithms that we have today. But out of these solutions, the ones which stood out for Harmony protocol are Practical Byzantine Fault Tolerance (PBFT), Proof of Stake (PoS), and sharding. Though sharding has been implemented on various blockchains to scale transactions, the application varies from project to project.

Scenario 2- Sharding Basics

Now imagine that the class of photographers above was grouped not necessarily by arrangements. Each group takes the picture of a person from a number of people in front of the class. Now instead of one person at a time, we can have as many people as the number of the groups of photographers. The photos are recorded such that everyone has a copy of all pictures. After a stipulated time, the group a photographer belongs is randomized to defeat anyone who might want to attack any of the group because of their smaller number. 

ETH2 Sharding

The scenario above basically explains sharding as envisioned by Ethereum blockchain for its PoS ETH2. The group of photographers is shards in the planned Ethereum version 2.

Harmony Protocol – Sharding Upped

The Harmony protocol took sharding up a notch by adding special features which might be very complex to understand for non-tech geeks but don’t worry we will break it down as much as we could. 

Scenario 3

The class of photographers in our example thinks that things might quickly get out of hand if every cameraman has to save all the pictures taken by every group- it can run into huge sizes within a shorter time and become a challenge for anyone who wants to join the class as a new member. So they devised another exciting but complex means to solve all challenges. They made four groups each with a representative man to represent or serve as a beacon. These reps are saddled with the responsibility of randomizing the cameramen, they also take photos and are part of the groups. They also accept stakes or collateral from each photographer to ensure they will not cheat the whole process. 

When each group or shard takes photos, they send the name of the photos or identifiers to the reps, the reps then transmit it to all photographers for safekeeping. Instead of saving the whole pictures, all recording participants save the identifiers for the photos taken by all groups which save a lot of storage. The photo taken by a group stays in the group but there will be no way to identify any particular photo unless the whole class is hacked or swayed. This is aside from the fact that after a certain time (epoch) photographers are changed to another group to take pictures. This process is efficient, fast, and consumes lesser storage space. 

Sharding from Harmony ONE Protocol

Harmony protocol uses beacon nodes to randomize validating nodes to different shards after each epoch. Though being a validator themselves, Beacon nodes accept stakes from all validating nodes. Harmony protocol contains four shards with the capacity for 1000 validating nodes of which there are currently 640 nodes from the community. When nodes in each shard find a block, the block header is sent to the beacon nodes which in turn broadcast them to the whole network. The block header contains the identifier for each block such as the blockchain version number, previous block hash, timestamp of the block, etc. Apart from the fact that the randomized sharding increases the security of the blockchain, the implementation of beacon nodes and saving block header further improves security, speed, and lowers the storage size for each node. 

A blockchain of Multiple Chains

Each shard can be seen as a separate chain because they contain different transactions and specific coins allotted to them. It is possible for a wallet to contain coins from different shard chains, the protocol has also implemented a cross-shard transaction protocol that allows coins allotted to a shard to be transferred to another shard. Smart contracts too are shard localized, contracts that are created operate in the particular shard they are created, but developers can make sure they are available on all shards. 

Community Growth 

The protocol is benevolent enough to create a community node that allows the community to stake their coins via exchanges and gain rewards. The core team envisions the participation of all community members in the growth of the blockchain. There are several activities that are implemented by the Harmony protocol to increase the adoption of the blockchain and reward participation from the community according to set guides. The most recent is HarmonyAngel campaigns to reward community social media engagements.