cardano-ledger-core-1.17.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellSafe-Inferred
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 #

Generic (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Associated Types

type Rep (VKey kd) ∷ TypeType Source #

Methods

fromVKey kd → Rep (VKey kd) x Source #

toRep (VKey kd) x → VKey kd Source #

Show (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

showsPrecIntVKey kd → ShowS Source #

showVKey kd → String Source #

showList ∷ [VKey kd] → ShowS 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 #

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

Defined in Cardano.Ledger.Keys.Internal

Methods

encCBORVKey kd → Encoding Source #

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

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

NFData (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

rnfVKey kd → () Source #

Eq (VKey kd) Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

Methods

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

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

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.17.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.

Instances

Instances details
Show KeyRole Source # 
Instance details

Defined in Cardano.Ledger.Keys.Internal

class HasKeyRole (a ∷ KeyRoleType) where Source #

Minimal complete definition

Nothing

Methods

coerceKeyRole ∷ 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 coerceKeyRoleCoercible (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 #

asWitnessHasKeyRole 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

Generic (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep (KeyHash r) ∷ TypeType Source #

Methods

fromKeyHash r → Rep (KeyHash r) x Source #

toRep (KeyHash r) x → KeyHash r Source #

Show (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

showsPrecIntKeyHash r → ShowS Source #

showKeyHash r → String Source #

showList ∷ [KeyHash r] → ShowS Source #

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 #

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

Defined in Cardano.Ledger.Hashes

Methods

encCBORKeyHash r → Encoding Source #

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

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [KeyHash r] → Size 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 → () Source #

Eq (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

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

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

Ord (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

compareKeyHash r → KeyHash r → Ordering Source #

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

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

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

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

maxKeyHash r → KeyHash r → KeyHash r Source #

minKeyHash r → KeyHash r → KeyHash r Source #

NoThunks (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

type Rep (KeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

hashKeyVKey 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

verifySignedDSIGNSignable DSIGN a ⇒ VKey kd → a → SignedDSIGN DSIGN a → Bool Source #

Verify a digital signature

hashSignatureSignedDSIGN (Hash h) → Hash (SignedDSIGN (Hash h)) Source #

Deprecated: In favor of hashTxBodySignature. Fallback on hashWith if you need more general hashing functionality.

Hash a given 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

Generic (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep (VRFVerKeyHash r) ∷ TypeType Source #

Show (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

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

Defined in Cardano.Ledger.Hashes

Methods

encCBORVRFVerKeyHash r → Encoding Source #

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

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

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 → () Source #

Eq (VRFVerKeyHash r) Source # 
Instance details

Defined in Cardano.Ledger.Hashes

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

Generic GenDelegPair Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep GenDelegPairTypeType Source #

Show 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 → () Source #

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.17.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 #

Constructors

GenDelegs 

Instances

Instances details
FromJSON GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

ToJSON GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Generic GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Associated Types

type Rep GenDelegsTypeType Source #

Show 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

Methods

encCBORGenDelegsEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy GenDelegsSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [GenDelegs] → Size Source #

NFData GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

Methods

rnfGenDelegs → () Source #

Eq GenDelegs Source # 
Instance details

Defined in Cardano.Ledger.Hashes

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.17.0.0-inplace" 'True) (C1 ('MetaCons "GenDelegs" 'PrefixI 'True) (S1 ('MetaSel ('Just "unGenDelegs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (KeyHash 'Genesis) 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.

Deprecated

type Hash = Hash HASH Source #

Deprecated: In favor of Hash HASH

DSIGN

type SignedDSIGN = SignedDSIGN DSIGN Source #

Deprecated: In favor of SignedDSIGN DSIGN

type SignKeyDSIGN = SignKeyDSIGN DSIGN Source #

Deprecated: In favor of SignKeyDSIGN DSIGN

KES

type KESignable c = Signable (KES c) Source #

Deprecated: In favor of Signable (KES c)

type SignedKES c = SignedKES (KES c) Source #

Deprecated: In favor of SignedKES (KES c)

type SignKeyKES c = SignKeyKES (KES c) Source #

Deprecated: In favor of SignKeyKES (KES c)

type VerKeyKES c = VerKeyKES (KES c) Source #

Deprecated: In favor of VerKeyKES (KES c)

VRF

type VRFSignable c = Signable (VRF c) Source #

Deprecated: In favor of Signable (VRF c)

type CertifiedVRF c = CertifiedVRF (VRF c) Source #

Deprecated: In favor of CertifiedVRF (VRF c)

type SignKeyVRF c = SignKeyVRF (VRF c) Source #

Deprecated: In favor of SignKeyVRF (VRF c)

type VerKeyVRF c = VerKeyVRF (VRF c) Source #

Deprecated: In favor of VerKeyVRF (VRF c)

hashVerKeyVRFCrypto c ⇒ VerKeyVRF (VRF c) → VRFVerKeyHash (r ∷ KeyRoleVRF) Source #

Deprecated: Use hashVerKeyVRF instead