Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mnemonic: make sure newly generated seeds are not valid as bip39 #6001

Merged

Conversation

SomberNight
Copy link
Member

Currently there is an approx 1/16 chance that newly generated seeds have a valid bip39 checksum (and hence are both valid electrum seeds and bip39 seeds at the same time).

This patch would make sure that newly generated seeds are not also valid bip39 seeds by accident.

As a result, seed generation would become a bit slower, taking approx. 20% more time.

import time
import electrum

mn = electrum.mnemonic.Mnemonic()

t0 = time.time()
for i in range(1000):
    seed = mn.make_seed("standard")

t1 = time.time()
print(f"time taken: {t1-t0} sec")

@andronoob
Copy link

This change makes some sense, however it cannot make any change to all those existing seed phrases generated with unwanted "BIP39-Electrum2.0 duality".

Both BIP39, Electrum2.0, aezeed, ... and all the other alleged "brilliant new design of mnemonic phrase", consist the chaotic situation altogether.

Even if BIP39 got abandoned from now on, by all wallet devs, there would still inevitably be users who rely on BIP39 tightly.

And, ditto for all those "opponent to BIP39", including Electrum2.0, that each of them also has its own users who rely on it tightly.

@andronoob
Copy link

Currently, there's also a probability of (2^4 + 1 + 1) / 2^12 = 9/2048 (0.439%) for a randomly generated BIP39 mnemonic to be a valid Electrum2.0 seed at same time. This probability could be higher as more and more newly defined version numbers are expected in the future.

Electrum can only make sure that it won't generate a Electrum2.0 seed with such "duality", but it can't stop other wallets generating BIP39 mnemonics which have valid Electrum version number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants