2. Technology of Harmony Protocol

Nevin Freeman (CEO of Reserve Protocol)

I’m sure it’s complicated, but what is “deep sharding”?

Nick White (co-founder of Harmony Protocol)

Deep sharding is a term we use to describe our unique approach to sharding. It refers to the fact that we don’t just optimize the consensus layer/software layer like most protocols do, we also take it a step deeper and optimize the transport layer or “layer 0” which is the networking of the protocol itself.

It is this full-stack optimization that is signature to Harmony and what we call “deep sharding.” This allows us to remove many bottlenecks that continue to hold back other protocols, even sharded ones, and achieve great performance.

Nevin Freeman (CEO of Reserve Protocol)

Yeah, this is interesting. I think the transport layer is something that doesn’t get much attention in the crypto space. Can you mention what that is and why it’s important?

Nick White (co-founder of Harmony Protocol)

Sure. The transport layer is essentially the internet protocol layer, ie. TCP/IP. The actual way in which data and packets are sent around the network.

The reason it’s important for blockchain is that blockchain requires a lot of communication to achieve consensus.

One big example of this is block propagation. Blocks are big chunks of data and they are proposed by a leader who needs to send them to all his peers. This can take a long time. In our case, we devised a way speed this up significantly using erasure coding. It’s a technique we call “Adaptive IDA.”

The faster you can propagate blocks, the more blocks you can mine, the more transactions you can verify, the more TPS you can achieve. Plus, it also reduces time to finality of transactions.

Nevin Freeman (CEO of Reserve Protocol)

OK, interesting. And I take it you guys think this is a better way to do it than all other platforms. If so, what do you think was the key to figuring it out that others missed? Or put a different way, what was the process you had to go through to solve this puzzle that has been hard for others to solve?

By the way, we know how hard it can be to explain your tech. We spend a lot of time trying to do it for Reserve and it’s tough to get it across, so thanks for giving it your best. We’ve been contacted by many smart contract platforms and eventually ran out of time to even evaluate them all, so that was part of the reason we wanted to chat today 🙂

Nick White (co-founder of Harmony Protocol)

I think the common discourse got caught up with the consensus layer and forgot about some of the other low hanging fruit. And to clarify, we aren’t the only ones targeting the transport layer. There is also Bloxroute working on this problem. But they are doing it as a separate layer 0 for all blockchains.

Our insight was that we didn’t want to separate the optimizations we were making on the transport layer from the optimizations we were making on the consensus layer. We needed to do them both together.

So, you can think of our platform like an Apple product. Apple controls the the hardware of the device, the software, the OS, and sometimes even the chip it runs on. They vertically integrate the whole stack to optimize performance and the user experience.

We apply the same philosophy to our blockchain. Owning and optimizing each piece to maximize performance.

If you do it separately like Bloxroute, you won’t be able to get the same results. There’s no coincidence that we have Apple engineers on our team 😊

Nevin Freeman (CEO of Reserve Protocol)

The Reserve engineering team is thinking about bridging the RSV token over to Harmony after we launch on the Ethereum mainnet, so users could move the token across both platforms and use it in contracts on both. I asked them to join us so they could ask your team a few technical questions about how Harmony works to make sure this will be feasible.

I think one of your engineering minds is here to discuss this.

Jeremy Schlatter (Tech Lead of Reserve Protocol)

Hi, all! 👋I’m Jeremy, an engineer with Reserve. Nick, it sounds like you are taking advantage of the transport layer optimizations to not just speed up existing designs but to also make some changes to the consensus algorithm that would not otherwise be possible. Is that right?

Nick White (co-founder of Harmony Protocol)

It’s more that you need to think of optimizations at both layers in tandem as they affect the design of one another. If we chose a different consensus algorithm than our FBFT it may make our design of Adaptive IDA different. So it’s about how each choice affects the others.

If they are developed separately then they may be individually optimized but not fit together as well as a complete whole.

Nevin Freeman (CEO of Reserve Protocol)

We have a question from our community.

What is the estimated transaction cost for Harmony once it is developed and adopted to the level of Ethereum nowadays?

Nick White (co-founder of Harmony Protocol)

That’s a great question! This is something we’ve thought carefully about. How can we drive the cost down. We don’t have a final estimate, but when I did a back of the envelope calculation a while back it was many orders of magnitude cheaper than Ethereum.

I don’t want to give a final answer because there are too many variables and I don’t want to misrepresent. We will see when we do more real world testing as we approach launch.

Rongjian Lan (co-founder and CTO of Harmony Protocol)

I did a calculation on the transaction cost. To estimate the transaction fee/cost, we should compare Ethereum as a whole with a single shard of Harmony because the cost of processing a transaction is only incurred on a single shard. Based on https://digiconomist.net/ethereum-energy-consumption, the global mining cost of Ethereum is $799,429,388 annually.

In comparison, for a Harmony shard with 600 nodes (assuming each running a AWS t3.large instance), the total cost is around $40 * 600 * 12 = $288,000. With all other overhead and storage cost considered, the final cost won’t go too far beyond $1 million. So in the network cost perspective, Harmony’s shard is around 1000 times cheaper than the Ethereum.

Matt Elder (CTO of Reserve Protocol)

What security models are you using to model the overall operation — block transmission and consensus — for your system? Under those models, how expensive are various attacks?

Rongjian Lan (co-founder and CTO of Harmony Protocol)

We model our system under a <25% total malicious stake assumption. And our consensus in each shard is 33% malicious-stake tolerable for liveness/consistency and 66% tolerable for consistency. Under this model, we designed our system to be secure over hundreds of years without problem. Under this model, to stop the liveness of the system, it takes at least 25% of the total network stake. To break consistency of ledger data, it will take more than 50%.

Matt Elder (CTO of Reserve Protocol)

Does this apply to the transport layer as well as the consensus layer?

Rongjian Lan (co-founder and CTO of Harmony Protocol)

Transport layer security is guaranteed by existing networking protocols. The concern on transport layer security is less as we can always use retry to make the message delivered. And use cryptography to make sure the integrity of the message. For consensus layer, yes, the model is built for our consensus’s requirement.

Jeremy Schlatter (Tech Lead of Reserve Protocol)

One of the difficulties of building a bridge like this will be cost minimization. One part in particular that may be expensive is running light client verification of Harmony blocks on-chain on Ethereum. Do you have plans at Harmony to minimize the costs of light client verification?

Rongjian Lan (co-founder and CTO of Harmony Protocol)

Exactly, our design of epochs will minimize the storage light-client needs. They don’t need to have all the block headers in the history, but only the headers of the epoch blocks with the necessary block linkage to them during epoch. This will significantly reduce the redundant info light-client needs to store. Also, our consensus naturally contains checkpointing as it’s signatures-based consensus. So light-client can prune the history data as needed.

Nevin Freeman (CEO of Reserve Protocol)

A question from the community. What does the Harmony team think of the work being done by Zilliqa? Does Harmony make Zilliqa redundant or unnecessary?

Nick White (co-founder of Harmony Protocol)

The Zilliqa team were one of the first to apply the concept of sharding to blockchains. For that they were extremely innovative and we have learned a lot from their example.

I would say that we have taken some of their concepts and improved upon them and added a lot more of our own. I think it’s important to have diversity of base layer chains so I wouldn’t say they’re redundant, I would just say we’re better optimized for certain things.

For example, we are fully state-sharded and use PoS. Zilliqa does only transaction sharding and PoW.

PoS saves a lot of costs because the security doesn’t depend on burning electricity. And state sharding makes you more scalable as each shard only keeps track of its own state, not the entire state of the network.

Nevin Freeman (CEO of Reserve Protocol)

Are there some use-cases you think Harmony isn’t well optimized for, or do you think that if enough people adopt it and it gets a strong network-effect it could kinda be the single smart contract platform that operates everything from currency to games to things we haven’t even thought of yet?

Nick White (co-founder of Harmony Protocol)

As a general purpose smart contract platform, we feel that we can support most any application. And yes, I think for smart contract platforms, network effects are the name of the game. Ethereum is powerful because that’s where the ecosystem is and that’s what makes blockchain unique. Open development means that assets can interact with one another, dapp protocols can be combined to be greater than the sum of their parts.