Introduction

What is Harmony?‌

Harmony is a fast and secure blockchain for decentralized applications. Our production mainnet supports 4 shards of 1000 nodes, producing blocks in 5 seconds with finality.

Our Effective Proof-of-Stake (EPoS) reduces centralization while supporting stake delegation, reward compounding and double-sign slashing.

Harmony aims to build an open network of nodes operated and governed by a large community. This node community is called Pangaea.

Are we decentralised yet? There’s no consensus without participation. At the moment, the network has a total of 640 slots which are filled by more than 80 validators. Harmony consists of volunteers and validators from more than 100 countries and most of them have never run a node before.

Key Features

Secure, Random State Sharding

Harmony has transcended the blockchain trilemma by bringing the best research to production. Sharding is proven to scale blockchains without compromising security and decentralization.

We divide not only our network nodes but also the blockchain states into shards, scaling linearly in all three aspects of machines, transactions and storages.

To prevent single shard attacks, we must have a sufficiently large number of nodes per shard and cryptographic randomness to re-shard regularly. Each shard has 1/4 of nodes for strong security guarantee against Byzantine behaviors. We use Verifiable Random Function (VDF) for unbiasable and unpredictable shard membership.

Fast Consensus w/ Instant Finality

Harmony has innovated on the battle-tested Practical Byzantine Fault Tolerance (PBFT) for fast consensus of block transactions. Our Fast BFT (FBFT) leads to low transaction fees and 1-block-time finality in Harmony Mainnet.

We use Boneh–Lynn–Shacham (BLS) constant-sized signatures to commit blocks in a single round of consensus messages. We achieve 5-second block time with view changes in production against adversarial or unavailable leaders.

Harmony Mainnet was launched in June 2019. Our network has produced 10M+ blocks with 20k+ transactions in publicly traded, native ONE tokens.

Effective PoS & Token Economics

Harmony has designed a novel Proof-of-Stake (PoS) mechanism for network security and economics. Our Effective Proof-of-Stake (EPoS) reduces centralization and distributes rewards fairly to thousands of validators.

Our staking mechanism supports delegation and reward compounding. To support 100% uptime but fully open participation, EPoS slashes validators who double-sign and it penalizes elected but unavailable nodes.

Harmony Economics Model caps the annual insurance at 441 million tokens (about 3% rate in long term). Our model gives validators a simple and predictable return. All transaction fees are burnt to offset the insurance, naturally leading to zero inflation when our network usage becomes high.

Core Concepts

Sharding

Harmony blockchain is sharded in three dimensions: state, network and transaction.

  1. State Sharding

    In Harmony, each shard maintains it's own chain of blocks and state database. Therefore, the validators of each shard only need to store 1/N of the global state, where N is the number of shards. The consistency between states from different shards are guaranteed by the property of eventual atomicity of cross-shard transactions, which guarantees that double spending between shards can not happen.

  2. Network Sharding

    Harmony's validator network is also divided into shards where each shard involves a separate set of validators connected closely with each other and running consensus between themselves. Most of the time, validators communicate with other validators within the same shard to reach consensus or synchronize blocks. In cases of cross-shard transactions and beacon chain synchronization, validators from different shards send messages across shards through the globally connected network.

  3. Transaction Sharding

    Transactions in Harmony blockchain are sent to and processed by a specific shard instead of all shards. This way, shards can process transactions in parallel which greatly improves the overall transaction processing capacity of the blockchain. Users need to specify a field named shard_id in the signed transaction which indicates which shard this transaction belongs to. For cross-shard transactions, another field named to_shard_idis needed to indicate the destination shard while the shard_id field indicates the source shard.

Epochs

An epoch in Harmony blockchain is a pre-determined period of time when the validator committees of shards stay unchanged. In Harmony mainnet, one epoch is 16384 blocks which translates to about 23 hours. In Harmony testnet, one epoch is 38 blocks which is around 3 minutes.

When one epoch ends, the election for the new validator committees will be conducted in beacon chain and the result (i.e. shard state) will be written in the last block of the epoch in the beacon chain. After that, beacon chain enters the new epoch with the new validator committee producing blocks. Once beacon chain enters new epoch, all the other shards will follow and also enters the new epoch. The new shard state from the beacon chain will be written in the new block of the shards which also marks the last block of the epoch for that shard.

Block Finality

Block finality refers to the concept that a proposed block is finalized by the blockchain and can not be reverted or the cost of reversion is prohibitively high. Block finality is usually measured by how long it takes for the newly proposed blocks to be finalized. For example, in Ethereum, it takes more than 6 blocks or 1 minute to have reasonable confidence that the block is finalized and can not be reverted.

Thanks to the nature of Harmony‘s FBFT consensus, blocks can be finalized as long as the 2/3 majority quorum is reached on the block. On Harmony mainnet, it usually takes around 2-3 seconds to finalize a newly proposed block. (Note currently a new block is proposed every 5 seconds on mainnet, which is also known as block time. Soon the block time on mainnet will be updated to 3 seconds)