cardano-protocol-tpraos-1.6.0.1: Cardano Protocol: Transitional Praos
Safe HaskellNone
LanguageHaskell2010

Test.Cardano.Protocol.TPraos.Create

Synopsis

Documentation

data AllIssuerKeys c (r ∷ KeyRole) Source #

Instances

Instances details
(Show (SignKeyVRF (VRF c)), Show (VerKeyVRF (VRF c)), Show (VerKeyKES (KES c))) ⇒ Show (AllIssuerKeys c r) Source # 
Instance details

Defined in Test.Cardano.Protocol.TPraos.Create

Methods

showsPrec ∷ Int → AllIssuerKeys c r → ShowS #

show ∷ AllIssuerKeys c r → String #

showList ∷ [AllIssuerKeys c r] → ShowS #

genAllIssuerKeys Source #

Arguments

∷ ∀ c (r ∷ KeyRole). Crypto c 
⇒ Int

Maxium slot number

→ Word64

This corresponds to number of KES evolutions maxKESEvo from Globals.

→ Word64

This corresponds to number of KES evolutions slotsPerKESPeriod from Globals.

→ Gen (AllIssuerKeys c r) 

data KESKeyPair c Source #

Constructors

KESKeyPair 

Instances

Instances details
Crypto c ⇒ Arbitrary (KESKeyPair c) Source # 
Instance details

Defined in Test.Cardano.Protocol.Crypto.KES

Show (VerKeyKES (KES c)) ⇒ Show (KESKeyPair c) Source # 
Instance details

Defined in Test.Cardano.Protocol.Crypto.KES

Methods

showsPrec ∷ Int → KESKeyPair c → ShowS #

show ∷ KESKeyPair c → String #

showList ∷ [KESKeyPair c] → ShowS #

data VRFKeyPair c Source #

Constructors

VRFKeyPair 

Fields

Instances

Instances details
(Crypto c, Arbitrary (SignKeyVRF (VRF c))) ⇒ Arbitrary (VRFKeyPair c) Source # 
Instance details

Defined in Test.Cardano.Protocol.Crypto.VRF

(Show (SignKeyVRF (VRF c)), Show (VerKeyVRF (VRF c))) ⇒ Show (VRFKeyPair c) Source # 
Instance details

Defined in Test.Cardano.Protocol.Crypto.VRF

Methods

showsPrec ∷ Int → VRFKeyPair c → ShowS #

show ∷ VRFKeyPair c → String #

showList ∷ [VRFKeyPair c] → ShowS #

mkOCert ∷ ∀ c (r ∷ KeyRole). Crypto c ⇒ AllIssuerKeys c r → Word64 → KESPeriod → OCert c Source #

mkBHBody ∷ ∀ c (r ∷ KeyRole). (ContextVRF (VRF c) ~ (), Signable (VRF c) Seed, VRFAlgorithm (VRF c)) ⇒ ProtVer → HashHeader → AllIssuerKeys c r → SlotNo → BlockNo → Nonce → OCert c → Word32 → Hash HASH EraIndependentBlockBody → BHBody c Source #

mkBHeader Source #

Arguments

∷ ∀ c (r ∷ KeyRole). (Crypto c, Signable (KES c) (BHBody c)) 
⇒ AllIssuerKeys c r 
→ Word 
→ Word

KES period of key registration

→ BHBody c 
→ BHeader c 

mkBlock Source #

Arguments

∷ ∀ era (r ∷ KeyRole) c. (Crypto c, EraBlockBody era, Signable (VRF c) Seed, Signable (KES c) (BHBody c)) 
⇒ HashHeader

Hash of previous block

→ AllIssuerKeys c r

All keys in the stake pool

→ [Tx 'TopTx era]

Transactions to record

→ SlotNo

Current slot

→ BlockNo

Block numberchain lengthchain "difficulty"

→ Nonce

EpochNo nonce

→ Word

Period of KES (key evolving signature scheme)

→ Word

KES period of key registration

→ OCert c

Operational certificate

→ Block (BHeader c) era 

mkBlockFakeVRF Source #

Arguments

∷ ∀ era (r ∷ KeyRole) c. (Crypto c, EraBlockBody era, Signable (VRF c) (WithResult Seed), Signable (KES c) (BHBody c)) 
⇒ HashHeader

Hash of previous block

→ AllIssuerKeys c r

All keys in the stake pool

→ [Tx 'TopTx era]

Transactions to record

→ SlotNo

Current slot

→ BlockNo

Block number/chain length/chain "difficulty"

→ Nonce

EpochNo nonce

→ NatNonce

Block nonce

→ UnitInterval

Praos leader value

→ Word

Period of KES (key evolving signature scheme)

→ Word

KES period of key registration

→ OCert c

Operational certificate

→ Block (BHeader c) era 

Create a block with a faked VRF result.

evolveKESUntil Source #

Arguments

∷ (UnsoundPureKESAlgorithm c, ContextKES c ~ ()) 
⇒ UnsoundPureSignKeyKES c 
→ KESPeriod

Current KES period

→ KESPeriod

Target KES period

→ Maybe (UnsoundPureSignKeyKES c) 

Try to evolve KES key until specific KES period is reached, given the current KES period.