Lux Precompiled Contracts
Native EVM precompiles for the Lux blockchain. Each precompile is a Go package that implements contract.StatefulPrecompiledContract and registers via modules.RegisterModule() in its init().
Geth provides NewPrecompileAdapter() to wrap these into geth-compatible precompiles. L1 chains select which precompiles to enable via PrecompileOverrider.
Post-Quantum Cryptography (baseline — all Lux chains)
Package
Address
Description
Gas
mldsa
0x0200...0006
ML-DSA-65 signature verify (FIPS 204)
100k + 10/byte
slhdsa
0x0600...0001
SLH-DSA signature verify (FIPS 205)
15k–250k by mode
pqcrypto
0x9003
ML-KEM key encapsulation + hybrid PQ ops
variable
mlkem
0x0200...0007
ML-KEM-768 encapsulate/decapsulate
50k base
Package
Address
Description
Gas
frost
0x0800...0002
FROST Schnorr threshold verify (secp256k1/Ed25519)
50k + 5k/signer
cggmp21
0x0800...0003
CGGMP21 threshold ECDSA verify (secp256k1)
75k + 10k/signer
ringtail
0x0200...000B
Ring-LWE lattice threshold verify (post-quantum)
150k + 10k/party
Package
Address
Description
Gas
sr25519
0x0A00...0001
Schnorrkel verify for Substrate→EVM migration
9k + 3/byte
ed25519
0x3211...0000
Ed25519 signature verify
3k
secp256r1
0x0100
P-256 ECDSA verify (WebAuthn/passkeys)
3.5k
Package
Address
Description
Gas
blake3
0x0500...0004
Blake3 hash, Merkle root, KDF, XOF
100 + 3–5/word
kzg4844
0xB002
KZG polynomial commitment (EIP-4844)
50k
Package
Address
Description
Gas
zk
0x0900
ZK proof verification (Groth16, PLONK, fflonk, Halo2)
180k–500k
fhe
—
Fully homomorphic encryption ops
variable
ring
0x9202
Ring signature verification
variable
ecies
0x9201
ECIES encryption/decryption
variable
hpke
0x9200
Hybrid public key encryption
variable
Package
Address
Description
Gas
dex
0x0400...0000
Native DEX (PoolManager, Router, Hooks, Lending)
variable
Package
Address
Description
Gas
ai
0x0300...0000
AI mining (ML-DSA verify, TEE attestation, rewards)
variable
quasar
—
Hybrid consensus certificate verification
variable
dead
0x0000...0000
Dead address interceptor
minimal
graph
—
GraphQL query precompile
variable
bridge
—
Cross-chain bridge verification
variable
threshold
—
Threshold key management
variable
attestation
—
TEE/GPU attestation
variable
Package
Purpose
contract
Core interfaces (StatefulPrecompiledContract, AccessibleState)
modules
Module registration system and reserved address ranges
precompileconfig
Config interfaces (Upgrade, Timestamp, IsDisabled)
registry
Address-to-LP mapping
Each precompile follows this pattern:
<name>/
├── contract.go # Run(), RequiredGas(), Address()
├── contract_test.go # Tests with known vectors
├── module.go # init() → modules.RegisterModule()
└── I<Name>.sol # Solidity interface (optional)
Pick an address in a reserved range
Implement contract.StatefulPrecompiledContract
Register via modules.RegisterModule() in init()
Add tests (valid, invalid, gas, edge cases)
Wire into your L1 via PrecompileOverrider or geth's LuxPrecompiles()
go build ./...
go test ./...
go test -bench=. ./sr25519/ # benchmark a specific package
CGO is required for sr25519 (sr25519-donna C library). All other packages are pure Go.
Copyright (C) 2025, Lux Industries, Inc. All rights reserved.