A Wordlist is a set of 2048 words used to encode private keys (or other binary data) that is easier for humans to write down, transcribe and dictate.
The BIP-39 standard includes several checksum bits, depending on the size of the mnemonic phrase.
A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For most purposes 12 word mnemonics should be used, as including additional words increases the difficulty and potential for mistakes and does not offer any effective improvement on security.
There are a variety of BIP-39 Wordlists for different languages, but for maximal compatibility, the English Wordlist is recommended.
The available Wordlists by their ISO 639-1 Language Code.
(i.e. cz, en, es, fr, ja, ko, it, pt, zh_cn, zh_tw)
The dist files (in the /dist folder) have had all languages except English stripped out, which reduces the library size by about 80kb. If required, they are available by importing the included wordlists-extra.min.js file.
The Spanish wordlist for mnemonic phrases.
The French wordlist for mnemonic phrases.
A Wordlist represents a collection of language-specific words used to encode and devoce BIP-39 encoded data by mapping words to 11-bit values and vice versa.
Creates a new Wordlist instance.
Sub-classes MUST call this if they provide their own constructor, passing in the locale string of the language.
Generally there is no need to create instances of a Wordlist, since each language-specific Wordlist creates an instance and there is no state kept internally, so they are safe to share.
Maps an 11-bit value into its coresponding word in the list.
Sub-classes MUST override this.
Maps a word to its corresponding 11-bit value.
Sub-classes MUST override this.
Sub-classes may override this to provider a language-specific method for joining words into a phrase.
By default, words are joined by a single space.
Sub-classes may override this to provide a language-specific method for spliting phrase into individual words.
By default, phrase is split using any sequences of white-space as defined by regular expressions (i.e. /s+/).
An OWL format Wordlist is an encoding method that exploits the general locality of alphabetically sorted words to achieve a simple but effective means of compression.
This class is generally not useful to most developers as it is used mainly internally to keep Wordlists for languages based on ASCII-7 small.
If necessary, there are tools within the generation/ folder to create these necessary data.
Creates a new Wordlist for locale using the OWL data and validated against the checksum.
An OWL-A format Wordlist extends the OWL format to add an overlay onto an OWL format Wordlist to support diacritic marks.
This class is generally not useful to most developers as it is used mainly internally to keep Wordlists for languages based on latin-1 small.
If necessary, there are tools within the generation/ folder to create these necessary data.