Security

Security Overview

Comprehensive security architecture for LX - threat models, defense layers, and security principles

Security Overview

LX implements defense-in-depth security across all layers, combining classical cryptography with post-quantum algorithms to protect against both current and future threats.

Security Philosophy

LX security follows three core principles:

  1. Defense in Depth: Multiple independent security layers
  2. Zero Trust: Verify everything, trust nothing
  3. Quantum Readiness: Post-quantum cryptography throughout

Threat Model

Adversary Capabilities

Adversary ClassCapabilitiesMitigation
Script KiddiePublic exploits, automated toolsRate limiting, input validation
Sophisticated HackerZero-days, targeted attacksBug bounty, security audits
Nation StateQuantum computers, unlimited resourcesPost-quantum cryptography
Malicious InsiderPhysical access, credentialsMPC, HSM, audit logging
Colluding ValidatorsUp to t-1 of n validatorsThreshold signatures (t-of-n)

Attack Vectors

┌─────────────────────────────────────────────────────────────────┐
│                    ATTACK SURFACE MAP                            │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  Network Layer                                                   │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  DDoS │ MITM │ Replay │ Sybil │ Eclipse                 │   │
│  │  ──────────────────────────────────────────────────────│   │
│  │  Mitigations: Rate limiting, TLS 1.3, Nonces, PoS      │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  Application Layer                                               │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  Injection │ XSS │ CSRF │ Auth Bypass │ Logic Bugs     │   │
│  │  ──────────────────────────────────────────────────────│   │
│  │  Mitigations: Input validation, CSP, HMAC, Audits      │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  Smart Contract Layer                                            │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  Reentrancy │ Overflow │ Flash Loans │ Oracle Manip    │   │
│  │  ──────────────────────────────────────────────────────│   │
│  │  Mitigations: CEI, SafeMath, TWAP, Chainlink           │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  Cryptographic Layer                                             │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  Key Extraction │ Side Channel │ Quantum Attack        │   │
│  │  ──────────────────────────────────────────────────────│   │
│  │  Mitigations: HSM, Constant-time, Dilithium/Kyber     │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Security Architecture

Layer 1: Network Security

  • TLS 1.3 mandatory for all connections
  • QZMQ post-quantum secure messaging between nodes
  • Rate limiting per IP, per API key, per account
  • DDoS protection via Cloudflare and in-house mitigation
  • Firewall rules with default-deny policy

Layer 2: Authentication & Authorization

  • API Keys with HMAC-SHA512 signatures
  • JWT tokens with short expiry and refresh rotation
  • Ed25519/Dilithium signatures for trading operations
  • Role-based access control (RBAC) with least privilege
  • Multi-factor authentication for sensitive operations

Layer 3: Cryptographic Security

  • Hybrid signatures: Ed25519 (classical) + Dilithium (post-quantum)
  • Hybrid encryption: X25519 (classical) + Kyber (post-quantum)
  • Threshold signatures: t-of-n MPC for hot wallets
  • Hardware Security Modules for cold storage

Layer 4: Smart Contract Security

  • Formal verification of critical contracts
  • Multiple audits from top security firms
  • Timelock governance for upgrades
  • Circuit breakers for anomaly detection
  • Bug bounty up to $1M for critical vulnerabilities

Layer 5: Operational Security

  • Immutable audit logs on-chain
  • 24/7 monitoring with anomaly detection
  • Incident response with defined playbooks
  • Regular penetration testing
  • Employee security training

Cryptographic Primitives

Signature Schemes

AlgorithmTypeSecurity LevelUse Case
Ed25519Classical128-bitFast verification
Dilithium-3Post-Quantum192-bit (NIST Level 3)Quantum resistance
BLS12-381Pairing128-bitAggregate signatures
RingtailLattice128-256 bitThreshold signatures

Encryption Schemes

AlgorithmTypeSecurity LevelUse Case
AES-256-GCMSymmetric256-bitData at rest
ChaCha20-Poly1305Symmetric256-bitData in transit
X25519Classical KEM128-bitKey exchange
Kyber-768Post-Quantum KEM192-bitQuantum-safe exchange

Hash Functions

AlgorithmOutput SizeUse Case
SHA3-256256 bitsGeneral hashing
BLAKE3256 bitsHigh-performance
Keccak-256256 bitsEVM compatibility
SHAKE256VariableExtendable output

Security Zones

┌─────────────────────────────────────────────────────────────────┐
│                      SECURITY ZONES                              │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  Zone 0: Air-Gapped (Cold Storage)                              │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  HSM │ Cold Wallets │ Recovery Keys │ MPC Key Shares    │   │
│  │  Access: Physical only, multi-party authorization       │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  Zone 1: Restricted (Hot Wallets)                               │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  Threshold Wallets │ Signing Servers │ Key Management   │   │
│  │  Access: MPC only, no single party can sign            │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  Zone 2: Internal (Backend Services)                            │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  Matching Engine │ Database │ Settlement │ Risk Engine  │   │
│  │  Access: Service accounts, mutual TLS                   │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  Zone 3: DMZ (Public APIs)                                      │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  REST API │ WebSocket │ gRPC │ Rate Limiters            │   │
│  │  Access: Authenticated users, rate limited              │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Security Checklist

For Users

  • Enable 2FA on your account
  • Use hardware wallet for large balances
  • Verify contract addresses before interacting
  • Never share API keys or private keys
  • Use unique, strong passwords
  • Monitor account activity regularly
  • Whitelist withdrawal addresses
  • Set up notifications for trades/withdrawals

For Developers

  • Use official SDKs only
  • Validate all API responses
  • Implement request signing
  • Handle errors securely (no stack traces)
  • Use environment variables for secrets
  • Implement rate limiting in your app
  • Keep dependencies updated
  • Follow secure coding guidelines

For Validators

  • Use HSM for validator keys
  • Implement sentry node architecture
  • Monitor for double-signing
  • Keep software updated
  • Secure network perimeter
  • Implement key rotation
  • Maintain offline backup keys
  • Document incident response procedures

Security Metrics

Current Status

MetricValueTarget
Security Audits4 completedQuarterly
Bug Bounty Payouts$125K totalOngoing
Critical Vulnerabilities0 open0
Mean Time to Patch4 hours< 24 hours
Uptime99.97%99.9%
Failed Login Attempts Blocked2.3M/dayN/A
DDoS Attacks Mitigated47 YTDN/A

Monitoring Dashboard

Real-time security metrics available at:

  • Internal: https://security.internal.lux.network
  • Public status: https://status.lux.network

Documentation Index

DocumentDescription
AuthenticationAPI keys, JWT, signature auth
EncryptionTLS, data encryption, key management
Quantum SecurityPost-quantum cryptography
MPC SecurityThreshold signatures, key ceremonies
AuditsSecurity audits, bug bounty
Smart ContractsContract security patterns
Network SecurityDDoS protection, rate limiting
ComplianceKYC/AML, regulatory
Incident ResponseEmergency procedures

Security Contacts

References