LPsLux Proposals
Q-Chain
LP-4042

lp-4042-gpu-cryptographic-acceleration


lp: 4042 title: GPU Cryptographic Acceleration description: Batch cryptographic kernels across Metal, CUDA and WebGPU — hashing, signature verification, key exchange and FHE — with byte-identical output across backends as the design invariant author: Lux Core Team (@luxfi) discussions-to: https://github.com/luxfi/lps/discussions status: Final implementation-cpp: shipped implementation-go: partial implementation-rust: none type: Standards Track category: Core tags: [gpu, crypto, keccak, ecrecover, bls, metal, cuda, webgpu]

  • lp-4010
  • lp-4040

Abstract

The luxcpp/gpu library provides batch cryptographic operations across Metal, CUDA and WebGPU backends: 30 compute shaders covering hashing, signature verification, key exchange and FHE. Byte-identical output across backends is the design invariant, enforced by a per-kernel known-answer test wherever a kernel is wired into a production path.

Not every shader is production-wired. The batch signature-verify (secp256k1, BLS12-381, Ed25519, sr25519), PQ and FHE kernels are optional overlays that fall back to the authoritative CPU path. That distinction is load-bearing and is why the table below separates "implemented" from "measured".

Operations

OperationMetalCUDAWGSLMeasured
Keccak-256 batchyesyesyes7.8 Mhash/s
BLAKE3 batchsee noteyesyes—
secp256k1 ecrecoveryesyesyes—
BLS12-381 verifyyesyesyes—
Ed25519 verifyyesyesyes—
sr25519 verifyyesyesyes—

"yes" denotes an implemented shader, not a production-wired hot path. Only rows with a number under Measured have been benchmarked; a dash means unmeasured, not fast.

BLAKE3 on Metal: the kernel fails 1 of 6 known-answer vectors and is not wired to consensus. A Metal BLAKE3 KAT has not been established. Treat the Metal BLAKE3 row as unavailable until it is.

C API

LuxError lux_gpu_keccak256_batch(LuxGPU* gpu, ...);
LuxError lux_gpu_ecrecover_batch(LuxGPU* gpu, ...);
LuxError lux_gpu_mldsa_verify_batch(LuxGPU* gpu, ...);
// 11 batch functions total

Security Considerations

An optional overlay must be optional in the failure direction too: a kernel that cannot dispatch, or that a device does not support, falls through to the authoritative CPU path and produces the same bytes. A GPU kernel is never the sole path to a consensus-relevant answer.

Copyright (C) 2024-2026, Lux Industries Inc. All rights reserved.

Licensed under the MIT License.