Mnemonic class
BIP39: A mnemonic sentence is superior for human interaction compared to the handling of raw binary or hexadecimal representations of a wallet seed.
Constructors
-
Mnemonic(List<
int> entropy, Language language, {String passphrase = ""}) - Constructs Mnemonic from entropy bytes.
- Mnemonic.fromSentence(String sentence, Language language, {String passphrase = ""})
- Constructs Mnemonic from a sentence by retrieving the original entropy.
- Mnemonic.generate(Language language, {String passphrase = "", int entropyLength = 256})
-
Constructs Mnemonic from one of these entropy lengths:
128, 160, 192, 224, 256
Properties
-
entropy
↔ List<
int> -
BIP39: The mnemonic must encode entropy in a multiple of 32 bits.
With more entropy security is improved but the sentence length increases.
The allowed size of _ENT is 128-256 bits.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- language ↔ Language
-
The language affect the sentence and the seed generation.
BIP39: Since the vast majority of BIP39 wallets supports only the English wordlist, it is strongly discouraged to use non-English wordlists for generating the mnemonic sentences. If you still feel your application really needs to use a localized wordlist, use one of the following instead of inventing your own.
getter/setter pair
- passphrase ↔ String
-
Passphrase is only used on seed generation.
BIP39: A user may decide to protect their mnemonic with a passphrase.
If a passphrase is not present, an empty string "" is used instead.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
seed
→ List<
int> -
BIP39: To create a binary seed from the mnemonic, we use the PBKDF2 function with a mnemonic sentence (in UTF-8 NFKD) used as the password and the string "mnemonic" + passphrase (again in UTF-8 NFKD) used as the salt.
The iteration count is set to 2048 and HMAC-SHA512 is used as the pseudo-random function.
The length of the derived key is 512 bits (= 64 bytes). This seed can be later used to generate deterministic wallets using BIP-0032 or similar methods.
no setter
- sentence → String
-
BIP39: Use the joined words as a mnemonic sentence.
no setter
-
words
→ List<
String> -
BIP39: Finally, we convert these numbers (indexes) into words.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited