mirror of
https://github.com/luxfi/threshold.git
synced 2026-10-30 15:15:53 +00:00
Adds the re-exports luxfi/consensus needs through the canonical
threshold/protocols alias surface so the consensus engine no longer
imports luxfi/corona/* or luxfi/pulsar/ref/go directly.
Protocols/corona top-level gains Params, NewParams, GenerateKeys,
VerifyBatch, VerifyBatchAll forwards on top of the existing
Signer/KeyShare/GroupKey/Round1Data/Round2Data/Signature/Verify/
NewSigner type aliases.
New subpackages mirror the luxfi/corona namespace:
protocols/corona/keyera -> luxfi/corona/keyera
protocols/corona/primitives -> luxfi/corona/primitives
protocols/corona/reshare -> luxfi/corona/reshare
protocols/corona/sign -> luxfi/corona/sign
protocols/corona/gpu -> luxfi/corona/gpu
A new protocols/pulsar subpackage mirrors luxfi/pulsar/ref/go/pkg/pulsar
covering Mode constants, Params/ParamsP{44,65,87}/ParamsFor, the
key/share/signature types, identity layer (IdentityKey,
IdentityDirectory, SymmetricSession, GenerateIdentity), two-round
threshold signing (ThresholdSigner, NewThresholdSigner, Combine),
DKG (DKGSession, NewDKGSession, DKGOutput, DKGRound1Msg, DKGRound2Msg),
and the single-party FIPS 204 baseline (GenerateKey, Sign, VerifyCtx).
The re-exports are type aliases and thin function forwards; no
behaviour change. The underlying corona kernel and pulsar reference
implementation are unchanged.
go.mod bumps luxfi/corona v0.4.1 -> v0.7.5 (needed for the gpu
subpackage, which appeared at v0.7.2) and adds luxfi/pulsar v1.0.12
matching the consensus consumer. Pre-existing prometheus-stack indirect
deps stripped by go mod tidy because the metric sweep already removed
the direct consumer.
Closes the 22-file layering violation flagged by the 2026-05-31
integration audit. The consensus consumer that target these new
alias paths lands in a companion commit on luxfi/consensus.
Layering shape after:
consensus -> threshold/protocols/{corona,pulsar} (stable alias)
|
v
luxfi/corona, luxfi/pulsar (primitive implementations)
71 lines
2.9 KiB
Go
71 lines
2.9 KiB
Go
// Copyright (C) 2025-2026, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
// Package keyera re-exports github.com/luxfi/corona/keyera through the
|
|
// threshold/protocols/corona alias surface. Downstream consumers
|
|
// (luxfi/consensus) target this import path so the consensus engine
|
|
// does not depend directly on the corona module.
|
|
//
|
|
// The re-exports are type aliases and thin function forwards; no
|
|
// behaviour change. See the upstream package for documentation of the
|
|
// underlying KeyEra lifecycle (Bootstrap → Reshare* → Reanchor).
|
|
package keyera
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/luxfi/corona/keyera"
|
|
)
|
|
|
|
// Identifier types for the Corona key-era lifecycle. CoronaKeyEraID
|
|
// is monotonic and bumped only at Reanchor; CoronaGroupID identifies
|
|
// one Corona group for partitioned-set deployments.
|
|
type (
|
|
CoronaKeyEraID = keyera.CoronaKeyEraID
|
|
CoronaGroupID = keyera.CoronaGroupID
|
|
)
|
|
|
|
// Core lifecycle state.
|
|
type (
|
|
KeyEra = keyera.KeyEra
|
|
EpochShareState = keyera.EpochShareState
|
|
BootstrapTranscript = keyera.BootstrapTranscript
|
|
PedersenContributions = keyera.PedersenContributions
|
|
AbortEvidence = keyera.AbortEvidence
|
|
)
|
|
|
|
// Bootstrap runs the one-time trusted-dealer ceremony at chain genesis
|
|
// or governance-gated Reanchor. See keyera.Bootstrap for the trust
|
|
// model.
|
|
func Bootstrap(t int, validators []string, groupID CoronaGroupID, eraID CoronaKeyEraID, entropy io.Reader) (*KeyEra, *BootstrapTranscript, error) {
|
|
return keyera.Bootstrap(t, validators, groupID, eraID, entropy)
|
|
}
|
|
|
|
// BootstrapTrustedDealer is the legacy trusted-dealer-only entrypoint.
|
|
// Use Bootstrap (which routes through the public-BFT default) in new
|
|
// code.
|
|
func BootstrapTrustedDealer(t int, validators []string, groupID CoronaGroupID, eraID CoronaKeyEraID, entropy io.Reader) (*KeyEra, error) {
|
|
return keyera.BootstrapTrustedDealer(t, validators, groupID, eraID, entropy)
|
|
}
|
|
|
|
// Reanchor opens a new key era with a fresh GroupKey. Use ONLY for
|
|
// security-event response — long-tail share leakage, suspected
|
|
// master-secret compromise, or policy-driven key cycling. Requires
|
|
// governance authorization at the consensus layer.
|
|
func Reanchor(prev *KeyEra, t int, validators []string, groupID CoronaGroupID, entropy io.Reader) (*KeyEra, *BootstrapTranscript, error) {
|
|
return keyera.Reanchor(prev, t, validators, groupID, entropy)
|
|
}
|
|
|
|
// ReanchorTrustedDealer is the legacy trusted-dealer Reanchor path.
|
|
// Use Reanchor (Pedersen DKG) in new code.
|
|
func ReanchorTrustedDealer(prev *KeyEra, t int, validators []string, groupID CoronaGroupID, entropy io.Reader) (*KeyEra, error) {
|
|
return keyera.ReanchorTrustedDealer(prev, t, validators, groupID, entropy)
|
|
}
|
|
|
|
// ExtractAbortEvidence pulls a typed AbortEvidence out of a wrapped
|
|
// bootstrap-abort error, returning nil if the error carries no
|
|
// evidence.
|
|
func ExtractAbortEvidence(err error) *AbortEvidence {
|
|
return keyera.ExtractAbortEvidence(err)
|
|
}
|