Copyright | © 2018-2020 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
Implementation of address derivation for
Shelley
Keys.
Synopsis
-
newtype
ShelleyKey
(depth ::
Depth
) key =
ShelleyKey
{
- getKey :: key
- minSeedLengthBytes :: Int
- generateKeyFromSeed :: ( SomeMnemonic , Maybe SomeMnemonic ) -> Passphrase "encryption" -> ShelleyKey ' RootK XPrv
- unsafeGenerateKeyFromSeed :: ( SomeMnemonic , Maybe SomeMnemonic ) -> Passphrase "encryption" -> ShelleyKey depth XPrv
- unsafeGenerateKeyFromSeedShelley :: ( SomeMnemonic , Maybe SomeMnemonic ) -> Passphrase "encryption" -> XPrv
- deriveAccountPrivateKeyShelley :: Index ' Hardened ' PurposeK -> Passphrase "encryption" -> XPrv -> Index ' Hardened ' AccountK -> XPrv
- deriveAddressPrivateKeyShelley :: Enum a => Passphrase "encryption" -> XPrv -> a -> Index derivationType level -> XPrv
- deriveAddressPublicKeyShelley :: Enum a => XPub -> a -> Index derivationType level -> XPub
- toRewardAccountRaw :: XPub -> RewardAccount
Types
newtype ShelleyKey (depth :: Depth ) key Source #
A cryptographic key for Shelley address derivation, with phantom-types to disambiguate derivation paths
let rootPrivateKey = ShelleyKey 'RootK XPrv let accountPubKey = ShelleyKey 'AccountK XPub let addressPubKey = ShelleyKey 'AddressK XPub
ShelleyKey | |
|
Instances
Constants
minSeedLengthBytes :: Int Source #
The minimum seed length for
generateKeyFromSeed
and
unsafeGenerateKeyFromSeed
.
Generation and derivation
:: ( SomeMnemonic , Maybe SomeMnemonic ) |
The actual seed and its recovery / generation passphrase |
-> Passphrase "encryption" | |
-> ShelleyKey ' RootK XPrv |
Generate a root key from a corresponding seed. The seed should be at least 16 bytes.
unsafeGenerateKeyFromSeed Source #
:: ( SomeMnemonic , Maybe SomeMnemonic ) |
The actual seed and its recovery / generation passphrase |
-> Passphrase "encryption" | |
-> ShelleyKey depth XPrv |
Generate a new key from seed. Note that the
depth
is left open so that
the caller gets to decide what type of key this is. This is mostly for
testing, in practice, seeds are used to represent root keys, and one should
use
generateKeyFromSeed
.
unsafeGenerateKeyFromSeedShelley Source #
:: ( SomeMnemonic , Maybe SomeMnemonic ) |
The actual seed and its recovery / generation passphrase |
-> Passphrase "encryption" | |
-> XPrv |
deriveAccountPrivateKeyShelley :: Index ' Hardened ' PurposeK -> Passphrase "encryption" -> XPrv -> Index ' Hardened ' AccountK -> XPrv Source #
deriveAddressPrivateKeyShelley :: Enum a => Passphrase "encryption" -> XPrv -> a -> Index derivationType level -> XPrv Source #