LPsLux Proposals
LP-3520

Precompile Suite Overview

Review

Comprehensive overview of all EVM precompiles for Lux Network including access control, fee management, cross-chain, and cryptography

Created
2025-11-14

Abstract

This LP provides a complete index of the Lux Network EVM precompile suite. The suite includes 12 precompiled contracts spanning access control, fee management, native token operations, cross-chain messaging, and cryptographic signature verification. Precompiles are organized into two address ranges: the Lux stateful precompile range (0x0200...0001 through 0x0200...000D) and the standard Ethereum precompile range (0x0...0100 for RIP-7212).

Motivation

As the Lux Network precompile suite has grown to include 13 precompiled contracts across multiple categories, developers and auditors need a single reference document that provides:

  1. Complete Address Map: All precompile addresses in one place, eliminating the need to search multiple LPs
  2. Gas Cost Comparison: Side-by-side gas costs to help developers choose the right precompile for their use case
  3. Security Classification: Clear distinction between classical, post-quantum, and hybrid cryptographic precompiles
  4. Implementation Status: Current state of each precompile's development and documentation
  5. Usage Patterns: Common integration patterns and code examples

Without a central index, developers must navigate dozens of individual LPs to understand the full precompile landscape. This overview serves as the canonical reference for all Lux Network precompiles.

Precompile Address Map

Lux Stateful Precompiles

AddressNamePurposeLP ReferenceStatus
0x0200000000000000000000000000000000000001DeployerAllowListContract deployment permissions-Final
0x0200000000000000000000000000000000000002TxAllowListTransaction submission permissions-Final
0x0200000000000000000000000000000000000003FeeManagerDynamic fee configurationLP-2314Draft
0x0200000000000000000000000000000000000004NativeMinterNative token minting-Final
0x0200000000000000000000000000000000000005RewardManagerValidator reward distribution-Final
0x0200000000000000000000000000000000000006ML-DSAPost-quantum lattice signaturesLP-2311Draft
0x0200000000000000000000000000000000000007SLH-DSAPost-quantum hash-based signaturesLP-2312Draft
0x0200000000000000000000000000000000000008WarpCross-chain BLS messagingLP-2313Draft
0x020000000000000000000000000000000000000AQuasarQuantum consensus certificatesLP-4110Draft
0x020000000000000000000000000000000000000BRingtailPQ threshold signatures (Ring-LWE)LP-7324Draft
0x020000000000000000000000000000000000000CFROSTSchnorr threshold signaturesLP-7321Draft
0x020000000000000000000000000000000000000DCGGMP21ECDSA threshold signaturesLP-7322Draft

Standard Ethereum Precompiles

AddressNamePurposeLP ReferenceStatus
0x0000000000000000000000000000000000000100secp256r1P-256 ECDSA verification (RIP-7212)LP-2204Final

Gas Cost Comparison

Signature Verification Precompiles

PrecompileBase CostPer-Byte CostExample (32B msg)Security Level
ecrecover (native)3,000-3,000Classical
secp256r13,450-3,450Classical
ML-DSA100,00010100,320Post-Quantum (L3)
SLH-DSA15,0001015,320Post-Quantum (L1)

Threshold Signature Precompiles

PrecompileBase CostPer-Signer Cost3-of-5 ExampleSecurity Level
FROST50,0005,00075,000Classical
CGGMP2175,00010,000125,000Classical
Ringtail150,00010,000200,000Post-Quantum

Cross-Chain and Consensus Precompiles

PrecompileBase CostVariable CostTypical UsageNotes
Warp50,0001,000/validator~60,000BLS aggregate verification
Quasar200,000-200,000Dual-certificate finality

Access Control Precompiles

PrecompileRead CostWrite CostNotes
DeployerAllowList2,50020,000Role-based access
TxAllowList2,50020,000Role-based access
FeeManager2,10045,000Admin-only writes
NativeMinter2,50020,000Minter role required
RewardManager2,50020,000Reward distribution

Security Classification

Classical Cryptography (Vulnerable to Quantum Computers)

PrecompileAlgorithmSecurity AssumptionQuantum Risk
secp256r1ECDSA P-256Discrete LogHIGH - Shor's algorithm
FROSTSchnorrDiscrete LogHIGH - Shor's algorithm
CGGMP21ECDSADiscrete LogHIGH - Shor's algorithm
WarpBLS12-381Discrete Log / PairingHIGH - Shor's algorithm

Post-Quantum Cryptography (Quantum-Resistant)

PrecompileAlgorithmSecurity AssumptionNIST Level
ML-DSADilithium (FIPS 204)Module-LWE / Module-SISLevel 3 (192-bit)
SLH-DSASPHINCS+ (FIPS 205)Hash collision resistanceLevel 1 (128-bit)
RingtailRing-LWE thresholdRing-LWE / Ring-SISLevel 3 (128-bit PQ)

Hybrid Security (Classical + Post-Quantum)

PrecompileClassical ComponentPQ ComponentUse Case
QuasarBLS aggregate (Round 1)ML-DSA (Round 2)Consensus finality

Precompile Categories

1. Access Control Precompiles

These precompiles manage permissions for chain operations:

DeployerAllowList (0x...0001):

  • Controls which addresses can deploy contracts
  • Roles: None, Enabled, Admin
  • Use case: Permissioned chains, enterprise deployments

TxAllowList (0x...0002):

  • Controls which addresses can submit transactions
  • Roles: None, Enabled, Admin
  • Use case: Restricted chains, compliance requirements

2. Economic Precompiles

These precompiles manage chain economics:

FeeManager (0x...0003):

  • Dynamic EIP-1559 fee configuration
  • Gas limits, base fees, block gas costs
  • Admin-controlled with rate limiting
  • See LP-2314 for full specification

NativeMinter (0x...0004):

  • Mint native tokens to addresses
  • Minter role required
  • Use case: Bridge deposits, rewards

RewardManager (0x...0005):

  • Configure validator reward distribution
  • Set reward addresses and percentages
  • Admin-controlled

3. Cross-Chain Precompiles

Warp Messaging (0x...0008):

  • BLS signature aggregation for cross-chain messages
  • Verifies validator-signed inter-chain communication
  • 67% stake threshold for validity
  • See LP-2313 for full specification

4. Consensus Precompiles

Quasar (0x...000A):

  • Quantum-finality consensus certificates
  • Dual verification: BLS (Round 1) + ML-DSA (Round 2)
  • Sub-second finality (target: 500ms)
  • See LP-4110 for full specification

5. Post-Quantum Signature Precompiles

ML-DSA (0x...0006):

  • NIST FIPS 204 (Dilithium) signatures
  • Level 3 security (192-bit equivalent)
  • 1952-byte public keys, 3293-byte signatures
  • ~108us verification time
  • See LP-2311 for full specification

SLH-DSA (0x...0007):

  • NIST FIPS 205 (SPHINCS+) hash-based signatures
  • Level 1 security (128-bit equivalent)
  • 32-byte public keys, 7856-byte signatures
  • ~286us verification time
  • See LP-2312 for full specification

6. Threshold Signature Precompiles

FROST (0x...000C):

  • Schnorr threshold signatures (BIP-340 compatible)
  • Two-round protocol
  • Bitcoin Taproot compatible
  • See LP-7321 for full specification

CGGMP21 (0x...000D):

  • ECDSA threshold signatures with identifiable aborts
  • UC-secure with malicious party detection
  • Ethereum/Bitcoin ECDSA compatible
  • See LP-7322 for full specification

Ringtail (0x...000B):

  • Post-quantum threshold signatures (Ring-LWE)
  • Two-round protocol without trusted dealer
  • Quantum-safe multi-party signing
  • See LP-7324 for full specification

Implementation Status

PrecompileGo ImplementationSolidity InterfaceTestsDocumentation
DeployerAllowListCompleteCompleteCompleteComplete
TxAllowListCompleteCompleteCompleteComplete
FeeManagerCompleteCompleteCompleteLP-2314
NativeMinterCompleteCompleteCompleteComplete
RewardManagerCompleteCompleteCompleteComplete
ML-DSACompleteCompleteCompleteLP-2311
SLH-DSACompleteCompleteCompleteLP-2312
WarpCompleteCompleteCompleteLP-2313
QuasarCompleteCompleteCompleteLP-4110
RingtailCompleteCompleteCompleteLP-7324
FROSTCompleteCompleteCompleteLP-7321
CGGMP21CompleteCompleteCompleteLP-7322
secp256r1CompleteCompleteCompleteLP-2204

Activation Forks

Fork NamePrecompiles ActivatedTarget
GenesisDeployerAllowList, TxAllowList, FeeManager, NativeMinter, RewardManagerMainnet
TeleportWarpCross-chain
QuantumML-DSA, SLH-DSA, Ringtail, FROST, CGGMP21, QuasarPost-quantum
Granitesecp256r1Biometric wallets

Usage Patterns

Hybrid Signature Verification

For maximum security, combine classical and post-quantum signatures:

function verifyHybrid(
    bytes calldata ecdsaSig,
    bytes calldata mldsaSig,
    bytes calldata message
) internal view returns (bool) {
    // Classical signature (current security)
    bool classical = verifyECDSA(message, ecdsaSig);

    // Post-quantum signature (future security)
    bool quantum = IMLDSA(0x0200...0006).verify(pubKey, message, mldsaSig);

    // Both must pass
    return classical && quantum;
}

Threshold Wallet Selection

Choose threshold scheme based on requirements:

// For Bitcoin/Taproot compatibility
IFROST frost = IFROST(0x020000000000000000000000000000000000000C);

// For Ethereum ECDSA compatibility
ICGGMP21 cggmp = ICGGMP21(0x020000000000000000000000000000000000000D);

// For post-quantum security
IRingtail ringtail = IRingtail(0x020000000000000000000000000000000000000B);

Cross-Chain Message Verification

IWarp warp = IWarp(0x0200000000000000000000000000000000000008);

function receiveMessage(
    bytes32 messageHash,
    uint32 sourceChainId,
    bytes calldata aggregateSig,
    bytes calldata validatorBitset
) external {
    require(
        warp.verifyMessage(messageHash, sourceChainId, aggregateSig, validatorBitset),
        "Invalid cross-chain signature"
    );
    // Process message...
}

Precompile Specifications

  • LP-2311: ML-DSA Signature Verification Precompile
  • LP-2312: SLH-DSA Signature Verification Precompile
  • LP-2313: Warp Messaging Precompile
  • LP-2314: Fee Manager Precompile
  • LP-7321: FROST Threshold Signature Precompile
  • LP-7322: CGGMP21 Threshold ECDSA Precompile
  • LP-7324: Ringtail Threshold Signature Precompile
  • LP-4110: Quasar Consensus Protocol

Supporting Standards

  • LP-2204: secp256r1 Curve Integration (RIP-7212)
  • LP-4200: Post-Quantum Cryptography Suite
  • LP-4201: Hybrid Classical-Quantum Transitions
  • LP-6022: Warp Messaging 2.0

Cryptographic Foundations

  • LP-4316: ML-DSA Post-Quantum Digital Signatures (FIPS 204)
  • LP-4317: SLH-DSA Stateless Hash-Based Signatures (FIPS 205)
  • LP-4318: ML-KEM Post-Quantum Key Encapsulation (FIPS 203)

Rationale

Centralized Index

A single overview document provides several benefits:

  1. Discoverability: Developers can find all precompiles in one place
  2. Comparison: Easy to compare gas costs and features across precompiles
  3. Planning: Helps architects choose the right precompile for their use case
  4. Maintenance: Central location for status tracking and updates

Security Classification

Explicitly classifying precompiles by security level:

  1. Awareness: Developers understand quantum risks
  2. Migration Planning: Clear path from classical to post-quantum
  3. Risk Assessment: Informed decisions about cryptographic choices

Gas Cost Transparency

Publishing detailed gas costs enables:

  1. Cost Estimation: Accurate transaction fee predictions
  2. Optimization: Choose most efficient precompile for use case
  3. Budgeting: Plan gas costs for complex operations

Backwards Compatibility

This LP is informational and does not introduce any breaking changes. It documents existing precompiles and their interfaces.

Precompile Stability

All documented precompiles maintain backwards compatibility:

  • Address assignments are permanent
  • Interface changes follow semver principles
  • Deprecated features are marked but not removed

Cross-Reference Updates

As individual precompile LPs are updated, this overview will be updated to reflect:

  • New gas costs
  • Updated security classifications
  • New precompile additions

Security Considerations

Address Space

All Lux precompiles use the 0x0200... prefix to avoid collisions with:

  • Ethereum precompiles (0x01 - 0x0a)
  • Future Ethereum precompiles (0x0b - 0xff)
  • RIP precompiles (0x0...0100 range)

Gas Costs

Gas costs are calibrated to:

  • Prevent DoS attacks via expensive operations
  • Reflect actual computational cost
  • Enable practical use within block gas limits

Quantum Migration

The precompile suite provides a migration path:

  1. Current: Use classical signatures (ecrecover, secp256r1, FROST, CGGMP21)
  2. Transition: Use hybrid signatures (classical + PQ)
  3. Future: Use pure post-quantum (ML-DSA, SLH-DSA, Ringtail)

Copyright and related rights waived via CC0.