Overview
PoSV is designed to overcome the limitations of traditional Proof of Work while maintaining decentralization:- 2-Second Block Time: Fast transaction confirmation
- 150 Masternodes: Fixed validator set elected by VIC token holders
- Double Validation: Enhanced security through paired validation
- True Randomization: Fair validator selection process
Consensus Parameters
The PoSV consensus is configured with the following key parameters (fromparams/config.go):
Mainnet Configuration
Testnet Configuration
Testnet uses identical parameters to mainnet for consistency:The
Gap parameter creates a preparation period before the next epoch begins, allowing nodes to update their masternode lists.Block Production Process
1. Masternode Selection
Masternodes take turns producing blocks in a deterministic round-robin order:consensus/posv/posv.go:580-612):
2. Block Creation
When it’s a masternode’s turn:- Prepare Header: Set timestamp, difficulty, and extra data
- Include Transactions: Select transactions from the mempool
- Execute State Transition: Process all transactions and update state
- Sign Block: Create cryptographic signature using masternode’s private key
- Broadcast: Propagate block to the network
3. Block Validation
Each block must pass multiple validation checks:Basic Validation
- Timestamp is valid (not in the future, respects period)
- Difficulty matches expected value
- Extra data contains proper signatures
- No uncles (PoSV doesn’t support uncles)
- Valid gas limit and usage
Creator Authentication
The block creator is verified by recovering the signer from the block signature:Double Validation
Double validation is a key security feature that requires two masternodes to validate each block.M1-M2 Pairing
- M1 (Creator): The masternode that creates and proposes the block
- M2 (Validator): The assigned masternode that validates and co-signs the block
Validator Assignment
Validator pairs are determined at each epoch and stored in checkpoint blocks:Validation Process
- M1 creates block and signs it
- M2 receives the block and validates:
- All transactions are valid
- State transition is correct
- Block follows consensus rules
- M2 adds validator signature to block header
- Block is considered valid only with both signatures
Failure Handling
If M2 fails to validate:- Block is not propagated
- M1 may be penalized if repeatedly creating invalid blocks
- Network waits for next masternode’s turn
- Failed validations count toward penalty calculation
Difficulty Calculation
Viction uses difficulty to prioritize blocks when forks occur:Higher difficulty blocks are preferred during fork resolution, ensuring the correct masternode’s block is chosen.
Epoch System
An epoch is a fixed period of 900 blocks (~30 minutes with 2-second blocks).Checkpoint Blocks
Every 900 blocks, a checkpoint block is produced:Checkpoint Block Structure
Extra Data Format:Coinbase: Must be zero address for checkpoint blocksPenalties: Byte array of penalized masternode addressesValidators: Encoded M1-M2 validator pairs
Masternode List Updates
At checkpoint blocks:- Retrieve New Masternodes: Query masternode smart contract
- Apply Penalties: Remove penalized masternodes from active set
- Update Snapshot: Store new masternode list in snapshot
- Encode in Header: Include masternode addresses in extra data
Penalty System
Masternodes that fail to perform their duties are automatically penalized.Penalty Triggers
- Missing block creation when it’s their turn
- Failing to validate blocks as assigned M2
- Creating invalid blocks
- Extended downtime or network issues
Penalty Duration
Penalized masternodes are excluded for multiple epochs:Penalty Recording
Penalties are recorded in checkpoint block headers:Reward Distribution
Block rewards are distributed at each checkpoint (every 900 blocks).Reward Structure
- Block Reward: 250 VIC per block
- Distribution: Shared among masternodes and voters
- Foundation: Portion allocated to foundation wallet
Reward Calculation
Rewards are calculated based on:- Number of blocks signed in the epoch
- Validator participation
- Voting weight
- Penalties applied
Finality
Viction achieves fast finality through several mechanisms:Soft Finality
- After 1 Block: Very high confidence (~99%)
- After 2 Blocks: Extremely high confidence due to double validation
Hard Finality
- After Checkpoint: Absolute finality at epoch boundaries (900 blocks)
- Snapshot Stored: State snapshot makes reorganization prohibitively expensive
Snapshot System
The consensus engine maintains snapshots for efficient operation.Snapshot Contents
Snapshot Storage
Snapshots are stored:- In-Memory: Last 128 snapshots cached in LRU cache
- On-Disk: Snapshots at checkpoint blocks persisted to database
- Key Format:
posv-{block_hash}
Snapshot Usage
- Fast block validation (no need to replay history)
- Quick masternode list lookup
- Efficient sync for new nodes
- Fork resolution
Security Considerations
Attack Resistance
51% Attack: Requires controlling 76+ of 150 masternodes (significant capital requirement) Nothing-at-Stake: Prevented by masternode staking and penalty system Long-Range Attack: Mitigated by checkpoint finality and social consensus DDoS Attack: Double validation means attacker must target both M1 and M2Network Assumptions
- At least 67% of masternodes are honest and online
- Network latency is reasonable (<1 second for propagation)
- Clock synchronization within acceptable bounds