mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
The Quasar cert layers are the right cardinality of "Double Lattice +
Identity Rollup + optional Classical Fast-path", not "Triple Quantum":
BLS-12-381 classical fast-path (pairing) — empty in pure-PQ
Corona Ring-LWE threshold ML-DSA (luxfi/corona; production R-LWE)
Pulsar Module-LWE threshold ML-DSA (luxfi/pulsar; Class N1 byte-equal
to FIPS 204)
MLDSARollup per-validator ML-DSA-65 rolled into one STARK / Groth16 proof
(Z-Chain → P3Q)
"Triple Quantum" misled because BLS is classical — at most one of three
legs was quantum in the historic BLS+Corona+ZK shape. The honest PQ
cardinality is **Double Lattice** (Ring + Module). Pure-PQ profiles
drop BLS entirely and rely on Corona + Pulsar.
Corona is the academic R-LWE construction with trusted-dealer DKG;
it stays out of any open public-chain path. Corona is the production
Ring-LWE library (Pedersen DKG over R_q + proactive resharing).
Surface (in protocol/quasar/types.go):
QuasarCert.BLS → unchanged (classical fast-path, optional)
QuasarCert.Corona → QuasarCert.Corona (Ring-LWE threshold sig)
QuasarCert.MLDSAProof → QuasarCert.MLDSARollup (succinct identity rollup)
QuasarCert now also has a Pulsar field (Module-LWE threshold sig,
populated when wired)
QuasarSig.Corona → QuasarSig.Corona (also added Pulsar []byte)
FinalityEvent.Corona / MLDSAProof → Corona / Pulsar / MLDSARollup
New predicates:
QuasarCert.IsDoubleLattice() — Corona ∧ Pulsar (honest PQ count)
QuasarCert.HasClassicalFastPath() — len(BLS) > 0
QuasarCert.HasIdentityRollup() — len(MLDSARollup) > 0
The wire byte layout is unchanged (length-prefixed slots). Callers that
read the bytes don't notice. Source-level references that compiled
before the rename now compile against the new identifiers; bulk
rename swept the consensus repo (22 files, 219 insertions, 151
deletions) plus the engine/pq facing FinalityEvent.
Tests: GOWORK=off go test -short -count=1 ./... → all 28 packages green
(quasar suite 32s; integration 60s; no regressions).
55 lines
1.7 KiB
Go
55 lines
1.7 KiB
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
/*
|
|
Package consensus provides the Quasar family of consensus protocols for the
|
|
Lux blockchain network.
|
|
|
|
# Overview
|
|
|
|
The consensus system supports two modes -- linear chain (Nova, for P-Chain and
|
|
C-Chain) and DAG (Nebula, for X-Chain) -- with optional post-quantum finality
|
|
via BLS + Corona + ML-DSA threshold signing.
|
|
|
|
# Sub-Protocols
|
|
|
|
The Quasar family comprises:
|
|
|
|
- photon: K-of-N committee selection via Fisher-Yates with luminance weighting
|
|
- wave: Per-round threshold voting with FPC (Fast Probabilistic Consensus)
|
|
- focus: Confidence accumulation (beta consecutive successes = finality)
|
|
- nova: Linear chain consensus mode (wraps ray)
|
|
- nebula: DAG consensus mode (wraps field)
|
|
- prism: DAG geometry: frontiers, cuts, uniform peer sampling
|
|
- horizon: DAG order-theory: reachability, LCA, transitive closure
|
|
- flare: DAG certificate/skip detection (2f+1 quorum)
|
|
- ray: Linear chain finality driver
|
|
- field: DAG finality driver with safe-prefix commit
|
|
- quasar: BLS + Corona + ML-DSA parallel threshold signing
|
|
|
|
# Usage
|
|
|
|
import "github.com/luxfi/consensus"
|
|
|
|
chain := consensus.NewChain(consensus.DefaultConfig())
|
|
if err := chain.Start(ctx); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
defer chain.Stop()
|
|
|
|
# Signing Modes
|
|
|
|
Each cryptographic layer is independently toggleable:
|
|
|
|
- BLS-only: fastest classical consensus (BLS12-381 threshold)
|
|
- BLS + ML-DSA: dual with PQ identity proof (FIPS 204)
|
|
- BLS + Corona: dual with PQ threshold proof (Ring-LWE)
|
|
- BLS + Corona + ML-DSA: full Quasar (all three in parallel)
|
|
|
|
# Testing
|
|
|
|
go test ./...
|
|
go test -bench=. ./bench/
|
|
*/
|
|
package consensus
|