Lux Precompiles

AI Mining Precompiles

GPU attestation and compute verification

AI Mining Precompiles

Native precompiles for AI compute attestation and mining operations.

Address Range

AI precompiles occupy addresses 0x0300 through 0x0302.

Precompiles

AddressPrecompileGasDescription
0x0300AI_MINING100,000ML-DSA signature verification, rewards
0x0301NV_TRUST50,000GPU TEE attestation (NVTrust)
0x0302MODEL_REGISTRY25,000AI model registration/verification

Hardware Trust Tiers

LevelHardwareMultiplierDescription
Sovereign (4)Blackwell1.5xFull TEE, highest trust
Confidential (3)H100/TDX/SEV1.0xHardware-backed confidential compute
Private (2)SGX/A1000.5xTrusted execution environment
Public (1)Consumer GPU0.25xStake-based soft attestation

Usage

import {IAIMining} from "@luxfi/precompile/ai/IAIMining.sol";
import {INVTrust} from "@luxfi/precompile/ai/INVTrust.sol";

contract ComputeProvider {
    IAIMining constant MINING = IAIMining(0x0300);
    INVTrust constant NVTRUST = INVTrust(0x0301);

    function startSession(bytes calldata teeQuote) external returns (bytes32 sessionId) {
        // Verify TEE quote from GPU
        require(NVTRUST.verifyQuote(teeQuote), "Invalid TEE quote");

        // Start mining session
        sessionId = MINING.startSession(msg.sender, teeQuote);
    }

    function heartbeat(bytes32 sessionId) external returns (uint256 reward) {
        // Submit proof of work and receive rewards
        return MINING.heartbeat(sessionId);
    }
}

NVTrust Verification

The NVTrust precompile verifies NVIDIA Confidential Computing attestations:

// Verify a TEE quote
bool valid = NVTRUST.verifyQuote(teeQuote);

// Get hardware info from quote
(
    uint8 trustLevel,
    bytes32 gpuId,
    uint256 computeUnits
) = NVTRUST.parseQuote(teeQuote);

Model Registry

Register and verify AI models on-chain:

import {IModelRegistry} from "@luxfi/precompile/ai/IModelRegistry.sol";

IModelRegistry constant REGISTRY = IModelRegistry(0x0302);

// Register a model
bytes32 modelId = REGISTRY.register(
    "llama-3-70b",
    modelHash,
    metadata
);

// Verify model execution
bool valid = REGISTRY.verifyExecution(modelId, inputHash, outputHash, proof);

On this page