LPsLux Proposals
Network
LP-7

Supply Chain Control

Implemented

How Lux maintains complete control over its software dependencies through strategic forking and internal management

Type
Meta
Created
2025-12-21

LP-0007: Supply Chain Control

Abstract

This LP documents the implementation of Lux Network's supply chain control strategy as outlined in LP-4. It provides concrete metrics, package inventories, and verification procedures for maintaining dependency sovereignty.

Motivation

LP-4 establishes why we fork dependencies. This document specifies how we implement and verify that control:

  • Quantified metrics for binary size and module counts
  • Complete inventory of internal packages
  • Dependency hierarchy documentation
  • Verification test cases

Specification

Dependency Hierarchy

+---------------------------------------------------------------+
|                    LUX NODE BINARY (41 MB)                    |
+---------------------------------------------------------------+
|  LUXFI INTERNAL (30 packages)              [Full control]     |
|    - luxfi/node        Core validator                         |
|    - luxfi/geth        Streamlined EVM                        |
|    - luxfi/coreth      C-Chain integration                    |
|    - luxfi/consensus   BFT engine (no snow deps)              |
|    - luxfi/crypto      PQ-ready cryptography                  |
|    - luxfi/threshold   TSS/MPC protocols                      |
|    - luxfi/database    Pluggable backends                     |
|    - ... (22 more)                                            |
+---------------------------------------------------------------+
|  GOLANG STDLIB (curated)                   [Minimal surface]  |
|    - golang.org/x/sys                                         |
|    - golang.org/x/net                                         |
|    - golang.org/x/crypto                                      |
|    - google.golang.org/grpc                                   |
+---------------------------------------------------------------+
|  EXTERNAL (50 packages)                    [Audited, pinned]  |
|    - Zero database deps in default build                      |
+---------------------------------------------------------------+

Binary & Build Metrics

Size Comparison

MetricLuxAvalanchegoDelta
Binary Size41 MB88 MB-53%
Compiled Modules147~300-51%
Module Graph Edges23,653~40,000+-40%
Unique Modules620~1,000+-38%
Build Time (cached)~15s~45s-67%

Dependency Counts

CategoryCountNotes
Direct Dependencies80Curated
Luxfi Internal30Fully controlled
Compiled into Binary147Minimal
Workspace Packages80Monorepo

Top External Dependencies

PackageImport CountPurpose
golang.org/x/sys887System calls
golang.org/x/net601Networking
golang.org/x/crypto419Cryptography
google.golang.org/protobuf394Serialization
google.golang.org/grpc259RPC

Zero external database dependencies in default build.


Codebase Scale

ComponentFilesPurpose
node1,686 .goCore validator node
geth1,246 .goEVM execution layer
coreth563 .goC-Chain integration
consensus264 .goBFT consensus engine
crypto44,218 LOCPost-quantum + classic
threshold57,028 LOCTSS/MPC protocols
precompiles19,852 LOCNative L1 features

Test Coverage

ComponentTest Files
node525
geth388
coreth169
crypto54
threshold107
Total1,243+

Smart Contracts: 5,714 .sol files (DeFi, governance, bridges)


Luxfi Internal Packages

22 packages compiled into every node binary:

luxfi/ai          // AI inference & mining
luxfi/cache       // High-performance caching
luxfi/consensus   // Custom BFT (no snow deps)
luxfi/constants   // Network constants
luxfi/coreth      // C-Chain with precompiles
luxfi/crypto      // PQ-ready cryptography
luxfi/database    // Pluggable (badger/leveldb/pebble)
luxfi/genesis     // Network initialization
luxfi/geth        // Streamlined EVM
luxfi/go-bip32    // HD wallets
luxfi/go-bip39    // Mnemonic support
luxfi/ids         // Identifiers
luxfi/log         // Structured logging
luxfi/math        // Safe arithmetic
luxfi/metric      // Prometheus metrics
luxfi/mock        // Testing utilities
luxfi/p2p         // libp2p networking
luxfi/threshold   // TSS protocols
luxfi/trace       // Distributed tracing
luxfi/utils       // Common utilities
luxfi/vm          // VM interfaces
luxfi/warp        // Cross-chain messaging

Feature Comparison

Precompiles (Native L1 Contracts)

CategoryLux PrecompilesAvalanche
DeFiPool Manager, Lending, Synthetics, Transmuter, Alchemist, Liquidation, Interest Rates✗ None
AIAI Mining, Inference✗ None
PQ CryptoML-DSA, SLH-DSA, FROST, Ringtail✗ None
MPCCGGMP21, Quasar✗ None
GovernanceFee Manager, Reward Manager, Deployer Allowlist, TX Allowlist✓ Basic
InteropWarp (8 files), Native Asset, Native Minter✓ Partial

Total: 24+ precompiles vs ~8

Cryptographic Capabilities

AlgorithmLuxAvalancheNotes
BLS12-381Aggregate signatures
BN256Pairing-based
secp256k1ECDSA
ML-DSA (Dilithium)NIST PQC
SLH-DSA (SPHINCS+)Hash-based
FROST (Threshold)Threshold Schnorr
Lattice (Lattigo)FHE/lattice ops
CGGMP21 (MPC)Threshold ECDSA
HPKEHybrid encryption
IPAInner product args

Database Backend

AspectBadgerDB (Lux)Pebble (Avalanche)
DesignSSD-optimized LSMGeneric LSM
Write AmplificationLowHigh
Point Lookups3-10x fasterBaseline
Memory EfficiencyEfficientHeavy
CGO DependencyNone (pure Go)Required
Binary Impact+2MB+8MB

Performance Implications

AspectImpact
Cold Start2x faster (41MB vs 88MB load)
Memory~40% less resident memory
Docker Pull~50% faster image transfer
CI/CD~50% faster pipelines
Attack Surface51% fewer modules to audit
CVE ExposureDramatically reduced

Security Advantages

Supply Chain Attack Resistance

  1. Fewer dependencies: 147 vs 300 modules = 51% less attack surface
  2. Internal control: 30 luxfi packages can be patched immediately
  3. Pinned versions: No automatic upstream pulls
  4. Audit scope: Clear, bounded codebase

Immediate Response Capability

When a CVE is disclosed:

  • Avalanche: Wait for upstream fix, hope it merges
  • Lux: Patch immediately, deploy within hours

Zero Trust Dependencies

Dependency TypePolicy
CryptographicFork and audit
DatabaseFork and optimize
NetworkingFork and harden
SerializationStdlib only
External servicesNone in critical path

Test Cases

Binary Size Verification

# Build and measure
go build -o luxd ./cmd/luxd
ls -lh luxd  # Should be ~41MB

Module Count Verification

go mod graph | wc -l  # Should be ~23,653 edges
go list -m all | wc -l  # Should be ~620 unique

Dependency Audit

# List all external (non-luxfi) dependencies
go list -m all | grep -v luxfi | wc -l

Reference Implementation

The supply chain control is implemented across:

RepositoryPurpose
luxfi/nodeCore validator with internal deps
luxfi/gethForked EVM with precompiles
luxfi/corethC-Chain integration
luxfi/cryptoPQ cryptography
luxfi/thresholdTSS/MPC protocols
luxfi/consensusBFT engine

Backwards Compatibility

This LP documents existing implementation. No changes required.

Security Considerations

This LP itself is a security measure. By documenting the supply chain:

  1. Auditors understand the dependency model
  2. Contributors follow the forking policy
  3. Security researchers have clear scope
  4. CVE response procedures are defined

Copyright and related rights waived via CC0.