<commit_before>{{bip}}

<pre>
  BIP:     BIP-0039
  Title:   Mnemonic code for deterministic keys
  Author:  <NAME> <<EMAIL>>
           <NAME> <<EMAIL>>
  Status:  Draft
  Type:    Standards Track
  Created: 14-02-2013
</pre>

==Abstract==

This BIP proposes a scheme for translating binary data (usually master seeds
for deterministic keys, but it can be applied to any binary data) into a group
of easy to remember words also known as mnemonic code or mnemonic sentence.

==Motivation==

Such mnemonic code or mnemonic sentence is much easier to work with than working
with the binary data directly (or its hexadecimal interpretation). The sentence
could be writen down on paper (e.g. for storing in a secure location such as
safe), told over telephone or other voice communication method, or memorized
in ones memory (also called as brainwallet).

==Backwards Compatibility==

As this BIP is written, only one Bitcoin client (Electrum) implements mnemonic
codes, but it uses a different wordlist than the proposed one. Because the
Electrum (legacy) wordlist and the proposed English wordlist overlap, one has to
indicate which wordlist was used.

==Rationale==

Our proposal is inspired by Electrum implementation, but we enhanced it to have
the following features:

a) no similar words
   - words as "build" and "built", "woman" and "women" or "quick" or "quickly"
     not only make remembering the sentence difficult, but are also more error
     prone and more difficult to guess (see point below)

b) smart selection of words
   - wordlists are created in such way that it's enough to type just first three
     letters to unambiguously identify the word

c) sorted wordlists
   - allow more efficient lookup of the code words (i.e. one can use binary
     search instead of linear search)

d) localized wordlists
   - makes it easier for people to remember the code in their native language
   - by using wordlists with no colliding words among languages, it's easy to
     determine which language was used just by checking the first word of
     the sentence

We were experimenting with different wordlists sizes. The following table shows
a relationship between seed length in bits (rows), number of words used to
describe the seed (columns) and required wordlist size (table data). It turned
out that wordlist of size 1626 is indeed the best choice.

+-----+---------+--------+--------+--------+-------+-------+-------+-------+------+------+------+------+------+
|     |    12   |    13  |    14  |    15  |   16  |   17  |   18  |   19  |  20  |  21  |  22  |  23  |  24  |
+-----+---------+--------+--------+--------+-------+-------+-------+-------+------+------+------+------+------+
| 128 |    1626 |    921 |    566 |    371 |   256 |   185 |   139 |   107 |   85 |   69 |   57 |   48 |   41 |
| 160 |   10322 |   5070 |   2757 |   1626 |  1024 |   682 |   475 |   343 |  256 |  197 |  155 |  125 |  102 |
| 192 |   65536 |  27925 |  13441 |   7132 |  4096 |  2512 |  1626 |  1102 |  777 |  566 |  424 |  326 |  256 |
| 224 |  416128 | 153808 |  65536 |  31289 | 16384 |  9258 |  5574 |  3540 | 2353 | 1626 | 1162 |  855 |  646 |
| 256 | 2642246 | 847180 | 319558 | 137271 | 65536 | 34132 | 19113 | 11376 | 7132 | 4675 | 3184 | 2242 | 1626 |
+-----+---------+--------+--------+--------+-------+-------+-------+-------+------+------+------+------+------+

The conversion table between seed length in bits and number of words used in
mnemonic for wordlist of 1626 words look like this:

+------+-------+
| bits | words |
+------+-------+
|  128 |    12 |
|  160 |    15 |
|  192 |    18 |
|  224 |    21 |
|  256 |    24 |
+------+-------+

==Specification==



==Reference Implementation==

Reference implementation is available from http://github.com/prusnak/mnemonic

Check the README file for documentation how to use it.<commit_msg>fix repo url<commit_after>{{bip}}

<pre>
  BIP:     BIP-0039
  Title:   Mnemonic code for deterministic keys
  Author:  <NAME> <<EMAIL>>
           <NAME> <<EMAIL>>
  Status:  Draft
  Type:    Standards Track
  Created: 14-02-2013
</pre>

==Abstract==

This BIP proposes a scheme for translating binary data (usually master seeds
for deterministic keys, but it can be applied to any binary data) into a group
of easy to remember words also known as mnemonic code or mnemonic sentence.

==Motivation==

Such mnemonic code or mnemonic sentence is much easier to work with than working
with the binary data directly (or its hexadecimal interpretation). The sentence
could be writen down on paper (e.g. for storing in a secure location such as
safe), told over telephone or other voice communication method, or memorized
in ones memory (also called as brainwallet).

==Backwards Compatibility==

As this BIP is written, only one Bitcoin client (Electrum) implements mnemonic
codes, but it uses a different wordlist than the proposed one. Because the
Electrum (legacy) wordlist and the proposed English wordlist overlap, one has to
indicate which wordlist was used.

==Rationale==

Our proposal is inspired by Electrum implementation, but we enhanced it to have
the following features:

a) no similar words
   - words as "build" and "built", "woman" and "women" or "quick" or "quickly"
     not only make remembering the sentence difficult, but are also more error
     prone and more difficult to guess (see point below)

b) smart selection of words
   - wordlists are created in such way that it's enough to type just first three
     letters to unambiguously identify the word

c) sorted wordlists
   - allow more efficient lookup of the code words (i.e. one can use binary
     search instead of linear search)

d) localized wordlists
   - makes it easier for people to remember the code in their native language
   - by using wordlists with no colliding words among languages, it's easy to
     determine which language was used just by checking the first word of
     the sentence

We were experimenting with different wordlists sizes. The following table shows
a relationship between seed length in bits (rows), number of words used to
describe the seed (columns) and required wordlist size (table data). It turned
out that wordlist of size 1626 is indeed the best choice.

+-----+---------+--------+--------+--------+-------+-------+-------+-------+------+------+------+------+------+
|     |    12   |    13  |    14  |    15  |   16  |   17  |   18  |   19  |  20  |  21  |  22  |  23  |  24  |
+-----+---------+--------+--------+--------+-------+-------+-------+-------+------+------+------+------+------+
| 128 |    1626 |    921 |    566 |    371 |   256 |   185 |   139 |   107 |   85 |   69 |   57 |   48 |   41 |
| 160 |   10322 |   5070 |   2757 |   1626 |  1024 |   682 |   475 |   343 |  256 |  197 |  155 |  125 |  102 |
| 192 |   65536 |  27925 |  13441 |   7132 |  4096 |  2512 |  1626 |  1102 |  777 |  566 |  424 |  326 |  256 |
| 224 |  416128 | 153808 |  65536 |  31289 | 16384 |  9258 |  5574 |  3540 | 2353 | 1626 | 1162 |  855 |  646 |
| 256 | 2642246 | 847180 | 319558 | 137271 | 65536 | 34132 | 19113 | 11376 | 7132 | 4675 | 3184 | 2242 | 1626 |
+-----+---------+--------+--------+--------+-------+-------+-------+-------+------+------+------+------+------+

The conversion table between seed length in bits and number of words used in
mnemonic for wordlist of 1626 words look like this:

+------+-------+
| bits | words |
+------+-------+
|  128 |    12 |
|  160 |    15 |
|  192 |    18 |
|  224 |    21 |
|  256 |    24 |
+------+-------+

==Specification==



==Reference Implementation==

Reference implementation is available from http://github.com/trezor/mnemonic

Check the README file for documentation how to use it.
{'fraction_non_alphanumeric': 0.16169218790552817, 'fraction_numerical': 0.08772385154425123, 'mean_word_length': 2.199252801992528, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4457320', 'n_tokens_mistral': 2750, 'n_tokens_neox': 2258, 'n_words': 987}