Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YVss9-00038r-Fb for Bitcoin-development@lists.sourceforge.net; Thu, 12 Mar 2015 02:29:17 +0000 Received: from nm35-vm5.bullet.mail.bf1.yahoo.com ([72.30.238.77]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YVss7-0007f6-7a for Bitcoin-development@lists.sourceforge.net; Thu, 12 Mar 2015 02:29:17 +0000 Received: from [66.196.81.170] by nm35.bullet.mail.bf1.yahoo.com with NNFMP; 12 Mar 2015 02:16:40 -0000 Received: from [98.139.212.220] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 12 Mar 2015 02:16:39 -0000 Received: from [127.0.0.1] by omp1029.mail.bf1.yahoo.com with NNFMP; 12 Mar 2015 02:16:39 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 966967.23446.bm@omp1029.mail.bf1.yahoo.com X-YMail-OSG: CQ7KhucVM1mkAmIMGB9C3Wgj0L2Ufy5N7XR1krnP7l97RSFdtk4UNEqilk9bYKD P17IlfroeEV1NbknkHSctTiRLTnCWvnmAxb_tEUgD3rb0STUG9WS1ktsYBVMyd7_DxZBq0qmjINb 8tmF7O3z.EU_NqZS_OllUXdZ1YD42VhS36wG2BgeuoYM2mAju2sn_bpJMAQsRnV.BHgV1iPCC2IT iLa4A_ibU3GLk1M9OX49WSiIDglqO.odwUfdgDDf9kBSu6nRQVGwhltqRu1v8sfkyZgSYVP4ORBp UOWyfNg0N4_ASJOQNJHnLSwJLlJASkEHKVpEmkqKO4kDGsQjOw8grvpwzvmHCjOQlw3QePOfaB4T Gv7E_LWbuCOXl43AE0jOe1mafzfIVFHHMx6nvSp6GLR.jM7iQlRlJk79V0TAgjxOXJ3cx3vKLnLC KAqyo6.1QhBC4yIRmeKCwAgRM4ZqMcpPkbDK8vOZakIh3xtfYQeN5IOPlFuWCfu2xfAOMyk.jpGp t4Zv85uWLNTVwxz.HNxPF Received: by 66.196.80.148; Thu, 12 Mar 2015 02:16:39 +0000 Date: Thu, 12 Mar 2015 02:16:38 +0000 (UTC) From: Thy Shizzle To: "thomasv@electrum.org" Message-ID: <1301469616.4369014.1426126598899.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <1353069350.4360497.1426126034565.JavaMail.yahoo@mail.yahoo.com> References: <1353069350.4360497.1426126034565.JavaMail.yahoo@mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4369013_1590000418.1426126598884" X-Spam-Score: 1.2 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (harro84[at]yahoo.com.au) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (harro84[at]yahoo.com.au) 1.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [72.30.238.77 listed in list.dnswl.org] 0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1YVss7-0007f6-7a Cc: "Bitcoin-development@lists.sourceforge.net" Subject: Re: [Bitcoin-development] Electrum 2.0 has been tagged X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: Thy Shizzle List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 02:29:17 -0000 ------=_Part_4369013_1590000418.1426126598884 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable That's disappointing the Electrum 2.0 doesn't use BIP39. From my interpretation of BIP39, wordlists DO NOT=C2=A0REQUIRE to be fixed = between wallet providers.=C2=A0There is some recommendations regarding the = wordlists to help with things such as predictive text, so mobile apps can e= asily predict the word being typed in after a few chars etc. This would see= m to be the reasoning for the reference word lists. Now there is nothing st= opping one from implementing a wordlist of say profanities or star wars ter= ms or whatever and still accepting a mnemonic from another provider. Rememb= er if you have a mnemonic from a different wordlist, simply Normalization o= f the words occurs and then the hashing the mnemonic=C2=A0to derive the see= d bytes. It is not really a restriction at all! BIP39 was designed such tha= t the mnemonic generation is decoupled from seed derivation, just like what= you are saying Electrum 2.0 can do! The wordlist is only needed for mnemon= ic generation NOT seed derivation, so Electrum DOES NOT need a copy of the = BIP39 word lists to generate the seed from the phrase, there is really not = much reason for Electrum not to accept BIP39 mnemonics at the moment! it re= quires bugger all code! Here is my seed generation code //literally this is the bulk of the decoupled seed generation code, easy.by= te[] salt =3D Utilities.MergeByteArrays(UTF8Encoding.UTF8.GetBytes(cSaltHea= der),_passphraseBytes);return Rfc2898_pbkdf2_hmacsha512.PBKDF2(UTF8Encoding= .UTF8.GetBytes(Utilities.NormaliseStringNfkd(MnemonicSentence)), salt); Changing the wordlist in the future has ZERO effect on derived seed, whatev= er mnemonic you provide will always generate the same seed, BIP39 is not ma= pping the words back to numbers etc to derive seed. Version is something that can be dealt with after the fact, hopefully stand= ardised (curious why didn't you work with the BIP39 to insert version inste= ad of do something different to BIP39?) So most of what you are suggesting as problems are not. As for the common words between languages, I have discussed this with the p= rovider of the Chinese wordlists as they shared some words between simplifi= ed and traditional, but I found it easy to look for a word in the mnemonic = that is unique to that language/wordlist and so straight away you can deter= mine the language, remembering you get minimum 12 goes at doing that :) Also then I asked myself, do we really care about detecting the language? P= robably not because we don't need to use the wordlist ever again after crea= tion, we literally accept the mnemonic, normalise it then hash it into a se= ed. From what I'm reading, Electrum 2.0 really should have BIP39, it would = take almost no effort to put it in and I think you should do that :) I don'= t have any interest in BIP39 other than it being a standard. I think TREZOR= may have an interest in it? Thomas V: "Thanks Mike, and sorry to answer a bit late; it has been a busy couple of weeks. You are correct, a BIP39 seed phrase will not work in Electrum, and vice versa. It is indeed unfortunate. However, I believe BIP39 should not be followed, because it reproduces two mistakes I did when I designed the older Electrum seed system. Let me explain. The first problem I have with BIP39 is that the seed phrase does not include a version number. Wallet development is still in an exploratory phase, and we should expect even more innovation in this domain. In this context, it is unwise to make decisions that prevent future innovation. However, when we give a seed phrase to users, we have a moral obligation to keep supporting this seed phrase in future versions. We cannot simply announce to Electrum users that their old seed phrase is not supported anymore, because we created a new version of the software that uses a different derivation. This could lead to financial losses for users who are unaware of these technicalities. Well, at least, that is how I feel about it. BIP39 and Electrum v2 have a very different ways of handling future innovation. Electrum v2 seed phrases include an explicit version number, that indicates how the wallet addresses should be derived. In contrast, BIP39 seed phrases do not include a version number at all. BIP39 is meant to be combined with BIP43, which stipulates that the wallet structure should depend on the BIP32 derivation path used for the wallet (although BIP43 is not followed by all BIP39 compatible wallets). Thus, innovation in BIP43 is allowed only within the framework of BIP32. In addition, having to explore the branches of the BIP32 tree in order to determine the type of wallet attached to a seed might be somewhat inefficient. The second problem I see with BIP39 is that it requires a fixed wordlist. Of course, this forbids innovation in the wordlist itself, but that's not the main problem. When you write a new standard, it is important to keep this standard minimal, given the goal you want to achieve. I believe BIP39 could (and should) have been written without including the wordlist in the standard. There are two ways to derive a master key from a mnemonic phrase: =C2=A01. A bidirectional mapping between words and numbers, as in old Electrum versions. Pros: bidirectional means that you can do Shamir secret sharing of your seed. Cons: It requires a fixed wordlist. =C2=A02. Use a hash of the seed phrase (pbkdf). Pros: a fixed wordlist is n= ot required. Cons: the mapping isn't bidirectional. Electrum v1 uses (1). Electrum v2 uses (2). Early versions of BIP39 used (1), and later they switched to (2). However, BIP39 uses (2) only in order to derive the wallet keys, not for its checksum. The BIP39 checksum uses (1), and it does requires a fixed wordlist. This is just plainly inconsistent. As a result, you have neither wordlist flexibility, nor Shamir secret sharing. Having a fixed wordlist is very unfortunate. First, it means that BIP39 will probably never leave the 'draft' stage, until all languages of the world have been added. Second, once you add a wordlist for a new language, you cannot change it anymore, because it will break existing seed phrases; therefore you have to be extremely careful in the way you design these wordlists. Third, languages often have words in common. When you add a new language to the list, you should not use words already used by existing wordlists, in order to ensure that the language can be detected. It leads to a first come first served situation, that might not be sustainable in the future. In order to support the old Electrum v1 seeds, all future versions of Electrum will have to include the old wordlist. In addition, when generating new seed phrases, Electrum now has to avoid collisions with old seed phrases, because the old ones did not have a version number. This is painful enough, I will not repeat the same errors twice. Electrum v2 derives both its private keys and its checksum/version number using a hash of the seed phrase. This means that wordlists can be added and modified in the future, without breaking existing seed phrases. It also means that it will be very easy for other wallets to support Electrum seedphrases: it requires about 20 lines of code, and no wordlist is required." Thomas Le 02/03/2015 16:37, Mike Hearn a =C3=A9crit : > Congrats Thomas! Glad to see Electrum 2 finally launch. >=20 >=20 >> * New seed derivation method (not compatible with BIP39). >=20 >=20 > Does this mean a "12 words" wallet created by Electrum won't work if > imported into some other wallet that supports BIP39? Vice versa? This see= ms > unfortunate. I guess if seeds are being represented with 12 words > consistently, people will expect them to work everywhere. >=20 ---------------------------------------------------------------------------= --- Dive into the World of Parallel Programming The Go Parallel Website, sponso= red by Intel and developed in partnership with Slashdot Media, is your hub for = all things parallel software development, from weekly thought leadership blogs = to news, videos, case studies, tutorials and more. Take a look and join the=20 conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Bitcoin-development mailing list Bitcoin-development@lists.sourceforge.net Bitcoin-development -- | =C2=A0 | | =C2=A0 | =C2=A0 | =C2=A0 | =C2=A0 | =C2=A0 | | Bitcoin-development --To see the collection of prior postings to the list= , visit the Bitcoin-development Archives. | | | | View on lists.sourceforge.net | Preview by Yahoo | | | | =C2=A0 | =C2=A0 =20 ------=_Part_4369013_1590000418.1426126598884 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
That's disappo= inting the Electrum 2.0 doesn't use BIP39.

Fr= om my interpretation of BIP39, wordlists DO NOT REQUIRE to be fixed be= tween wallet providers. There is some recommendations regarding the wo= rdlists to help with things such as predictive text, so mobile apps can eas= ily predict the word being typed in after a few chars etc. This would seem = to be the reasoning for the reference word lists. Now there is nothing stop= ping one from implementing a wordlist of say profanities or star wars terms= or whatever and still accepting a mnemonic from another provider. Remember= if you have a mnemonic from a different wordlist, simply Normalization of = the words occurs and then the hashing the mnemonic to derive the seed = bytes. It is not really a restriction at all! BIP39 was designed such that = the mnemonic generation is decoupled from seed derivation, just like what y= ou are saying Electrum 2.0 can do! The wordlist is only needed for mnemonic= generation NOT seed derivation, so Electrum DOES NOT need a copy of the BI= P39 word lists to generate the seed from the phrase, there is really not mu= ch reason for Electrum not to accept BIP39 mnemonics at the moment! it requ= ires bugger all code! Here is my seed generation code

<= div class=3D"qtdSeparateBR">

//literally this is = the bulk of the decoupled seed generation code, easy.
byte[] salt =3D Utilitie= s= .MergeBy= teArrays(UTF8Encoding.UTF8.<= font id=3D"yiv4337945889yui_3_16_0_1_1426122660566_5465" color=3D"#dcdcdc" = face=3D"Consolas" size=3D"2">GetBytes(cSaltHe= ader),_passphraseBytes);
return Rfc2898_pbkdf2_hmacsha512.PBKDF2(UTF8Encoding.UTF8.GetBytes(Utilities.<= /font>NormaliseStringNfkd(MnemonicSentence)), salt);<= /font>


Changing the wordlist in the futur= e has ZERO effect on derived seed, whatever mnemonic you provide will alway= s generate the same seed, BIP39 is not mapping the words back to numbers et= c to derive seed.

Ver= sion is something that can be dealt with after the fact, hopefully standard= ised (curious why didn't you work with the BIP39 to insert version instead = of do something different to BIP39?)

So most of what you are suggesting = as problems are not.

As for the common words between languages, I have d= iscussed this with the provider of the Chinese wordlists as they shared som= e words between simplified and traditional, but I found it easy to look for= a word in the mnemonic that is unique to that language/wordlist and so str= aight away you can determine the language, remembering you get minimum 12 g= oes at doing that :)

Also then I asked myself, do we really care about d= etecting the language? Probably not because we don't need to use the wordli= st ever again after creation, we literally accept the mnemonic, normalise i= t then hash it into a seed. From what I'm reading, Electrum 2.0 really shou= ld have BIP39, it would take almost no effort to put it in and I think you = should do that :) I don't have any interest in BIP39 other than it being a = standard. I think TREZOR may have an interest in it?

Thomas V:

=
"Thanks Mike, and = sorry to answer a bit late; it has been a busy couple
of weeks.

You are correct, a BIP39 seed phrase will not work in Electrum, and vi= ce
versa. It is inde= ed unfortunate. However, I believe BIP39 should not be
followed, because it reproduces two mist= akes I did when I designed the
older Electrum seed system. Let me explain.

The first problem I have with BIP39 is that the seed phrase= does not
include a = version number.

Wallet development is s= till in an exploratory phase, and we should
expect even more innovation in this domain. In this= context, it is
unwi= se to make decisions that prevent future innovation.

However, when we give a seed phrase to users, we have a moral= obligation
to keep = supporting this seed phrase in future versions. We cannot simply
announce to Electrum users tha= t their old seed phrase is not supported
anymore, because we created a new version of the softw= are that uses a
diff= erent derivation. This could lead to financial losses for users who
are unaware of these tech= nicalities. Well, at least, that is how I feel
about it.

BI= P39 and Electrum v2 have a very different ways of handling future
innovation. Electrum v2 seed = phrases include an explicit version number,
that indicates how the wallet addresses should be d= erived. In contrast,
BIP39 seed phrases do not include a version number at all. BIP39 is
meant to be combined with= BIP43, which stipulates that the wallet
structure should depend on the BIP32 derivation path u= sed for the wallet
(= although BIP43 is not followed by all BIP39 compatible wallets). Thus,
innovation in BIP43 is a= llowed only within the framework of BIP32. In
addition, having to explore the branches of the B= IP32 tree in order to
determine the type of wallet attached to a seed might be somewhat
inefficient.

The second problem I see with BIP39 is that it requ= ires a fixed
wordlis= t. Of course, this forbids innovation in the wordlist itself, but
that's not the main problem. = When you write a new standard, it is
important to keep this standard minimal, given the goal yo= u want to
achieve. I= believe BIP39 could (and should) have been written without
including the wordlist in the stand= ard.

There are two ways to derive a mas= ter key from a mnemonic phrase:
 1. A bidirectional mapping between words and numbers, as = in old
Electrum vers= ions. Pros: bidirectional means that you can do Shamir
secret sharing of your seed. Cons: It re= quires a fixed wordlist.
 2. Use a hash of the seed phrase (pbkdf). Pros: a fixed wordlist= is not
required. Co= ns: the mapping isn't bidirectional.

El= ectrum v1 uses (1). Electrum v2 uses (2).

Early versions of BIP39 used (1), and later they switched to (2).
However, BIP39 uses (2) o= nly in order to derive the wallet keys, not for
its checksum. The BIP39 checksum uses (1), and = it does requires a fixed
wordlist. This is just plainly inconsistent. As a result, you have
neither wordlist flexib= ility, nor Shamir secret sharing.

Havin= g a fixed wordlist is very unfortunate. First, it means that BIP39
will probably never leave th= e 'draft' stage, until all languages of the
world have been added. Second, once you add a wordl= ist for a new
langua= ge, you cannot change it anymore, because it will break existing
seed phrases; therefore you ha= ve to be extremely careful in the way you
design these wordlists. Third, languages often have w= ords in common.
When= you add a new language to the list, you should not use words
already used by existing wordlist= s, in order to ensure that the language
can be detected. It leads to a first come first served = situation, that
migh= t not be sustainable in the future.

In = order to support the old Electrum v1 seeds, all future versions of
Electrum will have to includ= e the old wordlist. In addition, when
generating new seed phrases, Electrum now has to avoid co= llisions with
old se= ed phrases, because the old ones did not have a version number.
This is painful enough, I will = not repeat the same errors twice.

Elect= rum v2 derives both its private keys and its checksum/version
number using a hash of the seed p= hrase. This means that wordlists can be
added and modified in the future, without breaking exis= ting seed
phrases. I= t also means that it will be very easy for other wallets to
support Electrum seedphrases: it re= quires about 20 lines of code, and no
wordlist is required."


Thomas


Le 02/03/2015 16:37, Mike Hearn a =C3=A9crit :
> Congrats Thomas! Glad to see Electru= m 2 finally launch.
= >
>
>> * New seed derivati= on method (not compatible with BIP39).
>
>
> Does= this mean a "12 words" wallet created by Electrum won't work if
> imported into some other = wallet that supports BIP39? Vice versa? This seems
> unfortunate. I guess if seeds are being= represented with 12 words
> consistently, people will expect them to work everywhere.
>

----------------------------------------------------------= --------------------
Dive into the World of Parallel Programming The Go Parallel Website, spons= ored
by Intel and de= veloped in partnership with Slashdot Media, is your hub for all
things parallel software develo= pment, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. = Take a look and join the
conversation now. http://goparallel.sourceforge.net/
____________________________________= ___________
Bitcoin-= development mailing list
Bitcoin-development@lists.sourceforge.net
Bitcoin-development --
<= td class=3D"yiv4337945889link-enhancr-element" style=3D"width: 14px; font-s= ize: 0pt; border-collapse: collapse; background-color: rgb(255, 255, 255);"= rowspan=3D"5"><= td class=3D"yiv4337945889link-enhancr-element" style=3D"height: 9px; font-s= ize: 0pt; border-collapse: collapse; background-color: rgb(255, 255, 255);"= colspan=3D"2">
&nbs= p;


------=_Part_4369013_1590000418.1426126598884--