LPsLux Proposals
Q-Chain
LP-4875

lp-4875-contract-auth-precompiles


lp: 4875 title: Contract Auth Precompiles description: Four precompiles at 0x0301..0x0304 giving EVM contracts a strict-PQ authentication surface — ML-DSA-65, ML-DSA-87, SLH-DSA, and a Z-Chain proof verifier that returns an authenticated AccountID author: Lux Core Team (@luxfi) discussions-to: https://github.com/luxfi/lps/discussions status: Draft implementation-rust: none implementation-cpp: none implementation-go: partial type: Standards Track category: Core tags: [pq, contract-auth, precompile, z-chain, strict-pq]

  • lp-4400
  • lp-4500
  • lp-4294
  • lp-4960
  • lp-9015

Abstract

Four precompiles expose the strict-PQ contract-auth surface to EVM-compatible contracts:

  • 0x0301 — pq_verify_mldsa65, FIPS 204 ML-DSA-65 verify.
  • 0x0302 — pq_verify_mldsa87, FIPS 204 ML-DSA-87 verify (high-value).
  • 0x0303 — pq_verify_slh_dsa, FIPS 205 SLH-DSA verify (the hash-based backstop, for when a lattice break is the thing you are hedging against).
  • 0x0304 — pq_verify_z_auth_proof, a STARK_FRI_SHA3_PQ proof verifier that returns the authenticated 48-byte AccountID and verified_at_height.

Each returns (bool ok, bytes payload). Contracts call them via standard staticcall.

ecrecover is refused under LUX_STRICT_PQ.

That refusal is the design, not a side effect. ecrecover does not verify a signature against a key — it recovers a key from a signature, and every contract that trusts the recovered address is trusting secp256k1's hardness. There is no post-quantum analogue, because ML-DSA and SLH-DSA signatures are not key-recoverable. So the shape of the call changes: a contract must supply the public key it expects, rather than learning who signed after the fact. 0x0304 is the exception that restores the old ergonomics — the Z-Chain proof carries an authenticated AccountID, so the contract gets an identity back rather than having to know one in advance.

Profile

ProfileID:           0x01  (ProfileLuxStrictPQ)
ProfileName:         LUX_STRICT_PQ
HashSuiteID:         SHA3_NIST                (0x01)
IdentitySchemeID:    ML_DSA_65                (0x42)
ProofPolicyID:       STARK_FRI_SHA3_PQ        (0x10)
MinSoundnessBits:    128
MinHashOutputBits:   384
RequireTransparent:  true
ForbidPairings:      true
ForbidKZG:           true
ForbidTrustedSetup:  true
ForbidClassicalSNARKs: true
ForbidDevProofs:     true
ForbidFallbacks:     true

Bindings

  • luxfi/consensus/protocol/auth/precompile.go is the canonical reference; four PrecompileAddrPQVerify* constants pin the addresses at 0x0301..0x0304.
  • EVM-side binding: luxfi/evm/core/vm/contracts_pq.go. The gas schedule lives there, not in consensus — gas is an execution-layer concern and pinning it in the consensus package would give two packages an opinion on one number.
  • ecrecover (address 0x01) is refused under LUX_STRICT_PQ. The permissive profile (0x02) keeps it available for transition.
  • KAT vectors: luxfi/evm/core/vm/testdata/precompile_pq_v1.json.

Compliance

A contract calling ecrecover under LUX_STRICT_PQ reverts with ErrEcrecoverRefused. Contracts MUST migrate to one of staticcall(0x0301), staticcall(0x0302), staticcall(0x0303) or staticcall(0x0304) before profile activation.

References

  • HIP-0104 — the full contract-auth specification this LP binds to the luxfi package surface
  • NIST FIPS 204, FIPS 205, FIPS 202, SP 800-185
  • luxfi/consensus/protocol/auth/precompile.go

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

Licensed under the MIT License.