haskoin-core-1.1.0: Bitcoin & Bitcoin Cash library for Haskell
CopyrightNo rights reserved
LicenseMIT
Maintainerjprupp@protonmail.ch
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Haskoin.Crypto.Keys.Mnemonic

Description

Mnemonic keys (BIP-39). Only English dictionary.

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.

wordList :: Vector Text Source #

Standard English dictionary from BIP-39 specification.

wordListMap :: Map Text Int Source #

Map of words to their position (index) in the word list.