Quasar Cert Composition
How the post-quantum threshold stack composes inside a Quasar certificate — the pure-function leg composition, the per-primitive wire codecs, and the external verifier byte-identity guarantee.
Abstract
Quasar is the consensus protocol that drives every Lux primary network and every
sovereign L1 spawned from it. At the end of each round validators emit one
certificate. This LP specifies how that certificate is composed: the
production cert profile stacks three independently auditable post-quantum
primitives (Magnetar, Pulsar, Corona) over a classical BLS fast-path, with a
zero-knowledge proof leg available for execution-side certification. Each
primitive ships its own wire codec, its own external verifier surface via
cloudflare/circl, and its own EasyCrypt mechanized security proof; the
composition is the pure function that layers them.
Motivation
A consensus certificate is two distinct concerns braided into one bytes blob: (1) the cryptographic primitives that produce signatures, and (2) the policy that decides which primitives MUST appear for the cert to be accepted by a given environment. Decomplecting these is the central design move:
- Each primitive owns its own ceremony, its own wire codec, its own Lean / EasyCrypt artifact, and its own KAT suite.
- Composition is a pure function over already-produced signatures from those primitives. It does not orchestrate the ceremonies; it composes their outputs.
- The composition predicate (
IsPolaris,IsDoubleLattice,HasHashBased) names what is present. The environment's profile setting picks the predicate the cert must satisfy.
This shape lets each primitive evolve on its own cadence (new parameter set, new wire version, new KAT vectors) without rippling through the others.
Specification
Quasar protocol surface
The Quasar protocol package lives at luxfi/consensus protocol/quasar/. The
surface is:
quasar.go - protocol entry point
polaris.go - cert profile composition + wire helpers
wave_signer.go - wave (per-validator) signing logic
round_digest.go - canonical round digest derivation
core.go - per-round state machine
engine.go - engine entry point
types.go - QuasarCert and the four primitive-leg structs
Each Quasar round produces ONE QuasarCert (see types.go). The cert struct is
the same shape across all three production profiles; the profile selector
decides which legs are populated:
| Profile | Legs |
|---|---|
| Pulsar | BLS ‖ Pulsar ‖ ZK (minimum PQ posture) |
| Aurora | BLS ‖ Pulsar ‖ Corona ‖ ZK (intra-lattice diversity) |
| Polaris | BLS ‖ Pulsar ‖ Corona ‖ Magnetar ‖ ZK (cross-family maximum) |
Cert scheme byte: CertSchemeQuasar = 0x05 across all three profiles. Absent
legs are encoded as zero-length frames. A relying party calls IsPolaris(cert) /
IsDoubleLattice(cert) / HasHashBased(cert) to learn what is present without
re-parsing. The operator-facing profile selectors are specified in LP-4900
(Aurora) and LP-4910 (Polaris).
Cert composition
ComposePolaris is the pure function the consensus engine calls at round end.
It takes the already-produced signatures from each primitive and emits the cert.
The PolarisLegs input struct is declared in
luxfi/consensus protocol/quasar/polaris.go and carries:
BLS— the BLS-12-381 G1 aggregate signature (LP-4110)Pulsar— the threshold ML-DSA-65 signature (LP-4450 / FIPS 204)Corona— the threshold M-LWE signature (FIPS-track lattice sibling for defense-in-depth, eprint 2024/1113; LP-4470)Magnetar— the per-validator standalone SLH-DSA signatures (FIPS 205) OR the THBS-SE selected-element threshold output (LP-4540)
ErrPolarisMissingLeg is returned when the maximal profile is requested but any
of Pulsar / Corona / Magnetar is empty.
Wire codecs
Every PQ primitive ships its own wire codec. Each codec is an 11-byte header
(magic(4) ‖ version(2) ‖ mode(1) ‖ len(4)) followed by the primitive's
canonical wire-format payload. The header bytes are domain-separated so that a
frame from one primitive fed into another's parser is rejected at first
dispatch:
| Primitive | Sig magic | Group-key magic | Defined in |
|---|---|---|---|
| Pulsar | PULS (0x50554C53) | PULG (0x50554C47) | luxfi/pulsar ref/go/pkg/pulsar/wire.go |
| Magnetar | MAGS (0x4D414753) | MAGG (0x4D414747) | luxfi/magnetar ref/go/pkg/magnetar/wire.go |
| Corona | CORS (0x434F5253) | CORG (0x434F5247) | luxfi/corona wire/wire.go |
Bounded reads: every length prefix is checked against the remaining bytes BEFORE
allocation. The declared payload length is also pinned to the canonical
FIPS-mandated size for the declared mode (e.g. a PULS frame claiming a 4 GiB
payload for ModeP65 is refused before any buffer allocation).
Trailing-garbage policy: STRICT across all three primitives.
UnmarshalBinary returns an error if any byte remains after the declared frame.
External verifier paths
The cryptographic content of each PQ primitive's wire payload is byte-identical
to the corresponding FIPS-204 / FIPS-205 / FIPS-203 single-party signature on
the same (message, group_public_key) tuple. This is the Class-N1 manifesto.
A relying party that strips the 11-byte header obtains the underlying FIPS wire
bytes that the unmodified cloudflare/circl verifier accepts. This means:
- A Pulsar signature can be verified by
cloudflare/circl/sign/mldsa/mldsa65.Verify(with the parallel branch forModeP44/ModeP87) without any Lux-specific code. - A Magnetar signature can be verified by
cloudflare/circl/sign/slhdsa.Verify(across all three modes: M192s / M192f / M256s). - A Corona signature has its own M-LWE verifier; the byte-identity claim is to the threshold-emitted Corona reference implementation, NOT to a NIST FIPS sibling (Corona is FIPS-track-aligned but not a FIPS standard).
This external verifier path is the surface luxfi/threshold/pkg/thresholdd
publishes over JSON-RPC and the surface that independent verifiers (other mpcd,
bridge nodes, L1 verifier contracts) consume.
Test gates
Wire byte-identity is pinned by these tests:
luxfi/pulsarref/go/pkg/pulsar/wire_test.go::TestPulsar_Wire_FIPS204Verifiable— round-trips aPULSframe, then strips the header and feeds the payload tocloudflare/circl/sign/mldsa/mldsa65.Verify(and the parallel modes). Failure means a Pulsar wire change has broken FIPS 204 parity.luxfi/magnetarref/go/pkg/magnetar/wire_test.go::TestMagnetar_Wire_FIPS205Verifiable— round-trips aMAGSframe, strips, feeds tocloudflare/circl/sign/slhdsa.Verifyacross M192s / M192f / M256s.luxfi/coronawire/wire_test.go— wire round-trip suite forCORS/CORG.luxfi/magnetarref/go/pkg/magnetar/thbsse_test.go::TestThbsSE_Wire_FIPS205Verifiable— the THBS-SE byte-identity gate.
Lean ↔ EasyCrypt bridge
Each PQ primitive ships an EasyCrypt mechanized security proof under
proofs/easycrypt/. The bridge into Lean (where the higher-level consensus
invariants live) is via axiom citations: a Lean theorem cites N EasyCrypt
lemmas, each of which has been verified under the EasyCrypt elaboration.
The invariant: 5/5 axiom citations resolved for each of pulsar, corona, and magnetar. Specifically:
- Pulsar EasyCrypt artifacts at
luxfi/pulsarproofs/easycrypt/Pulsar_N1*.ec. The N1 manifesto (FIPS 204 byte-identity) isPulsar_N1.ecand its sign / combine refinements atPulsar_N1_Sign_Refinement.ec/Pulsar_N1_Combine_Refinement.ec. - Corona EasyCrypt artifacts at
luxfi/coronaproofs/easycrypt/Corona_N1*.ec. Symmetric shape to pulsar. - Magnetar EasyCrypt artifacts at
luxfi/magnetarproofs/easycrypt/.
The Lean side ingests these as axioms keyed on the EasyCrypt artifact name. Adding a new primitive to the cert profile family requires adding the corresponding EasyCrypt artifacts and Lean axiom citations; otherwise the cert profile is rejected at the formal-verification gate.
Implementation status: PARTIAL — the Pulsar and Corona N1 artifacts are
present; the Magnetar proofs/easycrypt/ directory exists and its N1 artifact
lands alongside the Magnetar paper.
Rationale
Why one cert struct, three profiles
Three production profiles share one wire shape because relying parties (bridge
contracts, light clients, external verifiers) should not need to know the
profile to parse the cert. They parse the cert, then apply the composition
predicate (IsPolaris, HasHashBased) against the policy they enforce. Profile
policy is the relying party's concern; profile shape is invariant.
Why pure-function composition
Each primitive's threshold ceremony is non-trivial: Pulsar's algebraic threshold sign has its own three-round protocol, Corona's Pedersen DKG has its own bootstrap dance, Magnetar's THBS-SE has its own commit / reveal layout. Braiding the ceremonies in a single composition orchestrator would tie the orchestrator's release cadence to the slowest primitive.
ComposePolaris instead takes signatures as inputs. The consensus engine waits
on whichever ceremonies the profile requires, then calls compose at the end. New
primitives slot in by adding a new field to PolarisLegs and a new wire frame;
existing primitives do not change.
Why external verifier byte-identity
A relying party that can call cloudflare/circl/sign/{mldsa,slhdsa} needs no
Lux-specific code to verify a Quasar cert leg. This is the strongest possible
composability statement: a smart contract on any chain that exposes a PQ
verifier precompile can check a Lux cert leg without depending on Lux.
Test Cases
The four headline test gates listed in §"Test gates" are run on every change to any PQ primitive. A wire-format change that breaks any of them is a regression.
Cross-primitive composition is tested at luxfi/consensus
protocol/quasar/cert_roundtrip_test.go and
protocol/quasar/triple_sign_test.go. These exercise the full ComposePolaris
path with synthetic per-leg signatures.
Reference Implementation
luxfi/consensusprotocol/quasar/polaris.go— the cert profile composition contract,ErrPolarisMissingLeg, and thePolarisLegsinput struct.luxfi/pulsarref/go/pkg/pulsar/wire.go—PULS/PULGframe layout.luxfi/magnetarref/go/pkg/magnetar/wire.go—MAGS/MAGGframe layout.luxfi/coronawire/wire.go—CORS/CORGframe layout.luxfi/pulsarproofs/easycrypt/Pulsar_N1.ec— N1 manifesto artifact.luxfi/coronaproofs/easycrypt/Corona_N1.ec— N1 manifesto artifact.
Security Considerations
The composed cert's security floor is the SECOND-WEAKEST primitive in the composition. A single broken primitive does not break the cert; the relying party simply switches its enforced profile down. This is the operational value of cross-family diversity (hash-based Magnetar AND lattice-based Pulsar) AND intra-lattice diversity (Pulsar and Corona, both Module-LWE).
The wire codec's strict trailing-garbage policy closes a malleability vector: a relying party that accepted trailing bytes would accept two distinct frames that decode to the same payload, breaking equality semantics in downstream consensus state.
The pure-function compose contract is a non-trivial assertion of non-equivocation: each primitive's threshold ceremony binds to the round digest, and the round digest is a function of the proposer's block and the validator-set commitment. A primitive that emits a signature on a different digest is producing a signature on a different message, and the relying party's verifier will reject it.
Copyright
Copyright and related rights waived via CC0.