-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BEP-159: Introduce A New Staking Mechanism on BNB Beacon Chain #159
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
owen-reorg
changed the title
doc: add new staking bep
BEP-159: Introduce A New Staking Mechanism on BNB Beacon Chain
Aug 31, 2022
unclezoro
previously approved these changes
Sep 28, 2022
BEP159.md
Outdated
|
||
This BEP introduces a permissionless validator election mechanism and brings the staking economy onto Beacon Chain. | ||
|
||
Anyone can stake their BNB to become a validator candidate or delegate their BNB to the validator candidates they trust. The validator set will be determined by the rank of the accumulated bonded tokens on validator candidates. The validators will be responsible for producing new blocks, In return, they will get block rewards, and share the rewards with delegators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In return
-> in return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
unclezoro
force-pushed
the
new-staking
branch
from
December 21, 2022 03:13
c20ab70
to
747f636
Compare
unclezoro
approved these changes
Dec 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BEP-159: Introduce A New Staking Mechanism on BNB Beacon Chain
1. Summary
This BEP introduces a new staking mechanism on the BNB Beacon Chain to increase openness and provide economic security.
2. Abstract
This BEP introduces a permissionless validator election mechanism and brings the staking economy onto Beacon Chain.
Anyone can stake their BNB to become a validator candidate or delegate their BNB to the validator candidates they trust. The validator set will be determined by the rank of the accumulated bonded tokens on validator candidates. The validators will be responsible for producing new blocks, in return, they will get block rewards, and share the rewards with delegators.
By implementing this, the BNB holder has superpower to contribute to the security and gain reward. Staking BNB grants the right to vote on proposals and make decisions on the future of the network.
3. Status
This BEP is a draft.
4. Motivation
Currently, the BNB Beacon Chain is secured by a set of trustworthy and preapproved validators. The entrance and exit of a validator are governed by the current validator set. Although this system has high bandwidth, immutability aspects are called into question as censorship and blacklisting are easily implemented.
On the other hand, the BNB Beacon Chain aims to enhance the security of BSC as a staking and governance layer. After the decommissioning of DEX in BEP-151, Beacon Chain spares more computing power for security and governance focuses. It is good timing to introduce a BSC-like staking mechanism on Beacon Chain. With this BEP, anyone can compete to join as a candidate to be elected as a validator. The staking status decides the top staked nodes to be the next validator set, and such an election will repeat every 24 hours. The elected validators will be responsible for producing new blocks. The community will decide the total seats of the validator set. It will bring in more decentralization and community involvement.
5. Specification
5.1 The Current Staking Mechanism
The current staking mechanism is conservative:
5.2 The New Staking Mechanism
After the implementation of this BEP:
5.2.1 Staking Operation
Data Structures for Staking Operation
CreateValidator
EditValidator
Delegate
Redelegate
Undelegate
5.2.2 Validator Set Update
In the current implementation, the validator set will be updated immediately after the associated proposal is approved.
After the implementation of this BEP, staking becomes easy with low cost. So staked BNB ranking might change frequently. To reduce the instability of the network, the validator set update will happen in the first block after UTC 00:00 (which is known as the breath block).
Since the stake volume on the BNB Beacon Chain is smaller than that on the BNB Smart Chain, it might risk that some malicious users take control of the majority of Beacon Chain validators and fake BSC validator set or cross-chain packages, thus harming the whole ecosystem. We will rank the validator candidates by accumulated staked BNB across a period(e.g. 30 days) instead of the current staked BNB. This mechanism will make the attack harder since it needs more time or more BNB to invoke. It will only affect the validator set election, not the voting power in consensus or governance.
5.2.3 Reward Distribution
Currently, the reward for BC validators is mostly from transaction fees on Beacon Chain and goes directly to the validators' wallets.
After the implementation of BEP-151, the decentralized exchange will be decommissioned from Beacon Chain. There might not be enough incentives for BC validators.
This BEP proposes that:
fees * baseProposerReward
fees * bonusProposerReward * P
, whereP = (total number of validators with included precommits / total bonded validator number)
. The more precommits the proposer includes, the larger P is. P can never be larger than 1.00 (since only bonded validators can supply valid precommits) and is always larger than 2/3.FeeForAll
part will go to a fixed address and theFeeForProposer
part will go to a custody address which is derived from the proposer’s validator address. Nobody can spend money in theFeeForAll
address and validators’ custody addresses. They can only be distributed to validators and delegators during the reward distribution period.5.2.4 Disable Previous Transaction Types for Updating Validators
Since a new validator set update mechanism is introduced, the previous transaction types for updating validators can be disabled. Sending transactions with message type
MsgCreateValidatorProposal
will be rejected after implementing this BEP.5.2.5 Validator Number and Block Interval Change
There is a parameter MaxValidators that controls the max validator number.
It's 21 right now, which is configured in the genesis block.
However, there are only 11 validators on Beacon Chain Mainnet currently.
After the implementation of this BEP:
5.2.6 Oracle Relayers
The oracle relayers are responsible for relaying cross-chain packages from BSC to BC. Currently they are separated services maintained by BC validators.
After the introduction of open staking mechanism, oracle relayers might also change frequently along with validators. It might affect the stablility and security of the cross-chain process.
To ensure the security of the network, this BEP proposes to keep the current preapproved validators as a whitelist to run the oracle relayers. When the stake volume of Beacon Chain becomes stable and big enough, the whitelist can be removed, and make the validators in charge of running oracle relayers again.
5.3 Change Impacts
5.3.1 Impact on BSC Validators
They will have to pay extra fees to BC validators for security. They can also stake to be BC validators themselves.
5.3.2 Impact on BC Validators
The staked BNB of BC validators will not only be from themselves but also the delegators. They might have to improve their reputation and attract more delegators to compete for becoming validators.
5.3.3 Impact on BC users
They can delegate BNB to BC validators they trust to help secure the network and earn rewards.
5.4 Implementation Procedure
Phase1: Open self delegation for validators, enable new reward distribution and new validator election mechanism. The current validator should delegate enough BNB to ensure it won't be elected out in phase2.
Phase2: Open validator creation. Anyone can stake enough BNB to become a validator of Beacon Chain.
Phase3: Open delegation. Anyone can delegate their BNB to a validator and get reward in return.
5.5 Outlook
This BEP proposes a new staking mechanism, which moves a big step forward in decentralization and community involvement.
However, there are more things that can be done to enhance the network and facilitate the community. Here below are some topics to dig into:
We might create more BEPs on these in the future.
6. License
The content is licensed under CC0.