Documentation
¶
Overview ¶
Package profile carries the relay's signing-profile decision in ONE place.
Decomplecting principle: the relay has TWO distinct signing surfaces.
Intra-Lux operator surface — receipts, channel attestations, operator authentication to R-Chain RPC. Default = ML-DSA-65 (FIPS 204, NIST Level 3). Classical Ed25519 is opt-in only via LegacyClassicalEnabled.
External-chain surface — Bitcoin RPC, Ethereum RPC, OP_NET, FROST / Taproot threshold signing handed off to luxfi/mpc. These are NOT subject to the PQ default; they must conform to the target chain's native primitive (secp256k1 ECDSA, schnorr-BIP340, ED25519). The relay never PQ-flips an external transaction.
All policy lives here; primitives must never re-decide the profile.
Index ¶
Constants ¶
const ( MLDSA65PublicKeySize = mldsa.MLDSA65PublicKeySize MLDSA65SignatureSize = mldsa.MLDSA65SignatureSize )
Default key/sig sizes for the active default scheme (ML-DSA-65).
const ContextTag = "luxfi.relay.v1"
ContextTag is the domain-separation tag bound into every operator signature so a Relay receipt cannot be replayed as some other Lux artifact and vice versa.
Variables ¶
var ErrClassicalRefused = errors.New("profile: classical scheme refused under strict-PQ")
ErrClassicalRefused is returned when an Ed25519 signature is presented under a strict-PQ policy.
Functions ¶
Types ¶
type Policy ¶
type Policy struct {
// LegacyClassicalEnabled, when true, allows Ed25519 keys and verifies
// classical receipts. Production deployments inside Lux should leave
// this off.
LegacyClassicalEnabled bool
}
Policy carries the relay operator's signing-profile decision.
Default value (zero-Policy) means: ML-DSA-65 only, classical refused. This is intentional — the safe default is strict-PQ.
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer carries an operator's signing key. Construction picks the scheme; Sign always domain-separates with ContextTag.
func NewEd25519Signer ¶
func NewEd25519Signer(sk ed25519.PrivateKey) *Signer
NewEd25519Signer wraps a classical Ed25519 key. Callers must have already consulted Policy.Permit(SchemeEd25519); this constructor does not.
func NewMLDSA65Signer ¶
NewMLDSA65Signer returns a fresh ML-DSA-65 signer.
func NewMLDSA65SignerFromBytes ¶
NewMLDSA65SignerFromBytes restores an ML-DSA-65 signer from its serialised secret-key bytes.