Nikolaos Kostopoulos
Sep 13 · 11 min read

*This is a technical AMA about Harmony Protocol. Questions about Harmony’s company strategy, partnerships, exchanges etc will not be answered.

For the latest updates on Harmony’s Vision and Roadmap read our AMA transcript with CEO, Stephen Tse.

The AMA is transcribed from the live event in Telegram on the 12th of September, 2019. The questions were requested and put forth by the Harmony community live. The questions were answered by Harmony’s CTO Rongjian Lan.

Sonny | Harmony CM

Welcoming everyONE to our Mainnet AMA series with @RongjianLan. The group has been muted temporarily for us to answer pre-submitted questions. Feel free to DM any of the admins with your technical questions

Rongjian Lan | Harmony

Hello, everyone! Good to be here in the community answering some of your questions regarding tech and Harmony overall.

Sonny | Harmony CM

Thanks for joining us. And let’s get to it. @sbrebol says “In your FAQ you say that “Each shard contains hundreds of nodes and employ a fast BFT algorithm to reach consensus within seconds”, what looks like the protocol lean on totally in the nodes…how that nodes will be build and what happens if the number of nodes don’t grow up like are necessary (assuming the system will be like a traditional PoS)?”

Rongjian Lan | Harmony

Right now, the 1000 nodes in our v0 mainnet consist of 68% of nodes hosted by us and the rest are hosted by our Foundational node runners. After the full open staking of EPoS is launched, (https://medium.com/harmony-one/introducing-harmonys-effective-proof-of-stake-epos-2d39b4b8d58) the EPoS model will incentivize the small nodes to participate in the network when there aren’t enough nodes. And even in the case where there aren’t enough nodes, the consensus will only be faster as the network communication between nodes is less.

Sonny | Harmony CM

Speaking about nodes, @KoenApps wants to know if there any plans to enable nodes for people with less than 1M $ONE? If yes, any ETA ? and if there any plans to enable staking on ARM devices? If yes, any ETA?

Rongjian Lan | Harmony

Right now, we have a huge waitlist for the node runners willing to stake 1M $ONE to join the network. Since our spot for the validator nodes is limited, it will be hard to reduce the requirement for now. However, once we open the EPoS staking, the requirement for staking will be determined by the market. At that time, it may be more than 1M ONE or less than that. However, once we increase the number of nodes in shards and add more shards in the future, the requirement for running 1 single node will be reduced. Staking on ARM device is definitely possible and doable. But for now it’s not the highest priority compared to other core mainnet deliverables.

Sonny | Harmony CM

Focusing on mainnet, @Hnefatafl is asking What block latency duration is targeted on mainnet?

Rongjian Lan | Harmony

Right now, our v0 mainnet is having stably 8 seconds block latency, because we artificially capped the speed of block production. The actual consensus latency is actually less than 8 seconds (roughly 6–7 seconds). For full mainnet, we are targeting a 5 seconds block latency.

Sonny | Harmony CM

Continuing with @Hnefatafl, he will like to know “How much are you going to focus on core development and outsource other stuff, like Explorer” and if “ZKP one of your top priorities on the roadmap?”

Rongjian Lan | Harmony

Good question, most of our core engineers are focused on the core mainnet feature development (including staking, cross-shard transactions, beacon chain cross-links, etc.) For the explorer, we have a remote part-time engineer helping to maintain and develop on it. ZKP is definitely a high-impact direction that we are going to achieve, but it’s not the highest priority yet before the full mainnet release. ZKP will be the top priority after the full mainnet.

Sonny | Harmony CM

@fifafifa123 wants to know why harmony is replacing PoW with PoS? He would also like to know what the difference is between beacon chain to the other blockchain

Rongjian Lan | Harmony

From a high-level point of view, PoS and staking economy is the trend of the whole blockchain industry. From technical, PoS is both more energy-efficient and more secure compared to PoW. Research has been done showing that new blockchains with PoW will have a hard time guaranteeing security given the lack of hashing power and the low cost of attack. However, PoS will deter the 51% or 66% attacks because the cost of the attack is literally the same as the stake they put. So they won’t have the incentive to attack the system where they hold lots of token in it.

Sonny | Harmony CM

Speaking about PoW, @ddantes71 asks “but why isn’t proof of work scalable for the consensus used on the beacon chain? It seems much more robust to black swans”

Rongjian Lan | Harmony

Our beacon chain takes care of secure randomness generation, staking, sharding and resharding, crosslink registration. These features also appear in other projects such as Eth 2.0. So on a high level, it’s achieving similar functionalities.

PoW doesn’t have instant finality, which means there will be forks on the chain. For a sharded blockchain to have consistent cross-shard communication (transactions), stable chain formation and instant finality are very critical.

That’s why we use FBFT consensus is fast and provide instant finality, which is good for cross-shard communications.

Sonny | Harmony CM

Back to @KoenApps, he’s noticed that even with few blocks it takes hours (7 and counting) for the blockchain to sync, mostly because sync only marginally outpaces new block creation, and wants to know how will this scale when new nodes want to join after it’s been running months/years?

Rongjian Lan | Harmony

Good question again. Right now, the new nodes need to download all the blockchain history to be able to validate new blocks. This is a temporary situation as we are going to implement the fast state syncing feature original designed in the whitepaper. Expect that sync time to reduce to just 1–2 hours no matter how long the chain grows in Q4 this year.

Sonny | Harmony CM

Still, on nodes, I have another one from @ddantes71. His question: “Is the secret key for each node during the randomness generation just the nodes private key?”

Rongjian Lan | Harmony

The node validators need two keys, one is the ECDSA key for holding the token and staking, another is the BLS key for signing consensus messages. The answer to the question is Yes, we implemented the VRF with BLS signatures. The key used for randomness will be the same BLS key for consensus validating. No additional key is needed for the randomness.

Sonny | Harmony CM

Another one from @KoenApps: “Are there any concrete plans with the “Harmony Developer Community” and where do they fit into the overall landscape?”

Rongjian Lan | Harmony

At the same time of active development of our full mainnet, we are starting to prepare the developer documentation and SDKs so we are start engaging developers to create Dapps on Harmony. We are also starting an ecosystem fund to incentivize or fund promising developer’s project to be launched on Harmony.

Sonny | Harmony CM

@ddantes71 wants to know “How the history of each shard is maintained between epochs?”. He also wants to know “What if a malicious leader is chosen for an entire epoch? This goes beyond just transaction consensus assurance discussed in 3.3. What if the leader stalled the entire chain for an epoch? Would the shard just be stuck with this before an eviction could occur at the next epoch?”

Rongjian Lan | Harmony

The history of shards will stay in the shard regardless of epoch changes.

A malicious leader can’t stall the shards because we added the view change protocol which will swap the malicious leader out with a new leader. Besides, we will switch leader for every 40 blocks so it won’t be a single leader who lives through the whole epoch, but every validator will have at least one chance of becoming the leader.

In short, the shard won’t get stuck thanks to the view change protocol.

Sonny | Harmony CM

Speaking of validators, @fifafifa123 is asking what “voting share is algorithmically adjusted” means?

Rongjian Lan | Harmony

In the original whitepaper, the staking model is a preliminary high-level guideline for the token requirement. Algorithmically adjusted means the requirement will change based on the total staking, rather than a fixed target. The latest specific staking design is called EPoS, please refer to this article for the final details of staking in Harmony: https://medium.com/harmony-one/introducing-harmonys-effective-proof-of-stake-epos-2d39b4b8d58

Sonny | Harmony CM

@ddantes71 is asking how the number of shards was decided and what is meant exactly by the “identity register” in the beacon chain?

Rongjian Lan | Harmony

Initially, the number of shards is set to 4. In the future, the community will decide to increase the number of shards via on-chain governance with ONE token voting.

“Identity register” means registering which node is validating for which shard, so the validators know the identities of their peer validators in the same shard and also in other shards.

Sonny | Harmony CM

@ddantes71 would also like you to touch on the reason why sending the block-header during the announce phase of the PBFT is necessary rather than just sending the main block to be signed and cut down the total round trip. He’s also interested in knowing “When a transaction is broadcasted, how is the shard it is broadcasted to determined? If it’s up to the user couldn’t he/she just DDOS the shard?”

Rongjian Lan | Harmony

The first round of the BFT consensus is mainly for the validator to agree on the order of the blocks by their hashes, so header itself is enough. The second round will involve the actual validation of the block content. The reason we won’t broadcast the whole block in the first round is to avoid the bottleneck of broadcasting the block at first and reduce overall network latency.

The transaction is first broadcasted to the whole network and only the corresponding shards will acknowledge them. The user can also choose to connect to specific shards and send transactions directly to the node in that shards. The potential DDoS will be prevented by the transaction fees required.

Sonny | Harmony CM

Under what scenario would communication between two non-beacon shares be valuable?

Rongjian Lan | Harmony

The communication between non-beacon shards will be important for the cross-shard transaction to happen. To send token from Shard A to shard B, Shard A needs to send a cross-shard message (a receipt) to the Shard B.

Sonny | Harmony CM

The group is now open

Sonny | Harmony CM

@ddantes71 has another question “What attacks are theoretical possibly if the random number is known before the pre-image is committed to the chain?”

Rongjian Lan | Harmony

Theoretically, the attacker can choose their validator keys so that with the random number they know, their keys will go into the same shard and shard overtake attack can happen.

Sonny | Harmony CM

Is the mechanism used for the PBFT consensus in transactions the same used on the VDF pre-image?

Rongjian Lan | Harmony

It’s not the same, but both need to be initiated by the leader.

Anton | Community Member

Thanks for the responses @RongjianLan. I was wondering why, in your opinion, a fully-sharded POS system is superior to a Directed Acyclic Graph (DAG) consensus model? I hear a lot of hype around DAG and wanted to hear your thoughts whether it’s overblown or not.

Rongjian Lan | Harmony

@somebodyontelegram DAG is another scaling solution. DAG doesn’t have instant finality and it also has the problem of potential data conflict and redundancy. So as a scaling solution, sharding is definitely more scalable and efficient than DAG.

Edmund | Community Member

Also was the question of how transactions are distributed across shards asked? Is it just randomly assigned seeded on the random number for the epoch?

Rongjian Lan | Harmony

@ddantes71 transactions have two fields in the data structure “ShardID” and “ToShardID”, the “ShardID” will determine which shard that transaction will be routed to and the “ToShardID” will determine whether it’s a cross-shard transaction. These two fields will be filled in by the client-side.

Rongjian Lan | Harmony

But DRG randomness requires consensus to lock pre-image of the randomness.

Azula | Community Member

@RongjianLan, looking back at development progress made the last few months, what is the biggest lesson learned and how are you planning to drive development going forward any differently? In particular, e.g. roles in the teams, team size, testing periods, outsourcing, crowdsourcing certain elements more e.g. Pangaea, etc.

Rongjian Lan | Harmony

@Azula_Agni, For the past few months, we’ve made a lot of progress on mainnet development. I would say the biggest lesson learned is that launching a blockchain system is extremely complicated and it requires significant planning and testing before it’s ready. This is especially true for a sharded blockchain as rather than one complicated consensus groups, we are 4 groups of nodes that are interacting with each other. Any of the feature upgrades and releases will require a huge amount of careful thinking to make sure it won’t break the consensus.

Edmund | Community Member

Wait, so I could just spam transactions to a single shard?

Rongjian Lan | Harmony

@ddantes71 you can if you have enough money to pay for the transaction fees. Invalid transactions won’t be accepted by the shard tho.

Sonny | Harmony CM

We have 6 minutes left before RJ gets back to his extremely busy schedule…

Edmund | Community Member

Yep appreciate the responses RJ, gonna go back to the white paper and fill in the holes in my understanding

Also probably should have looked through the codebase, is there a readme somewhere there yet? Like some sort of internal documentation?

Rongjian Lan | Harmony

@ddantes71 for sure, there are still a few core features expected to come in the next few months, including open staking, resharding, crosslinks, etc. For the documentation, you can follow our README in the GitHub: https://github.com/harmony-one/harmony. That will help you start a local test environment pretty quick.

For the document of the code structure, you have to dig into each folder.

Azula | Community Member

@RongjianLan Have you heard of CasperLabs, and can you share any thoughts on how Harmony sharding is superior?

Rongjian Lan | Harmony

@Azula_Agni that’s a big question to answer shortly. Harmony will have faster block latency and instant finality compared to Casper consensus. And most importantly, we will deliver the mainnet sooner than Casper 🙂

Azula | Community Member

Haha you told me everything I needed to hear right now ❤️

Rongjian Lan | Harmony

Alright, thanks guys for the questions! I really enjoyed interacting with our lovely Harmonians! Talk to you next time!

Sonny | Harmony CM

And that’s a wrap, folks 🔥

We’ll like to thank @RongjianLan for taking the time out of his extremely busy schedule to address the community’s technical concerns. We are hoping to have more of these themed sessions down the line.

If you’re a developer interested in progressing your understanding of the Harmony Protocol and the opportunity for #BUIDLing on Harmony, join us.

Harmony

To scale trust for billions of people and create a radically fair economy

Nikolaos Kostopoulos

Written by

Advising governments & interest groups on cryptocurrency & FinTech regulation in the European Union.

Harmony

Harmony

To scale trust for billions of people and create a radically fair economy

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade