<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi <span style="color:rgb(0,0,0);white-space:pre-wrap;font-family:Arial,Helvetica,sans-serif">Weiji, and Everyone,</span><br></div><div class="gmail_quote"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(0,0,0);white-space:pre-wrap;font-family:Arial,Helvetica,sans-serif"><br></span></div><div style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(0,0,0);white-space:pre-wrap;font-family:Arial,Helvetica,sans-serif">I think this is an important topic so sharing my two cents in case in helps: </span>It makes sense for users to know that they can&#39;t merely just translate a word from one language into another and expect the same underlying entropy to be mapped, as the wordlists are not the same (i.e. words differ at the same index values across languages). </div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">However, while the words for each language cannot translate directly to their equivalent in another language, in terms of entropy (bits), the underlying entropy is, in fact, the same, when comparing mnemonics generated across languages (see English/Spanish comparison below) when sourced from the same initial entropy.<br></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">Importantly, the entropy is a pre-image of the resulting mnemonic and doesn&#39;t change as the language changes, where the only changes are to the resulting words which depend on the language chosen, for a given entropy string. Ideally, the wallet/software should deal with these nuances, I don&#39;t think the protocol needs any revision (except for how the BIP39 seed is derived, perhaps), even if someone made up their own wordlist, as long as the wallet/software has a copy of it to map those words to the underlying index values, it&#39;s <b>those underlying index values and the entropy they map too is what really matters</b><b>. </b></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">I fully support the idea for users to back up this pre-image (initial entropy) as it can also be used to check the validity of the mnemonic and check that it mapped correctly, see Ian Coleman&#39;s BIP39 tool which shows index values, a feature that I proposed last year and was since implemented. Below is an example of how two mnemonics generated with the same entropy will produce different BIP39 seeds.<br></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif"><b> Example initial entropy of 128 bits +4 bit checksum derived from hash of byte array: </b></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(51,51,51);font-family:&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-size:14px">10001101000 01010100100 11011010000 11100001101 01010001101 00010010001 01100000010 10101110100 00100100011 11110000111 01100011010 1100010 (+1110 checksum)</span><br></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div><font face="arial, helvetica, sans-serif"><b>In English</b>: minimum fee sure ticket faculty banana gate purse caught valley globe shift</font><br></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">The same initial entropy above (all 132 bits) produces this mnemonic:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><b>In Spanish</b>: mercado faja soledad tarea evadir aries gafas peine búho tumor gerente reja</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">And the underlying index values below are the same for both the English and Spanish mnemonics above: </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><span style="color:rgb(51,51,51);font-family:&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-size:14px;font-weight:bold;text-align:right">Word Indexes: </span><span style="color:rgb(51,51,51);font-family:&quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;font-size:14px">1128, 676, 1744, 1805, 653, 145, 770, 1396, 291, 1927, 794, 1582</span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif"><font color="#ff0000"><b>ISSUE AT HAND</b></font>:  While the initial entropy is the same, and word indexes the same for a given entropy, (i.e. same pre-image), the resulting BIP39 seed is not the same when comparing the above English mnemonic with its Spanish counterpart:</span><br></div><div><ul><li><b>English BIP39 seed:</b> <font face="arial, helvetica, sans-serif">ce7618075099c89e986f18dc495daa3be190450ed07bef77d4334a54dbc1cd7e205797ffed2615ac0999a5d691f65bf316e2cdbfd2c9d7d90b03e77ff1e6a6f5</font><br></li><li><b>Spanish BIP39 seed</b>:<font face="arial, helvetica, sans-serif">9f164de0fb09af51b5831886e424d6d2479d49b5e5a1b28f5c09467ea36089b144cd94bb9b636b3c27ccff96a8958e5b7ce43cf1dea81423fc66fa7fef0aea2c</font><br></li></ul></div><div><br></div><div style="font-family:arial,helvetica,sans-serif"><b>Option 1:</b> Without changing anything in terms of the entropy generation/mapping process in the BIP39 spec, the wallet/client-side software would ideally recognize the language and show the corresponding index value per wordlist, and reverse-calculate the entropy and then re-map it to the language selected. </div><div style="font-family:arial,helvetica,sans-serif"><br></div><div><b style="font-family:arial,helvetica,sans-serif">Option 2</b><font face="arial, helvetica, sans-serif">: Perhaps a revision is needed to how the BIP39 seed is generated in the first place, such as by hashing the entropy instead of the words. Any thoughts on how viable that could be where the initial entropy is fed into the PBKDF2 function and not the words?</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div style="font-family:arial,helvetica,sans-serif"><u>Closing thoughts and tiny checksum nitpick: </u></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">      - The multiple BIP39 seeds per language lend some similarities to BIP44 multi-account, so perhaps this can be an advantage, depends on how it is applied in UI/UX&#39;s (compared to having one BIP39 seed regardless of language, for a given initial entropy).</div><div style="font-family:arial,helvetica,sans-serif">      - There is perhaps an opportunity to add greater detail to the BIP39 spec in terms of standards/best-practices for computing checksum values, as some software may be hashing bits, versus hashing bytes, or hashing the entropy as a hex string, etc.. for a given entropy, which will result in different checksum values for the same &quot;valid&quot; mnemonic, that might not be &quot;valid&quot; in another wallet which may format the data differently before hashing to compute the checksum. </div><div style="font-family:arial,helvetica,sans-serif"> </div><div style="font-family:arial,helvetica,sans-serif"><br></div><div><div dir="ltr" class="m_-2528909876728425141gmail_signature"><div dir="ltr"><div dir="ltr"><div style="font-size:12.8px;font-family:arial,helvetica,sans-serif"><span>Best regards,</span></div><div style="font-size:12.8px;font-family:arial,helvetica,sans-serif"><span><br>Steven</span> <span>Hatzakis</span> </div><div style="font-size:12.8px;font-family:arial,helvetica,sans-serif"><br></div><div style="font-size:12.8px;font-family:arial,helvetica,sans-serif"><div style="font-family:arial,helvetica,sans-serif">_______________</div><div style="font-family:arial,helvetica,sans-serif"></div></div><h1 style="color:rgb(0,0,0);font-family:Times">[bitcoin-dev] BIP- &amp; SLIP-0039 -- better multi-language support</h1><b style="color:rgb(0,0,0);font-family:Times;font-size:medium">Weiji Guo</b><span style="color:rgb(0,0,0);font-family:Times;font-size:medium"> </span><a href="mailto:bitcoin-dev%40lists.linuxfoundation.org?Subject=Re:%20Re%3A%20%5Bbitcoin-dev%5D%20%20BIP-%20%26%20SLIP-0039%20--%20better%20multi-language%20support&amp;In-Reply-To=%3CCA%2Bydi%3DLM%2Bq-9WKewb%3D65tWCqM1cPMoWEeWq5XAxdqg4rz%3DZJ6g%40mail.gmail.com%3E" title="[bitcoin-dev]  BIP- &amp; SLIP-0039 -- better multi-language support" style="font-family:Times;font-size:medium" target="_blank">weiji.g at gmail.com </a><br style="color:rgb(0,0,0);font-family:Times;font-size:medium"><i style="color:rgb(0,0,0);font-family:Times;font-size:medium">Tue Nov 6 16:16:41 UTC 2018</i><span style="color:rgb(0,0,0);font-family:Times;font-size:medium"></span><p style="color:rgb(0,0,0);font-family:Times;font-size:medium"></p><ul style="color:rgb(0,0,0);font-family:Times;font-size:medium"><li>Previous message: <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/016469.html" target="_blank">[bitcoin-dev] draft proposal: change forwarding (improved fungibility through wallet interoperability)</a></li><li>Next message: <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/016470.html" target="_blank">[bitcoin-dev] Considering starting a toy full-node implementation.        Any advice?</a></li><li><b>Messages sorted by:</b> <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/date.html#16468" target="_blank">[ date ]</a> <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/thread.html#16468" target="_blank">[ thread ]</a> <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/subject.html#16468" target="_blank">[ subject ]</a> <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/author.html#16468" target="_blank">[ author ]</a></li></ul><hr style="color:rgb(0,0,0);font-family:Times;font-size:medium"><pre style="white-space:pre-wrap;color:rgb(0,0,0)">Hello everyone,

I just realized that BIP-0039 is language dependent. I was assuming the
other way till I looked closer. The way the seed is derived from a BIP-0039
entropy, as is shown below, depends on which language to generate the
mnemonic sentence:

   Entropy &lt;=&gt; Mnemonic Sentence =&gt; PBKDF2 =&gt; BIP-0032 Seed

Therefore when a user choose a non-English mnemonic code he or she is stuck
with that language. Meanwhile only a few native languages are supported.

SLIP-0039 does not solve this issue in a user friendly way by providing
only an English wordlist. That&#39;s understandable as it aims to provide SSS
capability. However those users who do not speak English or recognize
English words will suffer.

What I am trying to bring to attention of the community is that, no matter
if we make a new version of BIP-0039, or a new BIP (with SSS support), or
to enhance SLIP-0039, we really need to address this language issue.

Here are what I propose:

1. The mnemonic code should be only a representation of underlying entropy
or (pre) master secret, seed, whatever. In this way, the same seed/secret
could be displayed in English or in Chinese or other languages. Then there
could be 3rd party conversion tools to support translations in case any
wallet software or device does not support all specified languages. Now it
looks like:

   Mnemonic Sentence &lt;=&gt; Entropy =&gt; PBKDF2 =&gt; BIP-0032 Seed

2. Given that only 8 languages are supported in BIP-0039, we should allow
the seed/secret to be represented in decimal numbers, each ranging from 0
to 2047. So those who cannot find a native language support yet having
difficulty coping words in other languages could choose to just use numbers.

So far I don&#39;t have a preference how this should be implemented. I&#39;d like
to hear from community first.

Thanks,

Weiji Guo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: &lt;<a href="http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20181107/88677440/attachment.html" target="_blank">http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20181107/88677440/attachment.html</a>&gt;
</pre><hr style="color:rgb(0,0,0);font-family:Times;font-size:medium"><p style="color:rgb(0,0,0);font-family:Times;font-size:medium"></p><ul style="color:rgb(0,0,0);font-family:Times;font-size:medium"><li>Previous message: <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/016469.html" target="_blank">[bitcoin-dev] draft proposal: change forwarding (improved fungibility through wallet interoperability)</a></li><li>Next message: <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/016470.html" target="_blank">[bitcoin-dev] Considering starting a toy full-node implementation.        Any advice?</a></li><li><b>Messages sorted by:</b> <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/date.html#16468" target="_blank">[ date ]</a> <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/thread.html#16468" target="_blank">[ thread ]</a> <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/subject.html#16468" target="_blank">[ subject ]</a> <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-November/author.html#16468" target="_blank">[ author ]</a></li></ul><hr style="color:rgb(0,0,0);font-family:Times;font-size:medium"><a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" style="font-family:Times;font-size:medium" target="_blank">More information about the bitcoin-dev mailing list</a><br><div style="font-size:12.8px;font-family:arial,helvetica,sans-serif"></div></div></div></div></div></div></div></div></div></div></div>
</div></div>