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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use wordlist-4096 for denser encoding #26

Merged
merged 4 commits into from
Jan 29, 2023
Merged

feat: use wordlist-4096 for denser encoding #26

merged 4 commits into from
Jan 29, 2023

Conversation

kklash
Copy link
Owner

@kklash kklash commented Jan 27, 2023

Fixes #25

Summary

This PR introduces wordlist-4096, the 4096-length wordlist i spent way too much time creating over the winter holidays 馃槄 This wordlist replaces our use of BIP39 and provides even stronger guarantees (like a Damerau Levenshtein minimum edit distance between all words, which BIP39 lacks)

With wordlist-4096, each word encodes 12 bits to BIP39's 11. This permits denser encoding, allowing us to drop the default phrase length from 15 to 14, and encode more data in the phrase at the same time.

By expanding the version number, we will also have more room to grow in the future, especially because we are probably going to add passphrase-encrypted phrases, which will require a new version number from the get-go.

Phrase Encoding Changes

This table highlights the changes to the fields encoded in the recovery phrases.

Field Size Before Size After
Version Number 2 bits 4 bits
Entropy 128 bits 128 bits
Creation Offset 30 bits 31 bits
Checksum 5 bits 5 bits
-- -- --
Total 165 Bits 168 Bits
Words Needed $\frac{165}{11}=15$ $\frac{168}{12}=14$

@kklash kklash added enhancement New feature or request affects-specification Will cause specification changes labels Jan 27, 2023
@kklash kklash self-assigned this Jan 27, 2023
@veqtrus
Copy link

veqtrus commented Jan 27, 2023

Do we care about similarly sounding words like abhor, abort? What about similarly looking ones like goalie, goatee?

@kklash
Copy link
Owner Author

kklash commented Jan 29, 2023

It'd be great if we could maximize distance between all the words but it's a challenging task.

Once we release mnemonikey v1, I'll create a tag in the wordlist4096 repo and freeze the wordlist there. But for now, if you'd like to make any suggestions, the wordlist itself is open for suggested changes at https://github.com/kklash/wordlist4096. The encoding logic lives in mnemonikey, but the actual word list is now outside the scope of this repository.

@kklash kklash merged commit 8f9dee9 into main Jan 29, 2023
@kklash kklash deleted the wordlist-4096 branch January 29, 2023 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-specification Will cause specification changes enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use wordlist-4096 for denser encoding
2 participants