ouroboros-consensus-shelley-0.1.0.0: Shelley ledger integration in the Ouroboros consensus layer
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Shelley.Protocol.HotKey

Description

Hot key

Intended for qualified import

Synopsis

KES Info

type KESEvolution = Period Source #

We call the relative periods that a KES key is valid its evolution, to avoid confusion with absolute periods.

data KESInfo Source #

Constructors

KESInfo 

Fields

Instances

Instances details
Show KESInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.HotKey

Generic KESInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.HotKey

Associated Types

type Rep KESInfo :: Type -> Type #

Methods

from :: KESInfo -> Rep KESInfo x #

to :: Rep KESInfo x -> KESInfo #

NoThunks KESInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.HotKey

type Rep KESInfo Source # 
Instance details

Defined in Ouroboros.Consensus.Shelley.Protocol.HotKey

type Rep KESInfo = D1 ('MetaData "KESInfo" "Ouroboros.Consensus.Shelley.Protocol.HotKey" "ouroboros-consensus-shelley-0.1.0.0-59swnF21REM9YduArUJWll" 'False) (C1 ('MetaCons "KESInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "kesStartPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESPeriod) :*: (S1 ('MetaSel ('Just "kesEndPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESPeriod) :*: S1 ('MetaSel ('Just "kesEvolution") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 KESEvolution))))

kesAbsolutePeriod :: KESInfo -> KESPeriod Source #

Return the absolute KES period

KES Status

data KESStatus Source #

Constructors

BeforeKESStart

The given period is before the start period of the KES key.

Fields

InKESRange KESEvolution

Relative period or evolution corresponding to the given absolute period

AfterKESEnd

The given period is after the end period of the KES key.

Fields

kesStatus :: KESInfo -> KESPeriod -> KESStatus Source #

Return the evolution of the given KES period, when it falls within the range of the HotKey ([hkStart, hkEnd)).

Note that the upper bound is exclusive, the spec says: > c0 <= kesPeriod s < c0 + MaxKESEvo

Hot Key

data KESEvolutionError Source #

Failed to evolve the KES key.

Constructors

KESCouldNotEvolve KESInfo KESPeriod

The KES key could not be evolved to the target period.

KESKeyAlreadyPoisoned KESInfo KESPeriod

Target period outside the range of the current KES key. Typically the current KES period according to the wallclock slot.

type KESEvolutionInfo = UpdateInfo KESInfo KESInfo KESEvolutionError Source #

Result of evolving the KES key.

data HotKey c m Source #

API to interact with the key.

Constructors

HotKey 

Fields

sign :: (KESignable c toSign, HasCallStack) => HotKey c m -> toSign -> m (SignedKES c toSign) Source #

mkHotKey Source #

Arguments

:: forall m c. (Crypto c, IOLike m) 
=> SignKeyKES c 
-> KESPeriod

Start period

-> Word64

Max KES evolutions

-> m (HotKey c m)