SecuritySecurity

Security

Overview

Security is the foundation of GX Exchange. The platform implements defense-in-depth across every layer — from the GXCore matching engine and GX BFT consensus protocol to smart contracts and user-facing interfaces. GX Chain has undergone a comprehensive 73-point security assessment with all tests passed.

Security Architecture

Access Controls — Strong

  • EIP-712 typed data signature verification with low-s normalization
  • Two-layer authentication (API + consensus)
  • Gap-tolerant nonce validation prevents replay attacks
  • Per-account rate limiting
  • Circuit breaker at 10% price move

Arithmetic Safety — Strong

  • overflow-checks = true enforced in release builds
  • No floating point in matching, settlement, or risk calculations
  • All arithmetic uses checked/saturating operations
  • #![deny(unsafe_code)] enforced across the codebase
  • Integer-only representation (Subticks u64, Quantums u64)

Testing and Verification — Strong

  • 90 tests covering unit (49), API (6), consensus (6), end-to-end (3), state (8), risk (9), orderbook (9)
  • Criterion benchmarks for performance validation
  • #![deny(clippy::unwrap_used)] enforced

Consensus — BFT Tolerant

  • Byzantine Fault Tolerant consensus (GX BFT with consensus pipelining)
  • Tolerates up to 1/3 of validators being faulty or malicious
  • With 21 validators: survives 6 byzantine nodes
  • With 51 validators: survives 16 byzantine nodes

Risk Categories Tested

Risk CategoryDescriptionStatus
Collateral TheftForged orders, PnL manipulation, insurance fund exploitsPassed
Orderbook ManipulationSelf-trade, price manipulation, order type exploitsPassed
Position FreezingIncorrect state transitions, system pausesPassed
Liquidation ExploitationUnfair targeting, insurance fund drainagePassed
Denial of ServiceWS/REST flooding, P2P injection, queue saturationPassed
Signature ForgeryForged EIP-712 signatures, replay attacksPassed
Consensus DivergenceNon-deterministic execution, state hash issuesPassed
Data LossRocksDB corruption, non-atomic persistencePassed