Documentation
¶
Overview ¶
Package profile carries the oracle's signing-profile decision in ONE place.
Decomplecting principle: the oracle has TWO distinct signing surfaces.
Intra-Lux operator surface — signed Observations, OracleRecords, OracleCommits, executor attestations to O-Chain RPC. Default = ML-DSA-65 (FIPS 204, NIST Level 3). Classical Ed25519 is opt-in only via LegacyClassicalEnabled.
External-source surface — Bitcoin RPC, Ethereum RPC, Pyth, Chainlink, market data APIs. These are NOT subject to the PQ default; they ride whatever transport and authentication the external source provides. The oracle never PQ-flips a fetch against a public price feed.
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.oracle.v1"
ContextTag is the domain-separation tag bound into every operator signature so an Oracle observation 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 observations. Production deployments inside Lux should
// leave this off.
LegacyClassicalEnabled bool
}
Policy carries the oracle 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.