LPsLux Proposals
Threshold Cryptography
LP-7350

Attested Threshold Custody

Final

An operator-controlled extension surface for institutional custody that binds each sign call to a verified hardware attestation, a KMS release gate, an HSM-resident wrap key, and an explicit approval — while emitting wire bytes byte-identical to the permissionless path

Category
Core
Created
2026-05-31

Abstract

The default path for the post-quantum threshold stack is permissionless: any participant can verify, signatures bind to public consensus state, and no host sits in the trusted compute base. For institutional custody — M-Chain bridge custody operators, A-Chain confidential compute oracles, regulated tenant treasury — the stack also ships an operator-controlled extension surface that binds each sign call to a verified hardware TEE attestation, a KMS-issued release gate, an HSM-resident key, and a human or programmatic approval signature.

Wire output is byte-identical to the permissionless path. A relying party verifies with the same verifier and needs no awareness of which path produced the signature.

Motivation

Two threat models coexist:

  • Permissionless (the Lux primary network, every sovereign L1): an adversary may control any individual participant. Security must hold under that assumption. The default Pulsar threshold sign, Corona Pedersen DKG, and Magnetar THBS-SE constructions are designed for this model.
  • Institutional custody (a bridge custody operator, an oracle operator, a regulated treasury): an operator is delegated custody by a regulator or counterparty. The threat model permits trusted custody with attested release — a specific, audited, attested TEE binary is the only entity allowed to reconstruct a master key, and even then only with HSM wrap-key cooperation and out-of-band approval.

Both must be served without complecting them. The extension packages live in their own slot at ~/work/lux/threshold/protocols/{slhdsa-tee,mldsa-tee,rlwe-tee}/, distinct from the permissionless protocols at ~/work/lux/threshold/protocols/{pulsar,corona}/ and from the Magnetar standalone primitive at ~/work/lux/magnetar/ref/go/pkg/magnetar/.

Specification

Extension package layout

~/work/lux/threshold/protocols/
  slhdsa-tee/        SLH-DSA (FIPS 205) operator-controlled threshold
    config.go
    doc.go
    envelope.go
    sign.go
    signer.go
    signer_test.go
    curve25519_test.go
    testdata/

  mldsa-tee/         ML-DSA (FIPS 204) operator-controlled threshold
    config.go
    doc.go
    envelope.go
    sign.go
    signer.go
    signer_test.go
    curve25519_test.go
    testdata/

  rlwe-tee/          Module-LWE (Corona track) operator-controlled threshold
    config.go
    doc.go
    envelope.go
    sign.go
    signer.go
    signer_test.go
    curve25519_test.go
    testdata/

Each package is symmetric in shape. The wire output of each is byte-identical to the corresponding default primitive — Magnetar, Pulsar, Corona. The threshold of trust changes; the wire does not.

Composition with the MPC subsystems

The extension packages do NOT reimplement attestation, key release, or HSM access. They compose four subsystems from ~/work/lux/mpc/.

Attestation verification — mpc/cc/attest

~/work/lux/mpc/cc/attest/
  doc.go
  verifier.go        chain-validating dispatcher
  verifier_test.go
  tdx.go             Intel TDX evidence parser + verifier
  sev.go             AMD SEV-SNP evidence parser + verifier
  nras.go            NVIDIA NRAS GPU evidence parser + verifier
  testdata/

attest.Dispatch(evidence) → (report, error) is the single entry point. The dispatcher routes to the per-vendor parser by evidence magic, validates the certificate chain against the pinned vendor root (Intel, AMD, NVIDIA), checks the RIM digest against policy, and returns the parsed report. A sign call MUST pass through this dispatcher; bypassing it disables the extension's security posture entirely.

Attestation-gated key release — mpc/pkg/kms.ReleaseGate

ReleaseGate is the interface every key-release primitive satisfies. Three implementations:

ImplementationUse
LocalReleaseGatesingle-process KMS root; development or single-tenant production
MPCReleaseGatet-of-n KMS quorum; institutional production
HSMReleaseGateHSM-backed root via mpc/pkg/hsm

ReleaseGate.Release(ctx, job, composite) consumes a parsed attestation report and emits the HPKE-sealed wrap key. The AAD binds (epoch, jobID, teePub, issuedNonce). Replay across epoch or job ID is refused.

HSM-resident wrap key — mpc/pkg/hsm.Provider

~/work/lux/mpc/pkg/hsm/
  provider.go        Provider interface
  factory.go         provider factory by URI scheme
  aws.go             AWS KMS
  azure.go           Azure Key Vault
  gcp.go             GCP Cloud KMS
  file.go            local file (development only)
  kms.go             Lux KMS (MPC, in-cluster)

The wrap key never leaves the HSM. The release gate calls Provider.Sign(ctx, keyURI, digest) to emit an HPKE-sealed ciphertext; the attested TEE is the only recipient able to unwrap it. Zymbit and YubiHSM are reachable through Provider-implementing wrappers, routed by URI scheme in the factory.

Approval — mpc/pkg/approval

~/work/lux/mpc/pkg/approval/
  types.go
  factory.go
  helpers.go
  provider_safe.go              Safe multisig
  provider_webauthn.go          WebAuthn passkey
  provider_ledger_enterprise.go Ledger Enterprise
  provider_local_dev.go         single-key local (development)

ApprovalProvider.Authorize(ctx, jobID, msg) → ApprovalEvidence gates each sign call on an explicit authorization. The WebAuthn provider binds to a per-operator passkey and emits a signed challenge that the release gate verifies before releasing the wrap key.

The sign chain

A single sign call composes the four subsystems:

1.  attest.Dispatch(evidence)          → report
2.  policy.Check(report)               → policyOK
3.  approval.Authorize(jobID, msg)     → approvalEvidence
4.  gate.Release(ctx, job, composite)  → wrappedSeed
5.  hsm.Sign(ctx, keyURI, digest)
       OR
    inProcessSign(seed, msg)           → signature
6.  return signature                    (byte-identical to FIPS-spec output)

Each step's output is the next step's input. Failure at any step aborts the call WITHOUT emitting a signature.

For SLH-DSA (slhdsa-tee), step 5 reconstructs the master seed inside attested TEE memory, calls slhdsa.SignDeterministic, and zeroizes before return. The seed is briefly present in TEE memory; that is the threshold-of-trust difference against the permissionless THBS-SE construction (LP-4550), where no party EVER holds the seed.

For ML-DSA (mldsa-tee) and Module-LWE / Corona (rlwe-tee), step 5 is analogous: the master key lives sealed at rest, is briefly resident in attested TEE memory during the FIPS-spec sign call, and is zeroized before return.

When to use each path

Use caseDefault (permissionless)Attested extension
Public consensus certyes — Pulsar / Corona / MagnetarNO
M-Chain bridge custodypossible (Magnetar standalone)YES (slhdsa-tee) — preferred
A-Chain confidential compute oracleNO — needs an attested binaryYES (mldsa-tee or rlwe-tee)
Regulated treasurypossible (multisig plus Magnetar)YES — operator-controlled
Permissionless DEXYESNO
Sovereign L1 finalityYES (PQ-heavy per LP-4990)NO

The decision rule: if the threat model permits "trusted custody with attested release", the attested extension is preferable, because it gives the operator HSM-grade wrap-key isolation and an audit trail per sign. If the threat model is permissionless — the adversary controls any participant — the default path is required, because TEE attestation is not a substitute for mathematical threshold protection against participant compromise.

Institutional parity

The institutional custody surface is contract-compatible across the feature matrix at ~/work/lux/mpc/FIREBLOCKS_PARITY.md. That parity document is the written contract for what the operator-side surface provides; each row points at a specific file in ~/work/lux/mpc/. Rows tagged shipped are shipped; rows tagged in-flight are tracked in their own LPs.

The parity statement is not "Lux replicates every field of an incumbent custody product". It is "the threat model and operational surface required to migrate an institutional custody deployment to Lux is met by ~/work/lux/mpc/ plus these three extension packages". The matrix is the verification artifact.

Rationale

Why distinct extension packages

Mixing TEE-gated and permissionless code paths in the same package conflates the trust model. A reviewer looking at ~/work/lux/threshold/protocols/pulsar/ should know without reading further that the package targets the permissionless model; reviewing ~/work/lux/threshold/protocols/mldsa-tee/ should immediately flag the institutional model.

The <primitive>-tee naming makes the trust model visible in every import path. A go.mod that imports mldsa-tee is making a specific deployment-model statement; one that imports pulsar is making a different one.

Why wire byte-identity

Relying parties — verifier contracts, light clients, external audit tooling — should not need to know which path produced a signature in order to verify it. Byte-identity means a contract that verifies slhdsa.Verify against a Magnetar group public key accepts signatures from both the permissionless (THBS-SE) and the institutional (slhdsa-tee) paths. The operational difference lives entirely in the production-side trust model, not in the output wire.

Why compose the MPC subsystems rather than reimplement

~/work/lux/mpc/ ships the attestation parsers, the release gate, the HSM provider abstractions, and the approval providers as audited, production-tested code. Reimplementing any of them in the threshold packages would fork the audit surface.

The extension packages are therefore SHALLOW: each is a thin envelope around mpc/cc/attest plus mpc/pkg/kms.ReleaseGate plus mpc/pkg/hsm plus mpc/pkg/approval, with the primitive-specific FIPS-spec sign call at the end.

Why approval is mandatory

A purely attestation-gated sign chain has no audit signal distinguishing "the TEE chose to sign" from "the TEE was instructed to sign". A WebAuthn or Ledger Enterprise approval emits a signed authorization tied to a specific human or programmatic identity, and the release gate verifies that authorization as part of the AAD. Without it, no wrap key is released.

The audit path consumes the tuple (attestation_report, approval_evidence, wrap_key_release, signature) and emits an append-only audit record. That is the operator-side artifact regulators consume.

Test Cases

Each extension package ships its own suite:

  • ~/work/lux/threshold/protocols/slhdsa-tee/signer_test.go — full sign-chain integration tests over the fixtures in that package's testdata/.
  • ~/work/lux/threshold/protocols/mldsa-tee/signer_test.go — symmetric tests for ML-DSA.
  • ~/work/lux/threshold/protocols/rlwe-tee/signer_test.go — symmetric tests for Module-LWE.

Each must include:

  1. Happy path — valid attestation plus valid approval plus valid HSM response produces a signature byte-identical to a single-party FIPS-spec SignDeterministic on the reconstructed master key.
  2. Attestation failure — invalid evidence, sign refused.
  3. Approval failure — invalid approval signature, wrap key not released, sign refused.
  4. HSM failure — HSM rejects the unwrap, sign refused.
  5. Replay — the same (epoch, jobID), second release call refused.

Composition coverage lives with the composed subsystems: ~/work/lux/mpc/cc/attest/verifier_test.go for chain validation across TDX, SEV-SNP, and NRAS evidence; ~/work/lux/mpc/pkg/kms/release_test.go and release_nonce_test.go for release-gate semantics and single-use nonce binding; ~/work/lux/mpc/pkg/hsm/hsm_test.go for the provider factory and per-provider sign correctness.

Reference Implementation

  • ~/work/lux/threshold/protocols/slhdsa-tee/doc.go — the SLH-DSA-TEE package contract.
  • ~/work/lux/threshold/protocols/mldsa-tee/doc.go — the ML-DSA-TEE package contract.
  • ~/work/lux/threshold/protocols/rlwe-tee/doc.go — the R-LWE-TEE package contract.
  • ~/work/lux/mpc/cc/attest/verifier.go — attest.Dispatch and the per-vendor parsers.
  • ~/work/lux/mpc/pkg/kms/release.go — the ReleaseGate interface, Release, and LocalReleaseGate.
  • ~/work/lux/mpc/pkg/hsm/provider.go and factory.go — the Provider interface and the provider factory.
  • ~/work/lux/mpc/pkg/approval/types.go — the ApprovalProvider interface.
  • ~/work/lux/mpc/pkg/approval/provider_webauthn.go and provider_ledger_enterprise.go — the approval providers.
  • ~/work/lux/mpc/FIREBLOCKS_PARITY.md — the institutional parity contract.

Security Considerations

The extension surface trades a fundamentally different threat model than the permissionless path. The default Pulsar, Magnetar, and Corona constructions hold under "the adversary controls any participant"; the attested extensions hold under "the adversary controls the host outside the TEE AND lacks valid attestation evidence".

A relying party CANNOT distinguish, from the signature wire bytes alone, which threat model produced the signature. The relying party trusts the GROUP PUBLIC KEY the extension binds to. The threat-model decision is therefore whose group public key the relying party accepts.

For consensus certs, the group public key MUST be one produced under the permissionless threat model. An extension-produced key would mean a single operator can produce arbitrary signatures by attesting their own TEE binary, which collapses consensus liveness to that one operator's availability.

For bridge custody and oracle attestation, the extension-produced group public key is the right choice — the operator's audit trail, attestation chain, and approval log together form the trust basis.

Mixing the two MUST be deliberate and documented. A relying party that accepts both should distinguish them in its policy layer — "this group public key signs bridge withdrawals only; that one signs consensus certs only". The wire codec does not enforce the distinction; the policy does.

Replay protection is load-bearing. The AAD over (epoch, jobID, teePub, issuedNonce) means the same wrap key cannot be re-released for a different sign even by the same TEE, and a captured attestation cannot be reused at a later epoch. The single-use nonce is the operational guard against a TOCTOU window between gate release and sign; weakening it is a regression.

Copyright and related rights waived via CC0.