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

How to convert BIP39 seed (numeric) back to BIP39 mnemonic (aka seed-to-mnemonic)? #696

Closed
kenorb opened this issue Oct 9, 2021 · 3 comments

Comments

@kenorb
Copy link

kenorb commented Oct 9, 2021

I'm looking for the command which does opposite to bx mnemonic-to-seed, so to take BIP39 seed as an input and convert it back to BIP39 mnemonic (words). I've looked through GitHub issues, wiki and help, but I couldn't find it.

I've tried bx mnemonic-new, but it didn't work as expected.

So as per bx mnemonic-to-seed example, I've converted to BIP39 seed:

$ bx mnemonic-to-seed --language en rival hurdle address inspire tenant almost turkey safe asset step lab boy
020b67fd929e0eb9f963443138057ceec0d62601d69b4b2327c00d74f0fd1862d164c53d49227d9dadedbbec305236bc2149d9a5267aa7c5aa004235c3c66c29

but then I've tried which I think it does opposite (using bx mnemonic new), but I have different results (different words):

$ bx mnemonic-new 020b67fd929e0eb9f963443138057ceec0d62601d69b4b2327c00d74f0fd1862d164c53d49227d9dadedbbec305236bc2149d9a5267aa7c5aa004235c3c66c29
acoustic forest youth cement thought friend tortoise hammer couple scan game talk aspect basic also square enroll bomb useless brain excuse leader ghost focus gospel clarify false eager supply street report laugh core museum pyramid dream outside spoon okay female shield exotic awesome high detect current pink slim

What I'm looking is to go back to the same list of words by giving the hex string.

@kenorb kenorb changed the title How to convert BIP39 seed (numeric) back to BIP39 mnemonic (seed-to-mnemonic)? How to convert BIP39 seed (numeric) back to BIP39 mnemonic (aka seed-to-mnemonic)? Oct 9, 2021
@kenorb
Copy link
Author

kenorb commented Oct 9, 2021

I've checked and what I look for, is more mnemonic-to-entropy command (as from seed to entropy it won't be possible).

So by giving 'rival hurdle address inspire tenant almost turkey safe asset step lab boy', I expect: baadf00dbaadf00dbaadf00dbaadf00d.

I've tested by going to Mnemonic Code Converter site and typing mnemonic words into 'BIP39 Mnemonic', and by clicking 'Show entropy details'.

@evoskuil
Copy link
Member

evoskuil commented Oct 9, 2021

BIP39 seeds are one-way hashes of the entropy derived from the words. There is no way to round trip them to the words. The same is true of Electrum v2 seeds. Electrum v1 used a simpler model where there was no seed, just words and the numeric encoding of the words (entropy). There is no "opposite" of a seed.

@evoskuil evoskuil closed this as completed Oct 9, 2021
@evoskuil
Copy link
Member

evoskuil commented Oct 9, 2021

I have recently reimplemented each of the three mnemonic implementations in libbitcoin-system and have redesigned the bx commands accordingly. This will expose the entropy in both BIP39 and Electrum v2 such that it can be round-tripped, as well as exposing the seed conversions.

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

No branches or pull requests

2 participants