diff --git a/cardano-api/internal/Cardano/Api/Keys/Shelley.hs b/cardano-api/internal/Cardano/Api/Keys/Shelley.hs index 806565ce9c..db99b4e83d 100644 --- a/cardano-api/internal/Cardano/Api/Keys/Shelley.hs +++ b/cardano-api/internal/Cardano/Api/Keys/Shelley.hs @@ -1723,6 +1723,18 @@ instance SerialiseAsBech32 (SigningKey DRepExtendedKey) where bech32PrefixFor _ = "drep_xsk" bech32PrefixesPermitted _ = ["drep_xsk"] +instance CastVerificationKeyRole DRepExtendedKey DRepKey where + castVerificationKey (DRepExtendedVerificationKey vk) = + DRepVerificationKey + . Shelley.VKey + . fromMaybe impossible + . Crypto.rawDeserialiseVerKeyDSIGN + . Crypto.HD.xpubPublicKey + $ vk + where + impossible = + error "castVerificationKey: byron and shelley key sizes do not match!" + -- -- Committee keys --