Skip to Content
Consensus & Validators

Consensus & Validator System

Technical specification of the Zentalk consensus mechanism and validator network.

Overview

Zentalk uses a Delegated Proof-of-Stake (DPoS) consensus mechanism combined with Practical Byzantine Fault Tolerance (pBFT) for fast finality. This hybrid approach ensures identity registration consistency, prevents double-spending of cryptographic resources, and maintains relay node legitimacy across the network.

Why Consensus is Needed

A decentralized messenger requires consensus for critical operations that must be globally consistent.

Core Requirements

RequirementProblem Without ConsensusSolution
Identity registrationMultiple users could claim same Identity KeySingle source of truth for IK mappings
One-time prekey trackingSame OPK could be issued to multiple sendersOn-chain usage tracking prevents double-spend
Relay node legitimacyMalicious nodes could pose as valid relaysStaked validators verify node registration
Key rotationConflicting key updates could split the networkOrdered transactions ensure consistency
Slashing enforcementMisbehaving nodes could escape punishmentConsensus-enforced penalty execution

Identity Registration Consistency

When Alice registers her wallet address with an Identity Key, every participant must agree on this binding:

Registration: 0x1a2b...3c4d → IK_Alice (Ed25519 public key) Without consensus: - Node A sees: 0x1a2b...3c4d → IK_Alice - Node B sees: 0x1a2b...3c4d → IK_Mallory (attacker) - Different users get different "Alice" keys → MITM possible With consensus: - All nodes agree: 0x1a2b...3c4d → IK_Alice - Mallory's conflicting registration is rejected - Single source of truth prevents identity confusion

Preventing One-Time Prekey Double-Spending

One-time prekeys (OPKs) provide forward secrecy for first messages. Each OPK must be used exactly once:

Alice publishes OPK_1, OPK_2, OPK_3... Without consensus: - Bob fetches OPK_1, sends message to Alice - Carol also fetches OPK_1 (race condition) - Both messages encrypted with same ephemeral secret - Forward secrecy violated With consensus: - OPK_1 marked as "consumed" in atomic transaction - Carol's request returns OPK_2 instead - Each conversation gets unique ephemeral key material

Validator Role

Validators are the backbone of the Zentalk network, maintaining consensus and securing identity operations.

Validator Responsibilities

FunctionDescription
Block productionPropose and validate new blocks containing identity transactions
Identity verificationVerify registration signatures and prevent conflicts
Network consensusParticipate in pBFT voting rounds
State managementMaintain the identity registry state machine
Relay oversightVerify relay node stake and performance
Slashing executionEnforce penalties for misbehaving nodes

Validator Requirements

ParameterValueRationale
Minimum stake100,000 CHAINEconomic security threshold
Hardware (CPU)8 coresSignature verification throughput
Hardware (RAM)32 GBState storage and caching
Hardware (Storage)500 GB SSDBlock history and identity registry
Network bandwidth100 MbpsConsensus message propagation
Uptime requirement99.5%Network reliability

Becoming a Validator

  1. Acquire stake: Obtain minimum 100,000 CHAIN tokens
  2. Set up infrastructure: Deploy validator node meeting hardware requirements
  3. Register on-chain: Submit validator registration transaction
ValidatorRegistration { operator_address: 0x..., consensus_pubkey: Ed25519PublicKey, stake_amount: 100000 CHAIN, commission_rate: 5%, // Portion of delegator rewards metadata: { name: "MyValidator", website: "https://...", contact: "security@..." } }
  1. Wait for activation: Enter active set when slot available
  2. Begin validation: Start participating in consensus rounds

Validator Rewards

Validators earn rewards for network participation:

Reward TypeAmountCondition
Block reward2 CHAIN/blockProposing a valid block
Transaction feesVariableIncluded transaction fees
Commission% of delegator rewardsDelegators stake with validator
Uptime bonus+10% rewards99.9%+ uptime over epoch

Annual Yield Estimation:

Base yield: ~8% APY on staked amount With delegations: +commission on delegator rewards With uptime bonus: +10% on base rewards Example (100,000 CHAIN stake, 500,000 CHAIN delegated): - Base rewards: 8,000 CHAIN/year - Commission (5% of delegator yield): 2,000 CHAIN/year - Uptime bonus: 800 CHAIN/year - Total: ~10,800 CHAIN/year (~10.8% effective APY)

Consensus Algorithm

Zentalk implements a two-layer consensus combining DPoS for validator selection with pBFT for block finality.

Algorithm Overview

ComponentMechanismPurpose
Validator selectionDelegated Proof-of-StakeSybil resistance, economic security
Block productionRound-robin with VRFFair leader selection
Agreement protocolpBFT (3-phase commit)Fast deterministic finality
FinalitySingle-slotInstant confirmation

DPoS Layer

Token holders delegate their stake to validators, who participate in consensus proportional to their total stake:

Validator voting power = Own stake + Delegated stake Example: - Validator A: 100,000 (own) + 400,000 (delegated) = 500,000 voting power - Validator B: 100,000 (own) + 200,000 (delegated) = 300,000 voting power - Validator A has 62.5% voting power in consensus

Block Production

Each slot (2 seconds), a leader is selected to propose a block:

1. VRF Selection: vrf_output = VRF(slot_number, validator_private_key) 2. Leader Determination: leader = validator with lowest vrf_output (weighted by stake - higher stake = more winning VRF values) 3. Block Proposal: Block { slot: 12345, parent_hash: 0x..., state_root: 0x..., transactions: [...], proposer_signature: Ed25519Signature }

pBFT Consensus Rounds

After block proposal, validators execute a 3-phase commit:

Phase 1: PRE-PREPARE (Leader → All) ┌─────────────────────────────────────────────────┐ │ Leader broadcasts proposed block │ │ Validators verify: valid transactions, │ │ correct state transitions, proper signature │ └─────────────────────────────────────────────────┘ Phase 2: PREPARE (All → All) ┌─────────────────────────────────────────────────┐ │ Each validator broadcasts PREPARE vote │ │ Wait for 2f+1 PREPARE messages │ │ (f = max Byzantine validators tolerated) │ └─────────────────────────────────────────────────┘ Phase 3: COMMIT (All → All) ┌─────────────────────────────────────────────────┐ │ Each validator broadcasts COMMIT vote │ │ Wait for 2f+1 COMMIT messages │ │ Block is finalized - no reversion possible │ └─────────────────────────────────────────────────┘

Consensus Parameters

ParameterValueDescription
Slot time2 secondsBlock production interval
Epoch length7,200 slots (~4 hours)Validator set update period
Active validators100Maximum validators per epoch
Finality delay1 slotBlocks finalize immediately
View change timeout4 secondsLeader failure recovery

Finality Guarantees

PropertyGuarantee
Probabilistic finalityNot applicable (deterministic)
Deterministic finalityAfter COMMIT phase (~2-4 seconds)
Reorg possibilityNone after finalization
Confirmation requirement2f+1 validators (67%+ stake)

Identity Registration

The consensus layer maintains a global registry mapping wallet addresses to cryptographic identities.

Registry State

IdentityRegistry { // Primary mapping: address → identity identities: Map<Address, Identity>, // Reverse lookup: identity_key → address key_to_address: Map<Ed25519PublicKey, Address>, // Prekey tracking prekeys: Map<Address, PrekeyBundle>, consumed_otpks: Set<X25519PublicKey> } Identity { owner: Address, identity_key: Ed25519PublicKey, kyber_public_key: KyberPublicKey, // Post-quantum registration_slot: u64, last_rotation: u64 }

Registration Transaction

IdentityRegistrationTx { // Transaction metadata tx_type: IDENTITY_REGISTER, sender: Address, nonce: u64, fee: u64, // Identity data identity_key: Ed25519PublicKey, kyber_public_key: KyberPublicKey, // Proof of ownership signature: Ed25519Signature, // Signs (sender || identity_key || nonce) // Optional: initial prekey bundle initial_prekeys: Option<PrekeyBundle> }

Transaction Verification

Validators verify registration transactions:

1. Signature Verification: verify(signature, sender || identity_key || nonce, identity_key) 2. Uniqueness Check: assert(identities[sender] == null) // Address not registered assert(key_to_address[identity_key] == null) // Key not in use 3. Fee Verification: assert(balance[sender] >= fee) assert(fee >= MIN_REGISTRATION_FEE) 4. State Update: identities[sender] = Identity { ... } key_to_address[identity_key] = sender balance[sender] -= fee

Key Rotation

Users can update their Identity Key while maintaining account continuity:

IdentityRotationTx { tx_type: IDENTITY_ROTATE, sender: Address, nonce: u64, fee: u64, new_identity_key: Ed25519PublicKey, new_kyber_key: KyberPublicKey, // Must be signed by CURRENT identity key old_key_signature: Ed25519Signature, // Must be signed by NEW identity key (proves ownership) new_key_signature: Ed25519Signature, rotation_reason: enum { SCHEDULED, COMPROMISE, DEVICE_CHANGE } }

Key Rotation Process:

1. Verify old_key_signature with current identity_key 2. Verify new_key_signature with new_identity_key 3. Check new key not already registered 4. Update identity registry 5. Broadcast key change notification to contacts

Fee Structure

OperationFee (CHAIN)Purpose
Identity registration1.0Sybil resistance
Key rotation0.5Discourage unnecessary rotations
Prekey bundle upload0.1Storage cost
Prekey replenishment0.05Encourage fresh prekeys

Stake Requirements

EntityMinimum StakeLock PeriodPurpose
Standard userNoneN/ABasic messaging
Heavy user (>1000 contacts)10 CHAINNoneResource consumption
Relay node operator10,000 CHAIN7 daysNetwork participation
Validator100,000 CHAIN21 daysConsensus security

Byzantine Fault Tolerance

The pBFT consensus tolerates Byzantine (malicious) validators up to a security threshold.

Fault Tolerance Parameters

ParameterValueMeaning
Total validators (n)100Active validator set size
Byzantine threshold (f)33Maximum malicious validators
Quorum requirement2f+1 = 67Votes needed for consensus
Safety thresholdf+1 = 34Honest validators needed

Byzantine Tolerance Formula

n = 3f + 1 Where: - n = total validators - f = maximum Byzantine validators tolerated With n=100: - f = 33 Byzantine validators tolerated - 67 honest validators required for progress - 34 honest validators required for safety

Attack Prevention

AttackHow Prevented
Double votingSlashing: validator signs conflicting blocks
EquivocationCryptographic proof triggers automatic slashing
CensorshipProposer rotation prevents single-point censorship
Long-range attackFinality checkpoints prevent history rewriting
Nothing-at-stakeStake locked during validation period
BriberyLarge stake requirement increases attack cost

Safety vs. Liveness

PropertyGuaranteeCondition
SafetyNever finalize conflicting blocksUp to f Byzantine validators
LivenessNetwork continues producing blocks2f+1 honest validators online

Safety Priority: If network partitions or >f validators are Byzantine, the network halts rather than risking conflicting finalization.

Slashing Conditions

ViolationPenaltyDetection
Double signing100% stake slashConflicting signatures submitted
Prolonged downtime0.1% per epochMissed block proposals
Invalid block proposal10% stake slashConsensus rejection
Censorship (provable)50% stake slashInclusion proof violation

Recovery from Validator Failures

Scenario: 40 validators go offline (network has 60 remaining) 1. Detection: - Missed block proposals trigger timeout - View change protocol activates 2. Leader Rotation: - Skip offline leader - Next online validator proposes 3. Continued Operation: - 60 validators > 67 required for 2f+1 - Network continues if 67+ remain online 4. Offline Validator Handling: - Accumulate downtime penalties - After 24 hours: ejected from active set - Must re-register and wait for next epoch

Sybil Resistance

Economic stake requirements prevent attackers from creating unlimited validator or relay identities.

Attack Cost Analysis

AttackRequired StakeMarket Cost (est.)Difficulty
Control 1 validator100,000 CHAIN$500,000Easy
Control 10% validators1,000,000 CHAIN$5,000,000Moderate
Control 34% (safety attack)3,400,000 CHAIN$17,000,000Hard
Control 67% (liveness attack)6,700,000 CHAIN$33,500,000Very Hard

Validator Sybil Prevention

To run multiple validators, attacker must: 1. Stake 100,000 CHAIN per validator 2. Operate separate infrastructure (detected if shared) 3. Risk all stake on detection Attack: Create 34 fake validators to break safety Cost: 3,400,000 CHAIN stake Risk: If detected, lose all 3,400,000 CHAIN Detection: Infrastructure correlation, voting pattern analysis

Relay Node Sybil Prevention

ControlMechanism
Stake requirement10,000 CHAIN per relay node
Registration limitMax 10 relays per address
Performance monitoringReputation score affects routing priority
Bandwidth proofMust demonstrate actual relay capacity

Identity Registration Sybil Prevention

Creating spam identities requires: - 1 CHAIN per identity (registration fee) - Unique wallet address per identity - Gas fees for transactions Attack: Create 1 million spam accounts Cost: 1,000,000 CHAIN + gas fees Mitigation: Rate limiting per IP, captcha for web registrations

Economic Security Model

Security budget = Total stake × Slashing risk With 100 validators at 100,000 CHAIN each: - Total stake: 10,000,000 CHAIN - Attack cost: Acquire 34% = 3,400,000 CHAIN - If attack detected: Lose 3,400,000 CHAIN - Net attacker loss: 3,400,000 CHAIN (+ opportunity cost) Rational attacker analysis: - Expected profit from attack: P - Cost of attack: 3,400,000 CHAIN - Probability of detection: ~95%+ - Expected value: P - (0.95 × 3,400,000) Attack only rational if P > 3,230,000 CHAIN

Node Economics

Economic incentives align participant behavior with network health.

Relay Node Rewards

Reward SourceMechanismAmount
Bandwidth feesPer-message micropayments0.0001 CHAIN/KB
Routing bountySuccessful message delivery0.001 CHAIN/message
Uptime bonusConsistent availability+20% rewards
Storage feesOffline message queuing0.0005 CHAIN/KB/hour

Why Run a Relay Node

Monthly Economics (Example): Revenue: - Messages relayed: 10,000,000 - Average size: 2 KB - Routing bounty: 10,000 CHAIN - Bandwidth fees: 2,000 CHAIN - Storage fees: 500 CHAIN - Uptime bonus: 2,500 CHAIN Total revenue: ~15,000 CHAIN/month Costs: - Server (8 core, 32GB): $200/month - Bandwidth (10TB): $100/month - Stake opportunity cost: ~$400/month Total costs: ~$700/month Net profit: 15,000 CHAIN - $700 ≈ $74,300/month (Assuming CHAIN = $5, highly dependent on network usage)

Slashing Conditions for Nodes

ViolationPenaltyDetection Method
Message dropping1% stake per incidentDelivery proof verification
Selective routing5% stakeStatistical analysis
Traffic analysis10% stakeHoneypot detection
Extended downtime0.01% stake/hourHealth check failures
Invalid routing2% stakeCryptographic proof

Bandwidth Contribution Model

Relay nodes commit to bandwidth tiers: Tier 1 (Starter): - Commitment: 100 Mbps - Stake: 10,000 CHAIN - Max reward multiplier: 1x Tier 2 (Standard): - Commitment: 500 Mbps - Stake: 25,000 CHAIN - Max reward multiplier: 2x Tier 3 (Premium): - Commitment: 1 Gbps - Stake: 50,000 CHAIN - Max reward multiplier: 3x Under-delivery penalty: - Actual < 80% committed: Warning - Actual < 50% committed: 1% stake slash - Actual < 25% committed: 5% stake slash + tier downgrade

Stake Lockup and Withdrawal

ActionLock PeriodReason
Initial stakeImmediateNode can start operating
Reward claim1 epoch (4 hours)Prevent manipulation
Partial unstake7 daysDetect misbehavior
Full exit21 daysComplete slashing window
Emergency slashImmediateSecurity violations

Withdrawal Process

1. Initiate Withdrawal: UnstakeTx { amount: 50000 CHAIN, type: PARTIAL } 2. Unbonding Period (7 days): - Stake still slashable - No longer earning rewards - Cannot re-stake 3. Completion: - After 7 days: funds available - If slashed during unbonding: reduced amount 4. Claim: ClaimTx { unbond_id: 123 } - Transfer to wallet

Security Properties Summary

PropertyMechanismGuarantee
ConsistencypBFT consensusAll honest nodes agree on state
Availability67% quorumNetwork operates if 67+ validators online
Partition toleranceSafety over livenessNo conflicting finalization
Sybil resistanceProof-of-StakeAttack cost scales with stake
Censorship resistanceProposer rotationNo single point of censorship
FinalitySingle-slotInstant, irreversible confirmation
Last updated on