Proof of Authority Module (x/poa)
The Proof of Authority (PoA) module implements a permissioned consensus mechanism where a designated admin controls the validator set. This is designed for consortium chains, private networks, and testing environments where validator participation needs to be tightly controlled.Overview
The PoA module replaces traditional staking-based validator selection with an admin-controlled validator set. Key features include:- Admin-Controlled Validator Set: A single admin account manages validator additions, removals, and power adjustments
- Fee Distribution: Validators accumulate transaction fees proportional to their voting power
- Governance Integration: Only active PoA validators can submit proposals, deposit, and vote
- Custom Vote Tallying: Governance votes are weighted by validator power instead of staked tokens
Architecture
The PoA module integrates with several core Cosmos SDK modules:| Module | Purpose | Interface |
|---|---|---|
| CometBFT | Consensus engine | Receives validator updates via ABCI |
| Auth | Account management | Gets module accounts and address codec |
| Bank | Token transfers | Sends accumulated fees to validators |
| Governance | Proposals & voting | Custom vote tallying and access control |
Data Model
The keeper maintains the following state:params: Module parameters (admin address)validators: Indexed map of validators by (power, consensus_address)totalPower: Sum of all validator powerstotalAllocatedFees: Accumulated fees per validatorqueuedUpdates: Pending validator updates for CometBFT
Key Types
Validator
pub_key: Ed25519 consensus public key for signing blockspower: Voting power in consensus (0 = removed from active set)metadata.operator_address: Account address for withdrawing feesmetadata.moniker: Human-readable validator namemetadata.description: Optional description
Params
admin field is the only parameter and specifies the bech32 address that can update validators and module parameters.
ValidatorFees
DecCoins to handle fractional amounts when distributing proportionally by power.
Message Handlers
MsgUpdateParams
Update module parameters (admin address):MsgUpdateValidators
Update the validator set (add, modify, or remove validators):MsgCreateValidator
Any account can create a validator with zero initial power (pending admin approval):MsgWithdrawFees
Validators withdraw accumulated fees to their operator address:Fee Distribution
Transaction fees are distributed proportionally based on validator power:DecCoins and truncated to Coins only upon withdrawal.
Governance Integration
Vote Tallying
Governance votes are tallied by validator power instead of staked tokens:Access Control
Only active validators can participate in governance:ABCI Lifecycle
BeginBlock
Allocates fees to validators:EndBlock
Sends validator updates to CometBFT:SetValidator or RemoveValidator:
Query Endpoints
Params
Query module parameters:Validators
Query all validators:Validator
Query a specific validator by consensus address:Use Cases
Consortium Blockchain
Five companies form a consortium:Testing Environment
Quickly spin up validators for testing:Private Enterprise Network
Single organization controls all validators:Best Practices
- Use multisig for admin to prevent single point of failure
- Set equal validator power for fair consortium governance
- Monitor validator performance and adjust power accordingly
- Rotate validators periodically for security
- Test governance workflows before deploying
- Document validator requirements for consortium members
- Plan key management strategy for admin and validators
Security Considerations
- Admin has full control over the validator set - use multisig or governance
- No slashing - validators can misbehave without on-chain penalties
- Validator collusion is possible with small validator sets
- Fee manipulation - admin can favor certain validators by adjusting power
- Key compromise - losing admin key requires social recovery
Migration from Staking
To migrate from a staking-based chain:- Export state from staking chain
- Remove staking/slashing modules from app.go
- Add PoA module to module manager
- Create genesis with selected validators
- Set admin to governance or multisig
- Initialize chain with new genesis