Precompile
Lux Precompiles
39+ native EVM precompiles for post-quantum crypto, DeFi, ZK proofs, and more
Lux Precompiles (github.com/luxfi/precompile) extend the EVM with native operations that run at near-hardware speed. Over 39 precompiles are organized across post-quantum cryptography, DeFi, ZK proofs, privacy, and threshold signatures.
Address Map
| Range | Category | Examples |
|---|---|---|
0x0300-0x03FF | AI/ML | AI Mining, NVTrust, Model Registry |
0x0400-0x04FF | DeFi | PoolManager (Uniswap v4), SwapRouter, Lending, Perps |
0x0500-0x05FF | Graph/Query | GraphQL, Subscriptions, Cache |
0x0600-0x06FF | Post-Quantum | ML-DSA, ML-KEM, SLH-DSA, Quasar |
0x0700-0x07FF | Privacy | FHE, ECIES, Ring Signatures, HPKE |
0x0800-0x08FF | Threshold | FROST, CGGMP21, Ringtail |
0x0900-0x09FF | ZK Proofs | KZG, Groth16, PLONK, Halo2 |
0x0A00-0x0AFF | Curves | secp256r1 (P-256) |
Performance (M1 Max)
| Operation | Latency | Throughput |
|---|---|---|
| DEX Swap | 2.26 us | 443K ops/sec |
| ModifyLiquidity | 2.87 us | 348K ops/sec |
| PoolKeyID | 439 ns | 2.7M ops/sec |
| HookPermission | 0.45 ns | 2.2B ops/sec |
Chain Activation
| Chain | Precompiles Enabled |
|---|---|
| C-Chain | All (full feature set) |
| Z-Chain (Zoo) | Warp, PoolManager, SwapRouter, AIMining, GraphQL |
| D-Chain (DEX) | Warp, full DEX suite, GraphQL |
| K-Chain (Keys) | Warp, PQ Crypto, Privacy, Threshold, GraphQL |
| Q-Chain (Quantum) | Warp, full PQ suite, Ringtail, GraphQL |
| B-Chain (Bridge) | Warp, TeleportBridge, GraphQL |
Installation
go get github.com/luxfi/precompile# Run tests
go test -v ./...
# Run benchmarks
go test -bench=. -benchmem ./dex/...