Skip to content

Security: tetcore/tetcore-docs

Security

docs/security.md

Security Model

Determinism Guarantees

Core Invariants

  1. State Root Uniqueness: Same input → same state root
  2. Transaction Ordering: Canonical block ordering
  3. Arithmetic Safety: No overflow/underflow
  4. Storage Isolation: Contract storage separated

Verification

  • All nodes must produce identical state roots
  • Determinism tested via test vectors
  • Fuzzing for edge cases

Threat Model

Honest Nodes

  • Follow protocol correctly
  • Produce valid state transitions

Malicious Nodes

  • Attempt double-spending
  • Submit invalid state roots
  • Try to break consensus

Defense Mechanisms

Threat Defense
Double spend BFT finality (2/3+1)
Invalid state Signature verification
Replay Nonce + chain_id
Reentrancy Checks-effects-interactions

Consensus Security

BFT Properties

  • Safety: No conflicting blocks finalized
  • Liveness: System makes progress
  • Finality: 2/3 validator agreement

Validator Requirements

  • Stake locked as collateral
  • Slashing for malicious behavior
  • Jailing for downtime

Economic Security

Token Conservation

Σ balances = TOTAL_SUPPLY - burned

No unauthorized minting.

Fee Security

  • Gas metering prevents infinite loops
  • Storage deposits prevent state bloat
  • Nonce prevents replay attacks

Vault Security

  • Slashing for insufficient capacity
  • Slashing for downtime
  • Governance override for extreme cases

Contract Security

Sandboxing

  • No direct system access
  • Isolated storage
  • Limited call depth

Best Practices

  1. Check-inputs-early
  2. Effects-interactions pattern
  3. Use safe math
  4. Emit events
  5. Pausable functions

Governance Security

Constraints

  • Cannot modify past blocks
  • Cannot confiscate without rule
  • Bounded emergency powers
  • Constitutional limits

Voting Security

  • Snapshot prevents flash loans
  • Timelock allows exit
  • Quorum prevents capture

Slashing Conditions

Consensus Slashing

  • Double voting
  • Equivocation
  • Invalid block proposals

Inference Slashing

  • Failed availability proof
  • Incorrect shard submission
  • Repeated service failure

Incident Response

  1. Detection: Anomaly detection
  2. Containment: Pause affected modules
  3. Recovery: Revert state if possible
  4. Analysis: Post-mortem
  5. Improvement: Protocol update

Audits

Required audit areas:

  • Consensus implementation
  • VM security
  • Cryptographic primitives
  • Economic model
  • Governance logic

There aren’t any published security advisories