cardano-ledger-core-1.19.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellNone
LanguageHaskell2010

Cardano.Ledger.Keys

Synopsis

VKey

newtype VKey (kd ∷ KeyRole) Source #

Discriminated verification key

We wrap the basic VerKeyDSIGN in order to add the key role.

Constructors

VKey 

Instances

Instances details
HasKeyRole VKey Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) (r' ∷ KeyRole). VKey r → VKey r' Source #

Typeable kd ⇒ FromCBOR (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

fromCBORDecoder s (VKey kd) Source #

labelProxy (VKey kd) → Text Source #

Typeable kd ⇒ ToCBOR (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

toCBORVKey kd → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (VKey kd) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VKey kd] → Size Source #

Typeable kd ⇒ DecCBOR (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

decCBORDecoder s (VKey kd) Source #

dropCBORProxy (VKey kd) → Decoder s () Source #

labelProxy (VKey kd) → Text Source #

EncCBOR (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

encCBORVKey kd → Encoding Source #

NFData (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

rnfVKey kd → () #

Generic (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Associated Types

type Rep (VKey kd) 
Instance details

Defined in Cardano.Ledger.Keys.Internal

type Rep (VKey kd) = D1 ('MetaData "VKey" "Cardano.Ledger.Keys.Internal" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "VKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unVKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VerKeyDSIGN DSIGN))))

Methods

fromVKey kd → Rep (VKey kd) x #

toRep (VKey kd) x → VKey kd #

Show (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

showsPrecIntVKey kd → ShowS #

showVKey kd → String #

showList ∷ [VKey kd] → ShowS #

Eq (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

(==)VKey kd → VKey kd → Bool #

(/=)VKey kd → VKey kd → Bool #

NoThunks (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

type Rep (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

type Rep (VKey kd) = D1 ('MetaData "VKey" "Cardano.Ledger.Keys.Internal" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "VKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unVKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (VerKeyDSIGN DSIGN))))

Key Roles

data KeyRole Source #

The role of a key.

All key roles are fixed and unique, except for the Witness role. In particular, keys can be cast to a Witness role with the help of asWitness, because same witness can be valid for many roles.

In fact, it is perfectly allowable for a key to be used in many roles by the end user; there is nothing prohibiting somebody using the same underlying key or a script as their payment and staking credential, as well as the key for their stake pool. However, in the ledger code mixing up keys with different roles could be catastrophic, that is why we have this separation.

class HasKeyRole (a ∷ KeyRoleType) where Source #

Minimal complete definition

Nothing

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) (r' ∷ KeyRole). a r → a r' Source #

General coercion of key roles.

The presence of this function is mostly to help the user realise where they are converting key roles.

default coerceKeyRole ∷ ∀ (r ∷ KeyRole) (r' ∷ KeyRole). Coercible (a r) (a r') ⇒ a r → a r' Source #

Instances

Instances details
HasKeyRole Credential Source # 
Instance details

Defined in Cardano.Ledger.Credential

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) (r' ∷ KeyRole). Credential r → Credential r' Source #

HasKeyRole KeyHash Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) (r' ∷ KeyRole). KeyHash r → KeyHash r' Source #

HasKeyRole VKey Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) (r' ∷ KeyRole). VKey r → VKey r' Source #

asWitness ∷ ∀ a (r ∷ KeyRole). HasKeyRole a ⇒ a r → a 'Witness Source #

Use a key as a witness.

This is the most common coercion between key roles, because most keys can be used as witnesses to some types of transaction. As such, we provide an explicit coercion for it.

Key Hashes

newtype KeyHash (r ∷ KeyRole) Source #

Discriminated hash of public Key

Constructors

KeyHash 

Instances

Instances details
HasKeyRole KeyHash Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

coerceKeyRole ∷ ∀ (r ∷ KeyRole) (r' ∷ KeyRole). KeyHash r → KeyHash r' Source #

FromJSON (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

FromJSONKey (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

ToJSON (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

ToJSONKey (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Typeable r ⇒ FromCBOR (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

fromCBORDecoder s (KeyHash r) Source #

labelProxy (KeyHash r) → Text Source #

Typeable r ⇒ ToCBOR (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

toCBORKeyHash r → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (KeyHash r) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [KeyHash r] → Size Source #

Typeable r ⇒ DecCBOR (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

decCBORDecoder s (KeyHash r) Source #

dropCBORProxy (KeyHash r) → Decoder s () Source #

labelProxy (KeyHash r) → Text Source #

EncCBOR (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

encCBORKeyHash r → Encoding Source #

Default (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

defKeyHash r Source #

NFData (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

rnfKeyHash r → () #

Generic (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep (KeyHash r) 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

fromKeyHash r → Rep (KeyHash r) x #

toRep (KeyHash r) x → KeyHash r #

Show (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

showsPrecIntKeyHash r → ShowS #

showKeyHash r → String #

showList ∷ [KeyHash r] → ShowS #

Eq (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

(==)KeyHash r → KeyHash r → Bool #

(/=)KeyHash r → KeyHash r → Bool #

Ord (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

compareKeyHash r → KeyHash r → Ordering #

(<)KeyHash r → KeyHash r → Bool #

(<=)KeyHash r → KeyHash r → Bool #

(>)KeyHash r → KeyHash r → Bool #

(>=)KeyHash r → KeyHash r → Bool #

maxKeyHash r → KeyHash r → KeyHash r #

minKeyHash r → KeyHash r → KeyHash r #

MemPack (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

NoThunks (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

hashKey ∷ ∀ (kd ∷ KeyRole). VKey kd → KeyHash kd Source #

Hash a given public key

Signature

type DSIGN = Ed25519DSIGN Source #

Cryptographic signing algorithm used on Cardano blockchain.

signedDSIGNSignable DSIGN a ⇒ SignKeyDSIGN DSIGN → a → SignedDSIGN DSIGN a Source #

Produce a digital signature

verifySignedDSIGN ∷ ∀ a (kd ∷ KeyRole). Signable DSIGN a ⇒ VKey kd → a → SignedDSIGN DSIGN a → Bool Source #

Verify a digital signature

VRF Key Hashes

newtype VRFVerKeyHash (r ∷ KeyRoleVRF) Source #

Discriminated hash of VRF Verification Key

Instances

Instances details
FromJSON (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

FromJSONKey (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

ToJSON (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

ToJSONKey (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Typeable r ⇒ FromCBOR (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Typeable r ⇒ ToCBOR (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

toCBORVRFVerKeyHash r → Encoding Source #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy (VRFVerKeyHash r) → Size Source #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [VRFVerKeyHash r] → Size Source #

Typeable r ⇒ DecCBOR (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

EncCBOR (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Default (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

defVRFVerKeyHash r Source #

NFData (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

rnfVRFVerKeyHash r → () #

Generic (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep (VRFVerKeyHash r) 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

fromVRFVerKeyHash r → Rep (VRFVerKeyHash r) x #

toRep (VRFVerKeyHash r) x → VRFVerKeyHash r #

Show (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Eq (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

(==)VRFVerKeyHash r → VRFVerKeyHash r → Bool #

(/=)VRFVerKeyHash r → VRFVerKeyHash r → Bool #

Ord (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

NoThunks (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Genesis delegations

data GenDelegPair Source #

Instances

Instances details
FromJSON GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

ToJSON GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

DecCBOR GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

EncCBOR GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

NFData GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

rnfGenDelegPair → () #

Generic GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep GenDelegPair 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep GenDelegPair = D1 ('MetaData "GenDelegPair" "Cardano.Ledger.Hashes" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "GenDelegPair" 'PrefixI 'True) (S1 ('MetaSel ('Just "genDelegKeyHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'GenesisDelegate)) :*: S1 ('MetaSel ('Just "genDelegVrfHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VRFVerKeyHash 'GenDelegVRF))))
Show GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Eq GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Ord GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

NoThunks GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep GenDelegPair = D1 ('MetaData "GenDelegPair" "Cardano.Ledger.Hashes" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "GenDelegPair" 'PrefixI 'True) (S1 ('MetaSel ('Just "genDelegKeyHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'GenesisDelegate)) :*: S1 ('MetaSel ('Just "genDelegVrfHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (VRFVerKeyHash 'GenDelegVRF))))

newtype GenDelegs Source #

Instances

Instances details
FromJSON GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

ToJSON GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

DecCBOR GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

EncCBOR GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

NFData GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

rnfGenDelegs → () #

Generic GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep GenDelegs 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep GenDelegs = D1 ('MetaData "GenDelegs" "Cardano.Ledger.Hashes" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "GenDelegs" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGenDelegs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (KeyHash 'GenesisRole) GenDelegPair))))

Methods

fromGenDelegsRep GenDelegs x #

toRep GenDelegs x → GenDelegs #

Show GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

showsPrecIntGenDelegsShowS #

showGenDelegsString #

showList ∷ [GenDelegs] → ShowS #

Eq GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

(==)GenDelegsGenDelegsBool #

(/=)GenDelegsGenDelegsBool #

NoThunks GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep GenDelegs = D1 ('MetaData "GenDelegs" "Cardano.Ledger.Hashes" "cardano-ledger-core-1.19.0.0-inplace" 'True) (C1 ('MetaCons "GenDelegs" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGenDelegs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (KeyHash 'GenesisRole) GenDelegPair))))

To be removed

Re-exports from cardano-crypto-class

hashWithSerialiserHashAlgorithm h ⇒ (a → Encoding) → a → Hash h a Source #

A variation on hashWith, but specially for CBOR encodings.