The Definitive Guide to Harmony Open Staking

Rongjian Lan
Apr 8, 2020 · 9 min read

Harmony is one of the first production mainnets to feature a fully sharded PoS architecture. Across the 4 shards in Harmony mainnet, blocks are produced every 2 seconds and cross-shard transactions are finalized in 2 block times.

Harmony’s Effective Proof-of-Stake (EPoS) is the first staking mechanism in a sharded blockchain that achieves both security and decentralization. EPoS allows staking from hundreds of validators and the unique effective stake mechanism reduces the tendency of stake centralization. Meanwhile, stake delegation, reward compounding, double-sign slashing, and unavailability checking are also supported.

Our token economics model incentivizes early stakers with higher rewards to bootstrap the network successfully. For those validators or delegators who would like to join Harmony Open Staking, this guide will help you get started and learn about how everything works.

Validator Setup and Configuration

To become a validator in Harmony, you will need to do the following:

  1. Setup a validator node(s) and let it fully synchronized with the latest blockchain. Please follow here to run a node.
  2. Create an on-chain validator record by sending a CreateValidator transaction. Please follow here to create your validator.
  3. Start validating using the node(s) with the BLS key(s) you added in your validator record

There are many fields to configure for your validator. It’s worth clarifying some of the important fields in more detail:

  1. amount: The amount of ONE tokens the validator will stake initially.
  2. rate: The commission fee (%) the validator charges from the block reward. (see section: block reward)
  3. bls-pubkeys: One or multiple BLS public keys the validator will sign with. Each BLS key will be used separately to bid for a slot and if successful, the key is obligated to validate blocks. (see section “Slots Bidding and Election”)

For a detailed guide on how to configure your validator, please follow here.

Slots Bidding and Election

After you create the validator record, the tokens you stake, along with any delegated tokens to your validator, will be automatically used to bid for the slots.

Each of the added BLS keys will create a unique bid for a slot in the network. The bid price equals the total stake on your validator divided by the total number of BLS keys attached to your validator.

Simply put, all tokens staked to the validator will be equally divided into each BLS key and each key bids separately. For example, a validator with a total stake of 300 ONE and 3 associated BLS keys will have 3 bids each with a bid price of 100 ONE.

The election for the slots works as follows.

  1. Before the start of an epoch, all validator bids are ranked by bid price in descending order.
  2. The highest 900 bids will be awarded the slots in the upcoming epoch.

The BLS key that successfully bids for a slot is deemed elected. Elected BLS keys will eventually form the committees of the shards. A validator in possession of at least one elected BLS key is also deemed elected.

Example Election Process with 5 Validators for 10 Slots

Above is a simple example of bidding and election process with 10 slots and 5 validators. For more detailed examples, please read here.

Epoch Transition

An epoch is a period of time when the beacon shard (i.e. shard 0, the coordinator for other shards) produces a fixed number of blocks. In Harmony mainnet, an epoch is 2¹⁵ = 32768 blocks (~18.2 hours) in the beacon shard. Once an epoch is completed in the beacon shard, that change is also passed onto the other shards, thus all shards are synchronized by epoch.

At the end of each epoch, the committee election process will take place to elect the committees for the next epoch. The election process takes into account all the staking transactions confirmed before the election happens. The election result will take effect immediately, so we encourage all candidate validators to spin up their nodes even before the election happens.

Shard Assignment

Effective Stake

Let’s call the bid price of the elected BLS keys the raw stake. The effective stake of an elected BLS key is a bounded value on its raw stake with a threshold around the median bidder’s raw stake (denoted as median_stake in the picture below). The upper threshold is 115% of the median_stake and the lower threshold is 85% of the median_stake. For a key with raw stake that’s out of bound of the threshold, its effective stake will be bounded by the corresponding threshold, otherwise, the effective stake is the same as the raw stake.

The effective stake of each BLS key is determined at the last block of an epoch during the election process and will stay the same throughout the next epoch.

Effective Stake is Bounded around Median Stake

Shard Committee and Voting Power

Each BLS key in the committee has a certain voting power proportional to the share of its effective stake among the whole committee. For example, if the sum of the effective stake of all the keys in the committee is 10k ONE, a BLS key with effective stake of 1000 ONE will have voting power 0.1 (or 10%).

Block Reward

The allocated block reward for a validator will be further distributed to delegators proportionally to their stake after the commission fee is charged. For example, a validator with a commission rate of 25% got allocated 4 ONE for a block it signed. The validator staked 1000 ONE itself and it has 2 delegations each with 1000 ONE. The block reward distribution for this validator works as follows:

  1. The commission fee of 1 ONE (4 ONE * 25%) is cut from the original reward and credited to the validator.
  2. The rest of the reward of 3 ONE is then distributed to all the stakers (including both the validator and its delegators) proportionally based on their stake. Since the stakers (the validator and the two delegators) each staked/delegated 1000 ONE, they each receive 1 ONE in the reward distribution.

For more information about block reward, please read our token economics model.

Double Sign Slashing

The slashing rate is calculated by simply summing all the voting power of the double signing keys with a minimum of 2%. For example, if 3 BLS keys with voting power of 3%, 3% and 4% double signed at the same time, 10% of all staked tokens will be slashed on the validators who hold the 3 BLS keys.

Uptime and Unavailability Penalty

The signing performance is represented by a percentage value called uptime. A validator’s uptime is the ratio of the number of signatures its elected BLS keys signed over the total number of signatures the keys should sign. For example, a validator has 2 elected BLS keys and each of the keys is presented 100 blocks to sign. In the final tally, the first key signed 70 blocks and the second key signed 80 blocks. Overall, the validator’s uptime is (70+80) / (100*2) = 75%.

At the end of each epoch, the validators with uptime of no more than 2/3 (66.66%) will have their status set to “Inactive” and be ruled out from the new election. For these inactive validators, they are required to manually set their status to “Active” by sending an EditValidator transaction in order to participate in future elections. We encourage validators to be proactive in maintaining a high uptime to ensure they remain elected and earn the most block reward possible.

Delegation and Reward Collection

The earned block rewards are stored in a separate reward balance of the delegator, which can be immediately withdrawn to the delegator’s account balance. The block rewards can also be staked again to achieve the compounding effect of staking.



In Conclusion


To scale trust for billions of people and create a…