web3-crypto-1.0.0.0: Cryptograhical primitives for Haskell Web3 library.
CopyrightAleksandr Krupenkin 2016-2021
LicenseApache-2.0
Maintainermail@akru.me
Stabilityexperimental
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

Crypto.Bip39

Description

Mnemonic keys (BIP-39). Only English dictionary. Thanks to Haskoin project https://hackage.haskell.org/package/haskoin-core.

Synopsis

Mnemonic Sentences

type Entropy = ByteString Source #

Random data used to create a mnemonic sentence. Use a good entropy source. You will get your coins stolen if you don't. You have been warned.

type Mnemonic = Text Source #

Human-readable mnemonic sentence.

type Passphrase = Text Source #

Optional passphrase for mnemnoic sentence.

type Seed = ByteString Source #

Seed for a private key from a mnemonic sentence.

toMnemonic :: Entropy -> Either String Mnemonic Source #

Provide intial Entropy as a ByteString of length multiple of 4 bytes. Output a Mnemonic sentence.

fromMnemonic :: Mnemonic -> Either String Entropy Source #

Revert toMnemonic. Do not use this to generate a Seed. Instead use mnemonicToSeed. This outputs the original Entropy used to generate a Mnemonic sentence.

mnemonicToSeed :: Passphrase -> Mnemonic -> Either String Seed Source #

Get a 512-bit Seed from a Mnemonic sentence. Will validate checksum. Passphrase can be used to protect the Mnemonic. Use an empty string as Passphrase if none is required.