The Official Guide to Harmony Public Staking
和梦链Harmony
2020-04-14 03:15
本文约3953字,阅读全文需要约16分钟
In Harmony's token economic model, relatively higher rewards are given to early mortgagers in order to successfully launch the network. For validators or delegators who want to participate in Harmony public staking, this guide will help you get start

Harmony is the first fully sharded production-grade PoS mainnet. Among the 4 shards in the Harmony main network, blocks are generated every 8 seconds, and cross-shard transactions can be completed within 2 block times.

Harmony's Effective Proof of Stake (EPoS) is the first staking mechanism in a sharded blockchain that is both secure and decentralized. EPoS allows hundreds of verifiers to pledge at the same time, and the original effective mortgage mechanism reduces the tendency of mortgage concentration. At the same time, functions such as delegation, compound interest, double signature slashing and unavailability check are also supported.

In Harmony's token economic model, relatively higher rewards are given to early mortgagers in order to successfully launch the network. for those wishing to participateHarmony Public Stakingsecondary title

Validator setup and configuration

Validators in the Harmony blockchain can be individuals or companies who validate blocks by staking tokens and running nodes (validator client software). Validators can create one or more validation private keys (also known as BLS private keys) that will be used to sign on validated blocks.

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

  1. herehereRun node.

  2. herehereCreate a validator.

  3. You will add a BLS private key to the verifier record, and the node associated with this private key will start verification.

    There are many terms in the validator configuration process, here we explain them in detail for you:

  1. quantity:The amount of ONE tokens that a validator will stake initially.

  2. Rates:The commission (%) taken by validators from rewards. (See chapter: Block Rewards)

  3. bls-pubkeys: One or more BLS public keys that the verifier will use to sign. Each BLS public key will be used individually to bid for a seat, and if successful, the public key must be used to validate the block. (Please refer to the "Seat Bidding and Selection" section)

    secondary titlehere

Seat bidding and selection

In the public staking on the mainnet, there will be 320 seats available for bidding (including 200 seats in Stake Heist). A seat represents a membership of a committee in the network, which enables a validator to sign a block with a specific BLS private key, and this signature will be known to other validators later.

After creating a validator record, your staked tokens, and the tokens staked to you by delegators, will automatically be used to bid for seats.

Each added BLS private key will place an auction in the network. This bid is equal to the validator's total stake divided by the number of BLS private keys attached to the validator.

In short, all coins of the validator will be shared equally on each BLS private key, and each BLS private key bids separately. For example, if a verifier has 300 ONE and is associated with 3 BLS private keys, then it will place 3 bids, each with a price of 100 ONE.

Seats are selected as follows:

  1. Before starting an epoch, all validators are arranged in descending order of bidding.

  2. The top 320 get 320 slots for the upcoming epoch.

    The BLS private key representation of the successful bid for the seatelected. The elected BLS private keys will eventually form the shard committee. Therefore, a validator with a successful BLS key election is also consideredimage description

Suppose 5 candidates compete for 10 seats

secondary titleLink。 

Epoch conversion

In the Harmony mainnet and Stake Heist, there are 4 shards, and each shard generates new blocks in parallel. Block heights are not synchronized between shards, so you will see different block heights for different shards.

An epoch is the time period during which a beacon shard (such as shard 0, the coordinator of other shards) produces a fixed number of blocks. In the Harmony mainnet, in beacon sharding, one epoch is 2¹⁴ = 16384 blocks (about 1.5 days). After completing an epoch in the beacon shard, the change will also be propagated to other shards, so all shards will be in sync within an epoch.

secondary title

Shard allocation

secondary title

Effective pledge

Effective pledge is a new concept introduced in the EPoS mechanism, the purpose is to prevent the centralization of rights and interests while providing capital fairness. As for how it is implemented, here are the design principles behind it.

We call the bid for the elected BLS private key the original pledge. The effective stake of an elected BLS private key is a finite value of its original stake with a threshold around the median bidder's original stake (denoted as mean_stake in the diagram below). The high threshold is 115% of the median and the low threshold is 85% of the median. For the BLS private key whose original mortgage exceeds the threshold, its effective equity will be limited by the corresponding threshold, otherwise, the effective equity is the same as the original equity.

image description

secondary title

Shard Councils and Voting Rights

After election and shard distribution, the BLS private keys distributed in a shard become committees for that shard. of the BLS private keys elected in the committeeVoting rightsis an indicator used to measure the weight of private keys in the consensus voting process. The total voting power of the shard committee is always 1.0 (or 100%). The consensus of the committee can only be reached when more than 2/3 of the voting power is obtained in the voting.

Each BLS private key in the committee has certain voting rights, withThis voting power is related to its share of the effective stake in the entire committeesecondary title

block reward

For each block produced and confirmed in a shard, it should contain key signatures from more than 2/3 of the total voting power of the shard committee. Each confirmed block will generate a block reward of 28 ONE for validators behind the committee. 28 ONE is initially allocated to all validators of the BLS private key that signed the block, proportional to the voting power of the signed private key.

After collecting the commission, the block rewards received by the verifier will be further distributed to the delegators in proportion. For example, a validator with a commission rate of 25% assigns 4 "1"s to the block it signs. The verifier mortgages 1000 ONE himself, and it has 2 delegators, each delegator has 1000 ONE. The block reward distribution for this validator is as follows:

  1. A commission of 1 ONE (4 ONE * 25%) is deducted from the original reward and credited to the validator's account.

  2. The remaining 3 ONE rewards will then be distributed proportionally to all stakers (including validators and their delegators) according to their stake. Since the stakers (the validator and the two delegators) staked/delegated 1000 ONE each, they each get 1 ONE in the reward distribution.

    For more information on block rewards, please refer to oursecondary title

Double signature slashing mechanism

If any BLS private key is detected to have signed a conflicting block (i.e. with the same height and view ID but a different block hash), the validator will be slashed and permanently banned from the network. When the verifier is slashed, a certain percentage (ie, the slash rate) of the staked tokens from the verifier and its principals will be confiscated, half of which will be destroyed, and the other half will be given to the whistleblower of the double-sign event.

secondary title

Uptime and Unavailability Penalties

Elected validators are obliged to use their elected BLS private keys to validate blocks. At each epoch, the elected validators should sign more than 2/3 of the required signatures of the BLS key.

Signature completion is determined by "uptime" is expressed as a percentage value. A validator's uptime is the ratio of "signatures" signed by its elected BLS private key to the total number of private keys "should sign". For example, a validator has 2 elected BLS private keys , and each private key has 100 blocks to sign. In the final prompt, the first key signed 70 blocks, and the second key signed 80 blocks. In this way, the verifier's normal The running time is (70+80)/(100*2)=75%.

At the end of each epoch, validators whose uptime does not exceed 2/3 (66.66%) set their status to "inactive" and are excluded from new elections. For these invalid validators, they are required to sendEditValidatorsecondary title

Delegation and Reward Collection

For those looking to participate in staking without running a validator, delegation is the best way to stay engaged and earn big rewards. Harmony ONE token holders can delegate their tokens to existing validators using our stake explorer:https://staking.harmony.one/. If tokens are delegated to an elected validator, a portion of the block rewards earned by the validator will be credited to the delegator (see the "Block Rewards" section).

secondary title

cancel delegation

If a delegator decides to stop delegating to a validator, he or she can choose to withdraw his or her tokens from the validator. After withdrawing tokens from the validator, the tokens will be locked for 7 epochs and then credited to the delegator's account balance. Note that undelegated tokens can only be unlocked at the end of each period. Locked tokens can still be slashed if validators use dual signatures.

secondary title

summary

secondary title

A few links you might be interested in:

Scan the QR code to join the Harmony Chinese community

和梦链Harmony
作者文库