DPoS Consensus Mechanism
Delegated Proof of Stake Consensus Mechanism
Circle Layer implements a cutting-edge Delegated Proof of Stake (DPoS) consensus mechanism that ensures network security, energy efficiency, and fast finality while maintaining true decentralization.
π Consensus Overviewβ
Circle Layer adopts Delegated Proof of Stake (DPoS) consensus mechanism with low transaction cost, low transaction latency, high transaction concurrency, and supports up to 21 validators.
DPoS allows anyone to become a validator by staking specified coins. It also allows delegators to stake small amounts and to participate in network security. Any address can stake to an address that qualifies to become a validator, and after the validator's staking volume ranks in the top 21, it will become an active validator in the next epoch.
π₯ Key Benefitsβ
Energy Efficiency
Consumes 99.9% less energy compared to Proof of Work consensus mechanisms
Enhanced Security
Economic security through stake-based validation and punishment mechanisms
Faster Finality
Achieve transaction finality in seconds, not minutes or hours
True Decentralization
Low barriers to entry reduce centralization risks and promote participation
π How Consensus Worksβ
- π― Validator Selection
- π¦ Block Production
- π Reward Distribution
Validator Selection Process
Stake Requirement
Validators must stake a minimum of 32 CLAYER tokens (testnet) or 100,000 CLAYER tokens (mainnet) to participate in consensus
Top 21 Selection
Validators are selected based on their staking amount. The top 21 validators by stake become active validators in the next epoch.
Epoch-Based Rotation
Validator sets are updated at the end of each epoch (200 blocks). This ensures dynamic participation based on current stake rankings.
Block Production Process
Round-Robin Block Production
All active validators are ordered according to predefined rules and take turns to produce blocks.
Fallback Mechanism
If a validator fails to produce a block in time during its turn, active validators who have not been involved in the past n/2 blocks will randomly perform block production.
Network Security
At least n/2+1 active validators must work properly to ensure the proper operation of the blockchain.
Reward Distribution System
Gas Fee Distribution
All transaction fees paid in CLAYER are collected and distributed to validators based on their stake proportion.
Block Rewards
At the end of each block, the Validators contract is called and fees for all transactions in the block are distributed to active validators.
π‘οΈ Security Featuresβ
Slashing Conditions
Validators face economic penalties for malicious behavior
Validator Rotation
Regular rotation prevents centralization and censorship
Stake Delegation
Token holders can delegate stake without giving up custody
Participation Incentives
Rewards encourage honest participation and network growth
π‘οΈ DPoS Punishment Systemβ
Comprehensive Slashing Conditionsβ
Circle Layer implements a sophisticated punishment system to maintain network integrity and security:
π Critical Violations (Severe Penalties)
Validator signs two conflicting blocks at the same height
Attempting to reorganize the blockchain from an old state
Validator participates in multiple competing chains simultaneously
β οΈ Performance Violations (Moderate Penalties)
Validator offline for more than 12 consecutive hours
Proposing blocks with invalid transactions or format
Missing 5+ consecutive block proposal opportunities
System Contracts for Validator Managementβ
Circle Layer uses a comprehensive system of smart contracts to manage validator operations:
ποΈ Core Validator Contracts
ValidatorRegistry Contract
ActiveRegistration Functions
registerValidator()
- Register new validator with minimum stakeupdateValidatorInfo()
- Update validator metadata and commissiondeactivateValidator()
- Voluntarily exit from validator set
Status Management
getValidatorStatus()
- Query current validator stateisValidatorActive()
- Check if validator is in active setgetValidatorMetrics()
- Performance and uptime data
StakingManager Contract
ActiveStaking Operations
stakeTokens(validatorAddress, amount)
- Delegate stake to validatorunstakeTokens(validatorAddress, amount)
- Initiate unstaking processrestakeRewards(validatorAddress)
- Compound staking rewards
Reward Distribution
claimRewards(validatorAddress)
- Claim accumulated rewardsdistributeRewards()
- Automated reward distributioncalculateRewards(address)
- Preview pending rewards
SlashingManager Contract
ActiveSlashing Operations
slashValidator(validator, evidence, penalty)
- Execute slashingjailValidator(validator, duration)
- Jail validator temporarilysubmitEvidence(evidence)
- Submit slashing evidence
Recovery Functions
unjailValidator(validator)
- Release from jail after termappealSlashing(validator, appeal)
- Appeal slashing decisiongetSlashingHistory(validator)
- Query slashing record
βοΈ Governance & Dispute Contracts
DisputeResolution Contract
DevelopmentHandles appeals and disputes related to validator slashing and punishment decisions.
ParameterGovernance Contract
DevelopmentManages changes to staking parameters, slashing conditions, and network settings.
Detailed Staking & Unstaking Mechanicsβ
π Staking Process
Stake Preparation
- Minimum stake: 32 CLAYER (testnet) / 100,000 CLAYER (mainnet)
- Wallet balance verification
- Gas fee preparation (β0.01 CLAYER for staking transaction)
- Validator selection and due diligence
Transaction Execution
- Call
stakeTokens(validatorAddress, amount)
- Tokens transferred to staking contract
- Staking record created with timestamp
- Validator delegation pool updated
Activation Period
- Staking amount enters "pending" state
- Becomes active in next epoch (β24 hours)
- Starts earning rewards after activation
- Delegation shows in validator's total stake
Active Staking
- Rewards accrue automatically per block
- Can claim rewards without unstaking
- Voting power proportional to stake
- Subject to slashing if validator misbehaves
π Unstaking Process
Unstaking Initiation
- Call
unstakeTokens(validatorAddress, amount)
- Specify amount to unstake (minimum 1 CLAYER)
- Tokens enter "unbonding" state immediately
- Stop earning rewards from this block
Unbonding Period
- Mandatory waiting period: 21 days
- Tokens locked and cannot be transferred
- Still subject to slashing if validator misbehaves
- No rewards earned during unbonding
Release & Withdrawal
- Automatic release after 21 days
- Tokens become transferable
- Can be withdrawn to wallet or re-staked
- No longer subject to slashing
β‘ Emergency Mechanisms
π¨ Emergency Unstaking
Available during severe validator misconduct or network emergencies
π‘οΈ Validator Jailing Protection
Automatic unstaking triggered when validator is jailed for critical violations
π Validator Migration
Transfer stake between validators without unbonding period
Advanced Slashing Protectionsβ
π‘οΈ Delegator Protections
π Graduated Slashing
Slashing penalties applied gradually to minimize delegator impact:
- First offense: 50% of total penalty
- Second offense: 75% of total penalty
- Third offense: 100% of total penalty
- Grace period: 90 days between offense resets
β οΈ Early Warning System
Automated notifications for delegators when validators show concerning patterns:
- Uptime drops below 95%
- Missed block proposals exceed threshold
- Commission rate changes
- Abnormal behavior detected
π Auto-Migration Options
Smart contract features to protect delegator interests:
- Auto-unstake on critical violations
- Automatic re-delegation to backup validators
- Insurance pool for slashing compensation
- Community-governed protection mechanisms
π Ready to Participate?
Circle Layer's advanced DPoS system with comprehensive punishment mechanisms ensures network security while protecting legitimate participants. Our detailed staking and slashing systems provide clear rules and fair protections for all network participants.