Lux Precompiles High-performance native EVM precompiles for the Lux blockchain
Native EVM precompiles providing high-performance cryptography, DEX operations, and blockchain primitives for the Lux Network.
Precompiles are native code executed by the EVM at reserved addresses, offering 10-100x performance improvements over equivalent Solidity implementations.
Category Precompiles Description Cryptography ML-DSA, ML-KEM, SLH-DSA, FROST, Ringtail, CGGMP21 Post-quantum and threshold signatures DEX PoolManager, Hooks, Lending, Perpetuals Uniswap v4-style DEX operations FHE Encrypted operations Fully Homomorphic Encryption Oracle Price feeds, GraphQL Native oracle and query interface AI GPU attestation, mining AI compute verification
# In your Solidity project
forge install luxfi/precompile
# foundry.toml remapping
@luxfi/precompile/=lib/precompile/
import { IMLDSA } from "@luxfi/precompile/mldsa/IMLDSA.sol" ;
import { IDEX } from "@luxfi/precompile/solidity/dex/IDEX.sol" ;
import { IFHE } from "@luxfi/precompile/fhe/IFHE.sol" ;
contract MyContract {
// Use precompiles for high-performance operations
function verifySignature ( bytes calldata sig , bytes32 msg ) external view {
IMLDSA ( 0x0200000000000000000000000000000000000006 ). verify (sig, msg );
}
}
Address Precompile Gas Description 0x...0005PQCrypto Variable Multi-algorithm PQ operations 0x...0006ML-DSA 100,000 FIPS 204 post-quantum signatures 0x...0007SLH-DSA 150,000 Stateless hash-based signatures 0x...0008Warp 120,000 Cross-chain BLS messaging 0x...0009ML-KEM 50,000 FIPS 203 key encapsulation 0x...000AQuasar Variable Quantum consensus operations 0x...000BRingtail 150,000 Post-quantum threshold signatures 0x...000CFROST 50,000 Schnorr threshold signatures 0x...000DCGGMP21 75,000 ECDSA threshold signatures
Address Precompile Gas Description 0x0400PoolManager 2.26μs Singleton pool management 0x0401SwapRouter Variable Optimized swap routing 0x0402HooksRegistry Variable Hook contract registry 0x0403FlashLoan Variable Flash loan facility
Address Precompile Description 0x...0080FHE Ops Encrypted arithmetic 0x...0081FHE Config Configuration 0x...0082FHE Gateway Decryption gateway 0x...0083Task Manager Async task management
Address Precompile Description 0x0500GraphQL Native G-Chain queries
Address Precompile Description 0x0300Attestation GPU TEE verification
Operation Precompile Pure Solidity Speedup DEX Swap 2.26μs ~200μs 88x ML-DSA Verify 50μs N/A - FROST Verify 45μs N/A - FHE Add 10μs N/A -