Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype VKey (kd ∷ KeyRole) = VKey {}
- data KeyRole
- class HasKeyRole (a ∷ KeyRole → Type) where
- coerceKeyRole ∷ a r → a r'
- asWitness ∷ HasKeyRole a ⇒ a r → a 'Witness
- newtype KeyHash (r ∷ KeyRole) = KeyHash {}
- hashKey ∷ VKey kd → KeyHash kd
- type DSIGN = Ed25519DSIGN
- type DSignable = Signable DSIGN
- signedDSIGN ∷ Signable DSIGN a ⇒ SignKeyDSIGN DSIGN → a → SignedDSIGN DSIGN a
- verifySignedDSIGN ∷ Signable DSIGN a ⇒ VKey kd → a → SignedDSIGN DSIGN a → Bool
- hashSignature ∷ SignedDSIGN (Hash h) → Hash (SignedDSIGN (Hash h))
- data KeyRoleVRF
- newtype VRFVerKeyHash (r ∷ KeyRoleVRF) = VRFVerKeyHash {}
- toVRFVerKeyHash ∷ Hash HASH (VerKeyVRF v) → VRFVerKeyHash (r ∷ KeyRoleVRF)
- fromVRFVerKeyHash ∷ VRFVerKeyHash (r ∷ KeyRoleVRF) → Hash HASH (VerKeyVRF v)
- data GenDelegPair = GenDelegPair {}
- newtype GenDelegs = GenDelegs {}
- module Cardano.Ledger.Keys.WitVKey
- module Cardano.Ledger.Keys.Bootstrap
- decodeSignedDSIGN ∷ DSIGNAlgorithm v ⇒ Decoder s (SignedDSIGN v a)
- encodeSignedDSIGN ∷ DSIGNAlgorithm v ⇒ SignedDSIGN v a → Encoding
- hashWithSerialiser ∷ HashAlgorithm h ⇒ (a → Encoding) → a → Hash h a
- type Hash = Hash HASH
- type SignedDSIGN = SignedDSIGN DSIGN
- type SignKeyDSIGN = SignKeyDSIGN DSIGN
- type KESignable c = Signable (KES c)
- type SignedKES c = SignedKES (KES c)
- type SignKeyKES c = SignKeyKES (KES c)
- type VerKeyKES c = VerKeyKES (KES c)
- type VRFSignable c = Signable (VRF c)
- type CertifiedVRF c = CertifiedVRF (VRF c)
- type SignKeyVRF c = SignKeyVRF (VRF c)
- type VerKeyVRF c = VerKeyVRF (VRF c)
- hashVerKeyVRF ∷ Crypto c ⇒ VerKeyVRF (VRF c) → VRFVerKeyHash (r ∷ KeyRoleVRF)
VKey
newtype VKey (kd ∷ KeyRole) Source #
Discriminated verification key
We wrap the basic VerKeyDSIGN
in order to add the key role.
Instances
HasKeyRole VKey Source # | |
Defined in Cardano.Ledger.Keys.Internal | |
Generic (VKey kd) Source # | |
Show (VKey kd) Source # | |
Typeable kd ⇒ FromCBOR (VKey kd) Source # | |
Typeable kd ⇒ ToCBOR (VKey kd) Source # | |
Typeable kd ⇒ DecCBOR (VKey kd) Source # | |
Typeable kd ⇒ EncCBOR (VKey kd) Source # | |
NFData (VKey kd) Source # | |
Defined in Cardano.Ledger.Keys.Internal | |
Eq (VKey kd) Source # | |
NoThunks (VKey kd) Source # | |
type Rep (VKey kd) Source # | |
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
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 ∷ KeyRole → Type) where Source #
Nothing
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 coerceKeyRole ∷ Coercible (a r) (a r') ⇒ a r → a r' Source #
Instances
HasKeyRole Credential Source # | |
Defined in Cardano.Ledger.Credential coerceKeyRole ∷ ∀ (r ∷ KeyRole) (r' ∷ KeyRole). Credential r → Credential r' Source # | |
HasKeyRole KeyHash Source # | |
Defined in Cardano.Ledger.Hashes | |
HasKeyRole VKey Source # | |
Defined in Cardano.Ledger.Keys.Internal |
asWitness ∷ 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
Instances
HasKeyRole KeyHash Source # | |
Defined in Cardano.Ledger.Hashes | |
FromJSON (KeyHash r) Source # | |
FromJSONKey (KeyHash r) Source # | |
Defined in Cardano.Ledger.Hashes | |
ToJSON (KeyHash r) Source # | |
ToJSONKey (KeyHash r) Source # | |
Defined in Cardano.Ledger.Hashes | |
Generic (KeyHash r) Source # | |
Show (KeyHash r) Source # | |
Typeable r ⇒ FromCBOR (KeyHash r) Source # | |
Typeable r ⇒ ToCBOR (KeyHash r) Source # | |
Typeable r ⇒ DecCBOR (KeyHash r) Source # | |
Typeable r ⇒ EncCBOR (KeyHash r) Source # | |
Default (KeyHash r) Source # | |
Defined in Cardano.Ledger.Hashes | |
NFData (KeyHash r) Source # | |
Defined in Cardano.Ledger.Hashes | |
Eq (KeyHash r) Source # | |
Ord (KeyHash r) Source # | |
Defined in Cardano.Ledger.Hashes | |
NoThunks (KeyHash r) Source # | |
type Rep (KeyHash r) Source # | |
Defined in Cardano.Ledger.Hashes |
Signature
type DSIGN = Ed25519DSIGN Source #
Cryptographic signing algorithm used on Cardano blockchain.
signedDSIGN ∷ Signable DSIGN a ⇒ SignKeyDSIGN DSIGN → a → SignedDSIGN DSIGN a Source #
Produce a digital signature
verifySignedDSIGN ∷ Signable DSIGN a ⇒ VKey kd → a → SignedDSIGN DSIGN a → Bool Source #
Verify a digital signature
hashSignature ∷ SignedDSIGN (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
toVRFVerKeyHash ∷ Hash HASH (VerKeyVRF v) → VRFVerKeyHash (r ∷ KeyRoleVRF) Source #
fromVRFVerKeyHash ∷ VRFVerKeyHash (r ∷ KeyRoleVRF) → Hash HASH (VerKeyVRF v) Source #
Genesis delegations
data GenDelegPair Source #
Instances
Instances
FromJSON GenDelegs Source # | |
ToJSON GenDelegs Source # | |
Generic GenDelegs Source # | |
Show GenDelegs Source # | |
DecCBOR GenDelegs Source # | |
EncCBOR GenDelegs Source # | |
NFData GenDelegs Source # | |
Defined in Cardano.Ledger.Hashes | |
Eq GenDelegs Source # | |
NoThunks GenDelegs Source # | |
type Rep GenDelegs Source # | |
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)))) |
module Cardano.Ledger.Keys.WitVKey
To be removed
Re-exports from cardano-crypto-class
decodeSignedDSIGN ∷ DSIGNAlgorithm v ⇒ Decoder s (SignedDSIGN v a) Source #
encodeSignedDSIGN ∷ DSIGNAlgorithm v ⇒ SignedDSIGN v a → Encoding Source #
hashWithSerialiser ∷ HashAlgorithm h ⇒ (a → Encoding) → a → Hash h a Source #
A variation on hashWith
, but specially for CBOR encodings.
Deprecated
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 SignKeyKES c = SignKeyKES (KES c) Source #
Deprecated: In favor of SignKeyKES
(KES
c)
VRF
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)
hashVerKeyVRF ∷ Crypto c ⇒ VerKeyVRF (VRF c) → VRFVerKeyHash (r ∷ KeyRoleVRF) Source #
Deprecated: Use hashVerKeyVRF
instead