Pyde Threat Model

Version 0.1

This is the canonical threat model for Pyde. It catalogs ~50 threats across 7 layers, maps each to its mitigation in the protocol design, and acknowledges residual risks.

This is a living document. Update on new threats discovered, protocol changes, and quarterly review.

Companion to Chapter 16. Chapter 16: Security is the narrative defense reference — it walks the same ground in essay form, explains why each defense was chosen, and is intended for readers building intuition. This document is the catalog: every threat carries an ID, severity, detection signal, and mitigation reference. External auditors should treat this document as the entry point; bug reporters should reference threat IDs from this catalog.

1. Scope & Assets

In Scope (Protocol Responsibility)

  • User funds (PYDE balances + staked amounts)
  • State integrity (no fork, no double-spend)
  • Transaction ordering integrity (no proposer-MEV)
  • Encryption invariants (commit-before-reveal)
  • Validator stake (fair slashing)
  • Privacy of encrypted transaction contents
  • Liveness (chain progress)
  • Cross-chain finality (HardFinalityCert correctness)

Out of Scope (User / Operational Responsibility)

  • User wallet compromise (private key custody is the user's)
  • Smart contract bugs in user-deployed WASM contracts (audit + safety features mitigate, but protocol doesn't enforce)
  • RPC provider failures (orthogonal infrastructure)
  • Single-node hardware failures (operator responsibility, mitigated by redundancy)
  • Social engineering of multisig holders (organizational responsibility)
  • Future quantum compute attacks on archived encrypted transactions (no defense possible)
  • Application-layer DDoS (dApp choosing weak rate limits)

Asset Value Classification

AssetValueLoss impact
User fundsCriticalDirect financial loss to users
State integrityCriticalChain becomes untrustworthy
MEV resistanceCriticalCore value proposition
Validator stakeHighSlashing must be fair
LivenessHighChain stops being useful
PrivacyHighEncryption promise violated
Cross-chain integrityHighBridges hacks have caused $3B+ historical losses

2. Adversary Model

Adversary Types

TypeMotivationResourcesLikelihood
MEV bot operatorProfitModest infrastructure, deep mempool knowledgeHigh
Economic actorProfit (large)Significant capital, can stakeMedium
Coordinated cartelCombined economic gainLarge stake + infrastructureMedium
State adversaryGeopolitical, censorshipNation-state resources, BGP controlLow but high-impact
Insider (validator)Profit, sabotageHas stake, share, software accessLow but high-impact
Cryptographic adversaryResearch or destructionMathematician + computeLow
Quantum adversaryLong-term destructionFuture quantum computerVery low (decade+)
Network adversaryDisruptionISP / BGP positionLow
Software supply chainVariousDependency accessMedium
Social attackerVariousSocial skillsMedium

Adversary Capabilities

Default network adversary (Dolev-Yao):

  • ✅ Observe public messages
  • ✅ Delay, reorder, drop, duplicate messages
  • ✅ Spoof network packets
  • ❌ Cannot forge FALCON signatures
  • ❌ Cannot decrypt without ≥85 shares
  • ❌ Cannot find hash collisions in Blake3 or Poseidon2

Insider validator (single):

  • ✅ Has one FALCON private key
  • ✅ Has one threshold decryption share s_i
  • ✅ Has validator software access
  • ❌ Cannot reconstruct shared SK alone
  • ❌ Cannot forge other validators' signatures
  • ❌ Cannot violate determinism alone (constrained by protocol rules)

Coordinated insiders (≤42 validators, below BFT threshold):

  • ✅ Can collectively decrypt nothing (need 85)
  • ✅ Can equivocate (each commits slashable offense)
  • ✅ Can collude on transactions (but ordering is deterministic)
  • ❌ Cannot violate safety (need 85+ for any commit)
  • ❌ Cannot censor (other 86+ can include any transaction)

Coordinated insiders (≥85 validators, above BFT threshold):

  • ✅ Can decrypt encrypted transactions
  • ✅ Can commit to invalid states (others detect and halt)
  • ✅ Can censor
  • ✅ Can fork the chain
  • This is the "BFT broken" scenario — out of normal protocol scope. Residual risk.

3. Trust Assumptions

Cryptographic

  • FALCON-512 is EUF-CMA secure (NIST standard)
  • Kyber-768 is IND-CCA2 secure (NIST FIPS 203)
  • Blake3 and Poseidon2 are collision-resistant
  • DKG produces a valid threshold key under honest majority
  • Random beacon is unpredictable until reveal

Network

  • Partially synchronous: messages eventually delivered (no permanent partition)
  • Clock skew bounded (~5 seconds maximum)
  • At least one honest path exists between any two honest nodes

Validator Behavior

  • ≥85 of 128 committee members are honest (BFT supermajority)
  • Honest nodes follow the protocol; slashing punishes deviation
  • Validator software is correctly implemented (defense via formal methods + audits)

Operational

  • Genesis ceremony participants are honest
  • Hardcoded seed nodes are operated honestly
  • DNS infrastructure is reliable
  • Foundation multisig members are not compromised (>4 of 7 honest for 7-of-12 threshold)

4. Threat Catalog

Consensus Layer

IDThreatSeverityDetectionMitigation
T-CONS-1Equivocation (validator signs contradictory messages)HighCryptographic evidenceEquivocation slashing 10-50%
T-CONS-2Long-range attack (rewrite history)MediumState root signatures, finalityBounded rollback (1 epoch), weak-subjectivity checkpoints
T-CONS-3Bad state-root signingHighContradictory roots for same commitBad-state-root slashing 10%, correlation multiplier
T-CONS-4Anchor predictability exploitationMediumPublic beacon analysisLookback state-root randomness
T-CONS-5Adaptive corruption (mid-epoch)MediumLiveness slashingEpoch boundary commitment, slashing accumulation
T-CONS-6Slashing race (withdraw before slash applies)HighUnbonding periodUnbonding (30d) > evidence freshness (21d)
T-CONS-7DAG cycle / invalid parent refsCriticalStructural validationAuto-reject vertex, slash producer
T-CONS-8Coordinated proposer attackHighDAG has no proposerStructurally impossible

Cryptographic Layer

IDThreatSeverityDetectionMitigation
T-CRYPT-1FALCON key compromise (single validator)MediumAnomaly detectionKey rotation, HSM recommended
T-CRYPT-2Kyber threshold compromise (≥85)CriticalDKG outputHonest BFT majority assumption; per-epoch refresh
T-CRYPT-3Hash collision (Blake3 / Poseidon2)Very lowCryptanalysisStandardized primitives, dual hash strategy
T-CRYPT-4Threshold decryption side-channelLowAuditConstant-time implementation
T-CRYPT-5DKG manipulation (force bad key)MediumDKG validationPedersen DKG with public commitments, slashing
T-CRYPT-6Random beacon biasMediumOutput analysisThreshold-sig beacon (no single party controls)
T-CRYPT-7Future quantum on archived encrypted txsLong-termN/AOut of scope; PQ primitives best available

MEV / Economic Layer

IDThreatSeverityDetectionMitigation
T-MEV-1Front-running via early decryptionHighN/ACommit-before-reveal invariant enforced
T-MEV-2Sandwich attacksHighN/APlaintexts hidden until order committed
T-MEV-3Liquidation racingMediumN/AMitigated by encryption + commit-before-reveal
T-MEV-4Time-bandit attacksHighFinalityBounded rollback, slashing
T-MEV-5Validator-builder collusionMediumN/ANo proposer-builder separation; DAG eliminates surface
T-MEV-6Stake concentration → control 43+ committeeHighPublic stake stateAnti-Sybil (operator identity cap), stake cap
T-MEV-7Bribery of committee for orderingMediumBehavior analysisEqual-power voting + slashing makes bribery expensive
T-MEV-8Censorship (selective exclusion)HighDetection hard127 others can include; censorship requires near-unanimous

Network Layer

IDThreatSeverityDetectionMitigation
T-NET-1Eclipse attack (isolate target)MediumPeer diversity analysisAnti-eclipse: diverse IPs/ASNs, persistent peers
T-NET-2DDoS on committee validatorHighTraffic analysisSentry node pattern, rate limits, peer scoring
T-NET-3BGP hijack / route manipulationLow (rare)Out-of-bandOut of scope (network responsibility)
T-NET-4Sybil on peer discoveryMediumIP/ASN concentrationLayered discovery (not DHT), peer score
T-NET-5Message flooding / spamMediumRate limitsPer-peer rate limiting, gas tank requirement
T-NET-6Network partition (deliberate or accidental)MediumQuorum detectionPartition-aware slashing pause; halt detection

Economic / Governance Layer

IDThreatSeverityDetectionMitigation
T-ECON-1Stake concentration (rich operator, many cheap validators)HighOn-chain analysisOperator identity binding, max 3 per operator
T-ECON-2Validator collusion (43+ coordinated offline DoS)HighQuorum detectionSlashing + partition handling
T-ECON-3Treasury attacks (governance capture)MediumPublic proposalsOff-chain governance, transparent PIP process
T-ECON-4Multisig compromise (emergency halt abuse)HighMulti-key threshold7-of-12 multisig, slashable malicious unhalt
T-ECON-5Token price collapse → slashing economics brokenMediumMarket dataNumbers tunable, treasury can adjust

Software / Implementation Layer

IDThreatSeverityDetectionMitigation
T-SW-1WASM execution non-determinism bugCriticalState root divergenceExtensive testing, formal verification, halt detection
T-SW-2Toolchain binding-generator bugHighContract test failuresPer-language generator audits, fuzz testing across all four targets
T-SW-3FALCON sig side-channelLowTiming analysisConstant-time implementation
T-SW-4Memory corruption (buffer overflow)HighRust borrow checker, auditsUse safe Rust, audit unsafe blocks
T-SW-5Cryptographic library bugHighAuditsUse well-audited libraries (RustCrypto)
T-SW-6State corruption (disk errors)MediumSnapshot verificationJMT root recomputation, peer cross-verification

Authorization Layer (v2 — session keys + programmable accounts)

Session keys ship at v2. The threats below are catalogued now so the v2 implementation lands against a known surface. Until v2, the AuthKeys::Programmable variant is reserved-but-disabled — these threats are inactive at v1.

IDThreatSeverityDetectionMitigation
T-AUTH-1Session-key theft (compromised dApp leaks key)MediumUser notification; on-chain anomaly (unusual spend pattern within scope)Limited blast radius via scope (contracts + methods + spend cap + expiry); user can revoke instantly with a single signed tx; main auth_keys untouched
T-AUTH-2Revoked-key replay (attacker submits tx signed by previously-revoked session key)LowAuthorization-time revoked checkRevocation is on-chain state; tx rejected at validation with KeyRevoked
T-AUTH-3Scope expansion via mutable storage manipulationHighPolicy WASM auditPolicy WASM runs in restricted-state mode; cannot modify own scope without main-key signature on a RegisterSessionKey/UpdateScope tx
T-AUTH-4Session-key squatting (creating many keys to flood storage)LowPer-account session-key countHard limit (32 active session keys per account); spent storage refunded on revocation
T-AUTH-5spent_so_far overflow attackLowu128 arithmetic checks at authorizationSaturating addition + max_spend ≤ u128::MAX / 2 registration check
T-AUTH-6Expired-key acceptance (clock skew at wave boundary)LowAuthorization-time expires_at checkWave is the authoritative clock; no off-chain time source enters the check

Social Layer

IDThreatSeverityDetectionMitigation
T-SOC-1Phishing of operators / multisigHighOut-of-bandOperator training, HSM, multisig for high-value ops
T-SOC-2Misinformation during incidentMediumMultiple channelsFoundation as authoritative source, clear comms protocol
T-SOC-3Insider threat (developer / foundation)MediumCode review, multisigMulti-sig deployments, public PIP review
T-SOC-4Supply chain attack on dependenciesHighCargo.lock auditReproducible builds, dependency review

5. Mitigation Cross-Reference

MitigationSpecification
BFT 85/128 quorum + DAG consensusSee WHITEPAPER §5
SlashingSee SLASHING.md
Threshold encryption + commit-before-revealSee WHITEPAPER §4, §8
Anti-Sybil (operator identity binding)See VALIDATOR_LIFECYCLE.md
State sync verification (chain-of-trust)See STATE_SYNC.md
Chain halt + recovery proceduresSee CHAIN_HALT.md
Network defenses (DoS, eclipse)See NETWORK_PROTOCOL.md
Performance harness validates resilienceSee PERFORMANCE_HARNESS.md
Equal-power committeeSee WHITEPAPER §5.5
Honest throughput claimsSee WHITEPAPER §11

6. Residual Risks (Acknowledged, Not Fully Mitigated)

These are risks Pyde cannot fully eliminate:

  1. Coordinated 85+ validator collusion — out of BFT scope. If 85+ collude, safety can be violated. Mitigation: economic disincentives + stake distribution + operator identity cap.

  2. Quantum compute breaking PQ primitives in <10 years — not currently feasible to defend; PQ choice is the best available.

  3. Smart contract bugs in user-deployed WASM contracts — out of protocol scope. Mitigation: Pyde safety attributes (reentrancy off by default, checked arithmetic) preserved in the WASM era + recommended user audits.

  4. Single-validator key compromise — validator loses ≤1 vote of influence. Mitigation: key rotation, HSM, multisig validator (v2 feature).

  5. Foundation multisig compromise — 7+ of 12 hostile = emergency halt abuse. Mitigation: diverse multisig members, public visibility, slashable malicious unhalt.

  6. Network-level adversary (BGP, ISP) — out of protocol scope. Mitigation: encourage geographic + provider diversity.

  7. Genesis trust — initial committee, hardcoded seeds, hardcoded committee pubkeys all require founder trust. Unavoidable at chain launch.

7. Update Procedure

The threat model is a living document:

  • Update triggers:
    • New threats discovered (research, incidents, audits)
    • Protocol changes (new features → new attack surfaces)
    • Quarterly review (mandatory)
  • Format for new threat entry:
    - T-XXX-N: <name>
    - Severity: <Critical / High / Medium / Low>
    - Discovered: <date / source>
    - Detection: <how detected>
    - Mitigation: <how addressed or "residual risk">
    - Reference: <design doc section>
    
  • Each major update increments the version number.

8. For Auditors

This document is the entry point for external security review. Auditors should:

  1. Verify the threat catalog is complete (no missing categories)
  2. Verify each mitigation is actually implemented (trace to code)
  3. Verify residual risks are acceptable for the asset values
  4. Verify trust assumptions are reasonable for production
  5. Test selected scenarios (especially from FAILURE_SCENARIOS.md)

Document version: 0.1

License: See repository root