trezor / python-shamir-mnemonic

MIT License
165 stars 59 forks source link

Feature request: Permit other kinds of strings as input? #36

Closed kristovatlas closed 3 years ago

kristovatlas commented 3 years ago

Is there any appetite to add the ability to accept a BIP39 passphrase as input?

A simple way to implement this would be to convert the phrase into a canonical hex representation and then pass that in as the master-secret.

One simple and relatively compact way to compress a BIP39 passphrase down is to treat each word as a three-digit hex value between 000 and 7ff, as there are 2048 words in the BIP39 wordlist.

If there's interest, I would be happy to submit a PR.

prusnak commented 3 years ago

BIP-39 is intentionally not supported - read https://github.com/satoshilabs/slips/blob/master/slip-0039.md#design-rationale point 9

TL;DR - you don't want to convert BIP39 to Shamir, because if the seed is compromised you don't know whether your Shamir setup was compromised or you failed to protect the original BIP39 seed.

kristovatlas commented 3 years ago

Should have finished RTFM. Thanks for the explanation.