cardano-crypto-1.1.1: Cryptography primitives for cardano
Maintainer vincent@typed.io
Safe Haskell None
Language Haskell2010

Cardano.Crypto.Wallet

Description

This provides similar functionality to BIP32 but using Ed25519 arithmetic instead of P256K1 arithmethic.

Key can be hierarchically derived from private key in two fashions: Hardened or Normal.

In the hardened scheme, the child secret key is not linearly derived, so that the child public key has no way to be efficiently computed from the parent public key.

The normal scheme allows anyone to derive public keys from public key.

Synopsis

Documentation

data DerivationScheme Source #

Instances

Instances details
Bounded DerivationScheme Source #
Instance details

Defined in Cardano.Crypto.Wallet.Types

Enum DerivationScheme Source #
Instance details

Defined in Cardano.Crypto.Wallet.Types

Eq DerivationScheme Source #
Instance details

Defined in Cardano.Crypto.Wallet.Types

Ord DerivationScheme Source #
Instance details

Defined in Cardano.Crypto.Wallet.Types

Show DerivationScheme Source #
Instance details

Defined in Cardano.Crypto.Wallet.Types

Arbitrary DerivationScheme Source #
Instance details

Defined in Cardano.Crypto.Wallet.Types

Extended Private & Public types

data XPub Source #

Instances

Instances details
Eq XPub Source #
Instance details

Defined in Cardano.Crypto.Wallet

Ord XPub Source #
Instance details

Defined in Cardano.Crypto.Wallet

Show XPub Source #
Instance details

Defined in Cardano.Crypto.Wallet

Generic XPub Source #
Instance details

Defined in Cardano.Crypto.Wallet

Associated Types

type Rep XPub :: Type -> Type Source #

NFData XPub Source #
Instance details

Defined in Cardano.Crypto.Wallet

Hashable XPub Source #
Instance details

Defined in Cardano.Crypto.Wallet

type Rep XPub Source #
Instance details

Defined in Cardano.Crypto.Wallet

generate :: ( ByteArrayAccess passPhrase, ByteArrayAccess seed) => seed -> passPhrase -> XPrv Source #

Generate a new XPrv

The seed needs to be at least 32 bytes, otherwise an asynchronous error is thrown

generateNew Source #

Arguments

:: ( ByteArrayAccess keyPassPhrase, ByteArrayAccess generationPassPhrase, ByteArrayAccess seed)
=> seed

Raw entropy used as source of randomness for this algorithm

-> generationPassPhrase

User chosen passphrase for the generation phase

-> keyPassPhrase

Symmetric encryption key passphrase used for the in-memory security

-> XPrv

Generate a new XPrv from an entropy seed

The seed should be at least 16 bytes, although it is not enforced

The passphrase encrypt the secret key in memory

toXPub :: HasCallStack => XPrv -> XPub Source #

Generate extended public key from private key

xPubGetPublicKey :: XPub -> PublicKey Source #

Return the Ed25519 public key associated with a XPub context

xPrvChangePass Source #

Arguments

:: ( ByteArrayAccess oldPassPhrase, ByteArrayAccess newPassPhrase)
=> oldPassPhrase

passphrase to decrypt the current encrypted key

-> newPassPhrase

new passphrase to use for the new encrypted key

-> XPrv
-> XPrv

Derivation function

deriveXPrv :: ByteArrayAccess passPhrase => DerivationScheme -> passPhrase -> XPrv -> Word32 -> XPrv Source #

Derive a child extended private key from an extended private key

deriveXPub :: DerivationScheme -> XPub -> Word32 -> Maybe XPub Source #

Derive a child extended public key from an extended public key

Signature & Verification from extended types