Copyright | © 2018-2020 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
Implementation of address derivation for
Icarus
keys. This uses the Byron
derivation for addresses, but on top of the derivation scheme V2.
Synopsis
-
newtype
IcarusKey
(depth ::
Depth
) key =
IcarusKey
{
- getKey :: key
- generateKeyFromSeed :: SomeMnemonic -> Passphrase "encryption" -> IcarusKey ' RootK XPrv
- generateKeyFromHardwareLedger :: SomeMnemonic -> Passphrase "encryption" -> IcarusKey ' RootK XPrv
- unsafeGenerateKeyFromSeed :: SomeMnemonic -> Passphrase "encryption" -> IcarusKey depth XPrv
- minSeedLengthBytes :: Int
Types
newtype IcarusKey (depth :: Depth ) key Source #
A cryptographic key for sequential-scheme address derivation, with phantom-types to disambiguate key types.
let rootPrivateKey = IcarusKey 'RootK XPrv let accountPubKey = IcarusKey 'AccountK XPub let addressPubKey = IcarusKey 'AddressK XPub
Instances
Generation and derivation
:: SomeMnemonic |
The root mnemonic |
-> Passphrase "encryption" |
Master encryption passphrase |
-> IcarusKey ' RootK XPrv |
Generate a root key from a corresponding seed. The seed should be at least 16 bytes.
generateKeyFromHardwareLedger Source #
:: SomeMnemonic |
The root mnemonic |
-> Passphrase "encryption" |
Master encryption passphrase |
-> IcarusKey ' RootK XPrv |
Hardware Ledger devices generates keys from mnemonic using a different approach (different from the rest of Cardano).
It is a combination of:
unsafeGenerateKeyFromSeed Source #
:: SomeMnemonic |
The root mnemonic |
-> Passphrase "encryption" |
Master encryption passphrase |
-> IcarusKey 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
.
minSeedLengthBytes :: Int Source #
The minimum seed length for
generateKeyFromSeed
and
unsafeGenerateKeyFromSeed
.