From 69abb1881a39f87a1057515c29d06fa1dccd0bf9 Mon Sep 17 00:00:00 2001 From: John Ky Date: Sun, 17 Sep 2023 17:07:06 +1000 Subject: [PATCH 1/2] Rename SomeWitness to SomeSigningWitness. Rename constructors to avoid name conflicts --- .../Cardano/CLI/EraBased/Run/Transaction.hs | 6 +- cardano-cli/src/Cardano/CLI/Read.hs | 126 ++++++++---------- 2 files changed, 57 insertions(+), 75 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs index dceccf3fce..84287b9aba 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs @@ -888,7 +888,7 @@ runTxSignCmd :: () runTxSignCmd txOrTxBody witSigningData mnw outTxFile = do sks <- mapM (firstExceptT TxCmdReadWitnessSigningDataError . newExceptT . readWitnessSigningData) witSigningData - let (sksByron, sksShelley) = partitionSomeWitnesses $ map categoriseSomeWitness sks + let (sksByron, sksShelley) = partitionSomeWitnesses $ map categoriseSomeSigningWitness sks case txOrTxBody of InputTxFile (File inputTxFilePath) -> do @@ -1191,7 +1191,7 @@ runTxCreateWitnessCmd (File txbodyFilePath) witSignData mbNw oFile = do someWit <- firstExceptT TxCmdReadWitnessSigningDataError . newExceptT $ readWitnessSigningData witSignData witness <- - case categoriseSomeWitness someWit of + case categoriseSomeSigningWitness someWit of -- Byron witnesses require the network ID. This can either be provided -- directly or derived from a provided Byron address. AByronWitness bootstrapWitData -> @@ -1212,7 +1212,7 @@ runTxCreateWitnessCmd (File txbodyFilePath) witSignData mbNw oFile = do . newExceptT $ readWitnessSigningData witSignData witness <- - case categoriseSomeWitness someWit of + case categoriseSomeSigningWitness someWit of -- Byron witnesses require the network ID. This can either be provided -- directly or derived from a provided Byron address. AByronWitness bootstrapWitData -> diff --git a/cardano-cli/src/Cardano/CLI/Read.hs b/cardano-cli/src/Cardano/CLI/Read.hs index 0ecbf8974d..a65d66ee2f 100644 --- a/cardano-cli/src/Cardano/CLI/Read.hs +++ b/cardano-cli/src/Cardano/CLI/Read.hs @@ -40,7 +40,7 @@ module Cardano.CLI.Read -- * Tx witnesses , ReadWitnessSigningDataError(..) , renderReadWitnessSigningDataError - , SomeWitness(..) + , SomeSigningWitness(..) , ByronOrShelleyWitness(..) , ShelleyBootstrapWitnessSigningKeyData(..) , CddlWitnessError(..) @@ -49,7 +49,7 @@ module Cardano.CLI.Read -- * Required signer , RequiredSignerError(..) - , categoriseSomeWitness + , categoriseSomeSigningWitness , readRequiredSigner -- * Governance related @@ -606,20 +606,19 @@ readCddlWitness fp = do -- Witness handling -data SomeWitness - = AByronSigningKey (SigningKey ByronKey) (Maybe (Address ByronAddr)) - | APaymentSigningKey (SigningKey PaymentKey) - | APaymentExtendedSigningKey (SigningKey PaymentExtendedKey) - | AStakeSigningKey (SigningKey StakeKey) - | AStakeExtendedSigningKey (SigningKey StakeExtendedKey) - | AStakePoolSigningKey (SigningKey StakePoolKey) - | AGenesisSigningKey (SigningKey GenesisKey) - | AGenesisExtendedSigningKey (SigningKey GenesisExtendedKey) - | AGenesisDelegateSigningKey (SigningKey GenesisDelegateKey) - | AGenesisDelegateExtendedSigningKey - (SigningKey GenesisDelegateExtendedKey) - | AGenesisUTxOSigningKey (SigningKey GenesisUTxOKey) - | ADRepSigningKey (SigningKey DRepKey) +data SomeSigningWitness + = AByronSigningWitness (SigningKey ByronKey) (Maybe (Address ByronAddr)) + | APaymentSigningWitness (SigningKey PaymentKey) + | APaymentExtendedSigningWitness (SigningKey PaymentExtendedKey) + | AStakeSigningWitness (SigningKey StakeKey) + | AStakeExtendedSigningWitness (SigningKey StakeExtendedKey) + | AStakePoolSigningWitness (SigningKey StakePoolKey) + | AGenesisSigningWitness (SigningKey GenesisKey) + | AGenesisExtendedSigningWitness (SigningKey GenesisExtendedKey) + | AGenesisDelegateSigningWitness (SigningKey GenesisDelegateKey) + | AGenesisDelegateExtendedSigningWitness (SigningKey GenesisDelegateExtendedKey) + | AGenesisUTxOSigningWitness (SigningKey GenesisUTxOKey) + | ADRepSigningWitness (SigningKey DRepKey) -- | Data required for constructing a Shelley bootstrap witness. @@ -638,22 +637,21 @@ data ByronOrShelleyWitness = AByronWitness !ShelleyBootstrapWitnessSigningKeyData | AShelleyKeyWitness !ShelleyWitnessSigningKey -categoriseSomeWitness :: SomeWitness -> ByronOrShelleyWitness -categoriseSomeWitness swsk = +categoriseSomeSigningWitness :: SomeSigningWitness -> ByronOrShelleyWitness +categoriseSomeSigningWitness swsk = case swsk of - AByronSigningKey sk addr -> AByronWitness (ShelleyBootstrapWitnessSigningKeyData sk addr) - APaymentSigningKey sk -> AShelleyKeyWitness (WitnessPaymentKey sk) - APaymentExtendedSigningKey sk -> AShelleyKeyWitness (WitnessPaymentExtendedKey sk) - AStakeSigningKey sk -> AShelleyKeyWitness (WitnessStakeKey sk) - AStakeExtendedSigningKey sk -> AShelleyKeyWitness (WitnessStakeExtendedKey sk) - AStakePoolSigningKey sk -> AShelleyKeyWitness (WitnessStakePoolKey sk) - AGenesisSigningKey sk -> AShelleyKeyWitness (WitnessGenesisKey sk) - AGenesisExtendedSigningKey sk -> AShelleyKeyWitness (WitnessGenesisExtendedKey sk) - AGenesisDelegateSigningKey sk -> AShelleyKeyWitness (WitnessGenesisDelegateKey sk) - AGenesisDelegateExtendedSigningKey sk - -> AShelleyKeyWitness (WitnessGenesisDelegateExtendedKey sk) - AGenesisUTxOSigningKey sk -> AShelleyKeyWitness (WitnessGenesisUTxOKey sk) - ADRepSigningKey sk -> AShelleyKeyWitness (WitnessPaymentKey $ castDrep sk) + AByronSigningWitness sk addr -> AByronWitness (ShelleyBootstrapWitnessSigningKeyData sk addr) + APaymentSigningWitness sk -> AShelleyKeyWitness (WitnessPaymentKey sk) + APaymentExtendedSigningWitness sk -> AShelleyKeyWitness (WitnessPaymentExtendedKey sk) + AStakeSigningWitness sk -> AShelleyKeyWitness (WitnessStakeKey sk) + AStakeExtendedSigningWitness sk -> AShelleyKeyWitness (WitnessStakeExtendedKey sk) + AStakePoolSigningWitness sk -> AShelleyKeyWitness (WitnessStakePoolKey sk) + AGenesisSigningWitness sk -> AShelleyKeyWitness (WitnessGenesisKey sk) + AGenesisExtendedSigningWitness sk -> AShelleyKeyWitness (WitnessGenesisExtendedKey sk) + AGenesisDelegateSigningWitness sk -> AShelleyKeyWitness (WitnessGenesisDelegateKey sk) + AGenesisDelegateExtendedSigningWitness sk -> AShelleyKeyWitness (WitnessGenesisDelegateExtendedKey sk) + AGenesisUTxOSigningWitness sk -> AShelleyKeyWitness (WitnessGenesisUTxOKey sk) + ADRepSigningWitness sk -> AShelleyKeyWitness (WitnessPaymentKey $ castDrep sk) -- TODO: Conway era - Add constrctor for SigningKey DrepKey to ShelleyWitnessSigningKey castDrep :: SigningKey DRepKey -> SigningKey PaymentKey @@ -679,57 +677,41 @@ renderReadWitnessSigningDataError err = readWitnessSigningData :: WitnessSigningData - -> IO (Either ReadWitnessSigningDataError SomeWitness) + -> IO (Either ReadWitnessSigningDataError SomeSigningWitness) readWitnessSigningData (KeyWitnessSigningData skFile mbByronAddr) = do eRes <- first ReadWitnessSigningDataSigningKeyDecodeError <$> readKeyFileAnyOf bech32FileTypes textEnvFileTypes skFile return $ do res <- eRes case (res, mbByronAddr) of - (AByronSigningKey _ _, Just _) -> pure res - (AByronSigningKey _ _, Nothing) -> pure res + (AByronSigningWitness _ _, Just _) -> pure res + (AByronSigningWitness _ _, Nothing) -> pure res (_, Nothing) -> pure res (_, Just _) -> -- A Byron address should only be specified along with a Byron signing key. Left ReadWitnessSigningDataSigningKeyAndAddressMismatch where textEnvFileTypes = - [ FromSomeType (AsSigningKey AsByronKey) - (`AByronSigningKey` mbByronAddr) - , FromSomeType (AsSigningKey AsPaymentKey) - APaymentSigningKey - , FromSomeType (AsSigningKey AsPaymentExtendedKey) - APaymentExtendedSigningKey - , FromSomeType (AsSigningKey AsStakeKey) - AStakeSigningKey - , FromSomeType (AsSigningKey AsStakeExtendedKey) - AStakeExtendedSigningKey - , FromSomeType (AsSigningKey AsStakePoolKey) - AStakePoolSigningKey - , FromSomeType (AsSigningKey AsGenesisKey) - AGenesisSigningKey - , FromSomeType (AsSigningKey AsGenesisExtendedKey) - AGenesisExtendedSigningKey - , FromSomeType (AsSigningKey AsGenesisDelegateKey) - AGenesisDelegateSigningKey - , FromSomeType (AsSigningKey AsGenesisDelegateExtendedKey) - AGenesisDelegateExtendedSigningKey - , FromSomeType (AsSigningKey AsGenesisUTxOKey) - AGenesisUTxOSigningKey - , FromSomeType (AsSigningKey AsDRepKey) ADRepSigningKey + [ FromSomeType (AsSigningKey AsByronKey ) (`AByronSigningWitness` mbByronAddr) + , FromSomeType (AsSigningKey AsPaymentKey ) APaymentSigningWitness + , FromSomeType (AsSigningKey AsPaymentExtendedKey ) APaymentExtendedSigningWitness + , FromSomeType (AsSigningKey AsStakeKey ) AStakeSigningWitness + , FromSomeType (AsSigningKey AsStakeExtendedKey ) AStakeExtendedSigningWitness + , FromSomeType (AsSigningKey AsStakePoolKey ) AStakePoolSigningWitness + , FromSomeType (AsSigningKey AsGenesisKey ) AGenesisSigningWitness + , FromSomeType (AsSigningKey AsGenesisExtendedKey ) AGenesisExtendedSigningWitness + , FromSomeType (AsSigningKey AsGenesisDelegateKey ) AGenesisDelegateSigningWitness + , FromSomeType (AsSigningKey AsGenesisDelegateExtendedKey ) AGenesisDelegateExtendedSigningWitness + , FromSomeType (AsSigningKey AsGenesisUTxOKey ) AGenesisUTxOSigningWitness + , FromSomeType (AsSigningKey AsDRepKey ) ADRepSigningWitness ] bech32FileTypes = - [ FromSomeType (AsSigningKey AsPaymentKey) - APaymentSigningKey - , FromSomeType (AsSigningKey AsPaymentExtendedKey) - APaymentExtendedSigningKey - , FromSomeType (AsSigningKey AsStakeKey) - AStakeSigningKey - , FromSomeType (AsSigningKey AsStakeExtendedKey) - AStakeExtendedSigningKey - , FromSomeType (AsSigningKey AsStakePoolKey) - AStakePoolSigningKey + [ FromSomeType (AsSigningKey AsPaymentKey ) APaymentSigningWitness + , FromSomeType (AsSigningKey AsPaymentExtendedKey ) APaymentExtendedSigningWitness + , FromSomeType (AsSigningKey AsStakeKey ) AStakeSigningWitness + , FromSomeType (AsSigningKey AsStakeExtendedKey ) AStakeExtendedSigningWitness + , FromSomeType (AsSigningKey AsStakePoolKey ) AStakePoolSigningWitness ] -- Required signers @@ -750,17 +732,17 @@ readRequiredSigner (RequiredSignerSkeyFile skFile) = do eKeyWit <- first RequiredSignerErrorFile <$> readKeyFileAnyOf bech32FileTypes textEnvFileTypes skFile return $ do keyWit <- eKeyWit - case categoriseSomeWitness keyWit of + case categoriseSomeSigningWitness keyWit of AByronWitness _ -> Left $ RequiredSignerErrorByronKey skFile AShelleyKeyWitness skey -> return . getHash $ toShelleySigningKey skey where textEnvFileTypes = - [ FromSomeType (AsSigningKey AsPaymentKey) APaymentSigningKey - , FromSomeType (AsSigningKey AsPaymentExtendedKey) APaymentExtendedSigningKey - , FromSomeType (AsSigningKey AsStakePoolKey) AStakePoolSigningKey - , FromSomeType (AsSigningKey AsGenesisDelegateKey) AGenesisDelegateSigningKey + [ FromSomeType (AsSigningKey AsPaymentKey ) APaymentSigningWitness + , FromSomeType (AsSigningKey AsPaymentExtendedKey) APaymentExtendedSigningWitness + , FromSomeType (AsSigningKey AsStakePoolKey ) AStakePoolSigningWitness + , FromSomeType (AsSigningKey AsGenesisDelegateKey) AGenesisDelegateSigningWitness ] bech32FileTypes = [] From 409393313bfb0764521bb8717374d60969e49268 Mon Sep 17 00:00:00 2001 From: John Ky Date: Mon, 18 Sep 2023 11:25:41 +1000 Subject: [PATCH 2/2] Move SomeSignKey and associated functions to Key module --- .../src/Cardano/CLI/EraBased/Run/Key.hs | 91 ------------------ cardano-cli/src/Cardano/CLI/Types/Key.hs | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 91 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs index 659e1495fe..470cb7dc30 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Key.hs @@ -23,7 +23,6 @@ module Cardano.CLI.EraBased.Run.Key import Cardano.Api import qualified Cardano.Api.Byron as ByronApi import Cardano.Api.Crypto.Ed25519Bip32 (xPrvFromBytes) -import Cardano.Api.Shelley import qualified Cardano.CLI.Byron.Key as Byron import Cardano.CLI.EraBased.Commands.Key @@ -85,96 +84,6 @@ runGetVerificationKeyCmd skf vkf = do firstExceptT KeyCmdWriteFileError . newExceptT $ writeLazyByteStringFile vkf $ textEnvelopeToJSON Nothing vk - -data SomeSigningKey - = AByronSigningKey (SigningKey ByronKey) - | APaymentSigningKey (SigningKey PaymentKey) - | APaymentExtendedSigningKey (SigningKey PaymentExtendedKey) - | AStakeSigningKey (SigningKey StakeKey) - | AStakeExtendedSigningKey (SigningKey StakeExtendedKey) - | AStakePoolSigningKey (SigningKey StakePoolKey) - | AGenesisSigningKey (SigningKey GenesisKey) - | AGenesisExtendedSigningKey (SigningKey GenesisExtendedKey) - | AGenesisDelegateSigningKey (SigningKey GenesisDelegateKey) - | AGenesisDelegateExtendedSigningKey (SigningKey GenesisDelegateExtendedKey) - | AGenesisUTxOSigningKey (SigningKey GenesisUTxOKey) - | AVrfSigningKey (SigningKey VrfKey) - | AKesSigningKey (SigningKey KesKey) - -withSomeSigningKey :: () - => SomeSigningKey - -> (forall keyrole. (Key keyrole, HasTypeProxy keyrole) => SigningKey keyrole -> a) - -> a -withSomeSigningKey ssk f = - case ssk of - AByronSigningKey sk -> f sk - APaymentSigningKey sk -> f sk - APaymentExtendedSigningKey sk -> f sk - AStakeSigningKey sk -> f sk - AStakeExtendedSigningKey sk -> f sk - AStakePoolSigningKey sk -> f sk - AGenesisSigningKey sk -> f sk - AGenesisExtendedSigningKey sk -> f sk - AGenesisDelegateSigningKey sk -> f sk - AGenesisDelegateExtendedSigningKey sk -> f sk - AGenesisUTxOSigningKey sk -> f sk - AVrfSigningKey sk -> f sk - AKesSigningKey sk -> f sk - -readSigningKeyFile - :: SigningKeyFile In - -> ExceptT (FileError InputDecodeError) IO SomeSigningKey -readSigningKeyFile skFile = - newExceptT $ - readKeyFileAnyOf bech32FileTypes textEnvFileTypes skFile - where - textEnvFileTypes = - [ FromSomeType (AsSigningKey AsByronKey) - AByronSigningKey - , FromSomeType (AsSigningKey AsPaymentKey) - APaymentSigningKey - , FromSomeType (AsSigningKey AsPaymentExtendedKey) - APaymentExtendedSigningKey - , FromSomeType (AsSigningKey AsStakeKey) - AStakeSigningKey - , FromSomeType (AsSigningKey AsStakeExtendedKey) - AStakeExtendedSigningKey - , FromSomeType (AsSigningKey AsStakePoolKey) - AStakePoolSigningKey - , FromSomeType (AsSigningKey AsGenesisKey) - AGenesisSigningKey - , FromSomeType (AsSigningKey AsGenesisExtendedKey) - AGenesisExtendedSigningKey - , FromSomeType (AsSigningKey AsGenesisDelegateKey) - AGenesisDelegateSigningKey - , FromSomeType (AsSigningKey AsGenesisDelegateExtendedKey) - AGenesisDelegateExtendedSigningKey - , FromSomeType (AsSigningKey AsGenesisUTxOKey) - AGenesisUTxOSigningKey - , FromSomeType (AsSigningKey AsVrfKey) - AVrfSigningKey - , FromSomeType (AsSigningKey AsKesKey) - AKesSigningKey - ] - - bech32FileTypes = - [ FromSomeType (AsSigningKey AsPaymentKey) - APaymentSigningKey - , FromSomeType (AsSigningKey AsPaymentExtendedKey) - APaymentExtendedSigningKey - , FromSomeType (AsSigningKey AsStakeKey) - AStakeSigningKey - , FromSomeType (AsSigningKey AsStakeExtendedKey) - AStakeExtendedSigningKey - , FromSomeType (AsSigningKey AsStakePoolKey) - AStakePoolSigningKey - , FromSomeType (AsSigningKey AsVrfKey) - AVrfSigningKey - , FromSomeType (AsSigningKey AsKesKey) - AKesSigningKey - ] - - runConvertToNonExtendedKeyCmd :: VerificationKeyFile In -> VerificationKeyFile Out diff --git a/cardano-cli/src/Cardano/CLI/Types/Key.hs b/cardano-cli/src/Cardano/CLI/Types/Key.hs index f07cbafb2d..7c3bcc1473 100644 --- a/cardano-cli/src/Cardano/CLI/Types/Key.hs +++ b/cardano-cli/src/Cardano/CLI/Types/Key.hs @@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE UndecidableInstances #-} @@ -42,6 +43,10 @@ module Cardano.CLI.Types.Key , DRepHashSource(..) , readDRepCredential + + , SomeSigningKey(..) + , withSomeSigningKey + , readSigningKeyFile ) where import Cardano.Api @@ -372,3 +377,92 @@ readDRepCredential = \case lift (readVerificationKeyOrHashOrTextEnvFile AsDRepKey drepVKeyOrHashOrFile) & onLeft (left . DelegationDRepReadError) pure $ L.KeyHashObj drepKeyHash + + +data SomeSigningKey + = AByronSigningKey (SigningKey ByronKey) + | APaymentSigningKey (SigningKey PaymentKey) + | APaymentExtendedSigningKey (SigningKey PaymentExtendedKey) + | AStakeSigningKey (SigningKey StakeKey) + | AStakeExtendedSigningKey (SigningKey StakeExtendedKey) + | AStakePoolSigningKey (SigningKey StakePoolKey) + | AGenesisSigningKey (SigningKey GenesisKey) + | AGenesisExtendedSigningKey (SigningKey GenesisExtendedKey) + | AGenesisDelegateSigningKey (SigningKey GenesisDelegateKey) + | AGenesisDelegateExtendedSigningKey (SigningKey GenesisDelegateExtendedKey) + | AGenesisUTxOSigningKey (SigningKey GenesisUTxOKey) + | AVrfSigningKey (SigningKey VrfKey) + | AKesSigningKey (SigningKey KesKey) + +withSomeSigningKey :: () + => SomeSigningKey + -> (forall keyrole. (Key keyrole, HasTypeProxy keyrole) => SigningKey keyrole -> a) + -> a +withSomeSigningKey ssk f = + case ssk of + AByronSigningKey sk -> f sk + APaymentSigningKey sk -> f sk + APaymentExtendedSigningKey sk -> f sk + AStakeSigningKey sk -> f sk + AStakeExtendedSigningKey sk -> f sk + AStakePoolSigningKey sk -> f sk + AGenesisSigningKey sk -> f sk + AGenesisExtendedSigningKey sk -> f sk + AGenesisDelegateSigningKey sk -> f sk + AGenesisDelegateExtendedSigningKey sk -> f sk + AGenesisUTxOSigningKey sk -> f sk + AVrfSigningKey sk -> f sk + AKesSigningKey sk -> f sk + +readSigningKeyFile :: () + => SigningKeyFile In + -> ExceptT (FileError InputDecodeError) IO SomeSigningKey +readSigningKeyFile skFile = + newExceptT $ + readKeyFileAnyOf bech32FileTypes textEnvFileTypes skFile + where + textEnvFileTypes = + [ FromSomeType (AsSigningKey AsByronKey) + AByronSigningKey + , FromSomeType (AsSigningKey AsPaymentKey) + APaymentSigningKey + , FromSomeType (AsSigningKey AsPaymentExtendedKey) + APaymentExtendedSigningKey + , FromSomeType (AsSigningKey AsStakeKey) + AStakeSigningKey + , FromSomeType (AsSigningKey AsStakeExtendedKey) + AStakeExtendedSigningKey + , FromSomeType (AsSigningKey AsStakePoolKey) + AStakePoolSigningKey + , FromSomeType (AsSigningKey AsGenesisKey) + AGenesisSigningKey + , FromSomeType (AsSigningKey AsGenesisExtendedKey) + AGenesisExtendedSigningKey + , FromSomeType (AsSigningKey AsGenesisDelegateKey) + AGenesisDelegateSigningKey + , FromSomeType (AsSigningKey AsGenesisDelegateExtendedKey) + AGenesisDelegateExtendedSigningKey + , FromSomeType (AsSigningKey AsGenesisUTxOKey) + AGenesisUTxOSigningKey + , FromSomeType (AsSigningKey AsVrfKey) + AVrfSigningKey + , FromSomeType (AsSigningKey AsKesKey) + AKesSigningKey + ] + + bech32FileTypes = + [ FromSomeType (AsSigningKey AsPaymentKey) + APaymentSigningKey + , FromSomeType (AsSigningKey AsPaymentExtendedKey) + APaymentExtendedSigningKey + , FromSomeType (AsSigningKey AsStakeKey) + AStakeSigningKey + , FromSomeType (AsSigningKey AsStakeExtendedKey) + AStakeExtendedSigningKey + , FromSomeType (AsSigningKey AsStakePoolKey) + AStakePoolSigningKey + , FromSomeType (AsSigningKey AsVrfKey) + AVrfSigningKey + , FromSomeType (AsSigningKey AsKesKey) + AKesSigningKey + ]