| Copyright | No rights reserved |
|---|---|
| License | MIT |
| Maintainer | jprupp@protonmail.ch |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Haskoin.Keys.Mnemonic
Contents
Description
Mnemonic keys (BIP-39). Only English dictionary.
Synopsis
- type Entropy = ByteString
- type Mnemonic = Text
- type Passphrase = Text
- type Seed = ByteString
- toMnemonic :: Entropy -> Either String Mnemonic
- fromMnemonic :: Mnemonic -> Either String Entropy
- mnemonicToSeed :: Passphrase -> Mnemonic -> Either String Seed
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 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.