PoA vs PoS
Learn the differences between Proof of Authority and Proof of Stake Validator Manager contracts.
Overview
At a high level, the ValidatorManager
abstract can be used to manage the validator set on the P-Chain.
- Proof of Authority networks are secured by validators who can be added or removed from the
PoAValidatorManager
implementation by an owner address. - Proof of Stake networks are secured by validators who stake some type of tokens for a duration into an implementation of
PoSValidatorManager
.
Once the transaction confirms, the ValidatorManager
(which both PoAValidatorManager
and PoSValidatorManager
inherit) emits a warp message.
The warp message is signed off by quorum of the current validator set and submitted to the P-Chain.
The P-Chain then adds, removes or modifies the validator in the registry using information from the warp message.
Proof of Authority
There is one implementation of Proof of Authority based on the ValidatorManager
abstract called PoAValidatorManager
.
In the PoAValidatorManager
implementation, the owner of the contract can add and remove validators from the set. The owner can also set the weight of the validator.
The owner can either be a smart contract or an EOA.
Rewards
By default, no rewards are distributed to validators in the PoAValidatorManager
implementation. However, rewards can be distributed to validators by extending the PoAValidatorManager
contract and adding the desired functionality.
Parameters
The PoAValidatorManager
has a couple of parameters that it can be initialized with to fit the needs of the network. These parameters include:
ChurnPeriodSeconds
: The time period in seconds that a validator must wait before being removed from the set.MaximumChurnPercentage
: The maximum percentage of the validator set that can be removed in a single churn period.
Proof of Stake
There are two implmentations offered of Proof of Stake based on the PoSValidatorManager
abstract:
NativeTokenStakingManager
: This contract is used for staking native tokens.ERC20TokenStakingManager
: This contract is used for staking ERC20 tokens.
These are both permissionless implementations, meaning that anyone can stake tokens and become a validator.
The PoSValidatorManager
abstract also comes with a notion of delegation
. Delegators can delegate their tokens to a validator. This will increase the validator's weight and the delegator will receive a portion of the rewards.
Rewards
Rewards are calculated using a RewardCalculator
contract. The PoSValidatorManager
will distribute rewards to the validator based off their node's liveliness in consensus and after the validator is removed from the set.
In the NativeTokenStakingManager
implmentation, rewards are minted through use of the NativeMinter
precompile. Which the address of NativeTokenStakingManager
is enabled on.
In the ERC20TokenStakingManager
implementation, rewards are minted through calling the ERC20 token's mint
function.
Parameters
The PoSValidatorManager
has a number of parameters that it can be initialized with to fit the needs of the network. These parameters include:
MinimumStakeAmount
: The minimum amount of tokens required to stake.MaximumStakeAmount
: The maximum amount of tokens required to stake.MinimumStakeDuration
: The minimum duration that tokens must be staked for.MinimumDelegationFeeBips
: The minimum fee charged to delegators for delegating their tokens.MaximumStakeMultiplier
: The maximum multiplier that can be applied to a validator's weight.WeightToValueFactor
: The factor used to convert a validator's weight to a value.RewardCalculator
: The address of the reward calculator contract.
Customization
The ValidatorManager
abstract contract is designed to be flexible and can be easily extensible to fit the needs of the network.
For example, the PoSValidatorManager
abstract could be extended to include additional parameters or functionality. This can be done by creating a new contract that inherits from the PoSValidatorManager
abstract and adding the desired functionality such as NFT staking, slashing, or additional rewards for certain actions.
Last updated on