Add 256-bit seed support#3
Open
kiwihodl wants to merge 3 commits into
Open
Conversation
- Support both 128-bit (48 chars, 12 words) and 256-bit (74 chars, 24 words) seeds - Auto-detect seed size from codex32 string length - Box mode prompts user to select seed size upfront - Full-paste mode auto-detects from input Changes: - model.py: Add VALID_LENGTHS mapping, update parse/validate functions - controller.py: Add seed size selection for box mode - view.py: Add get_seed_size_choice(), update success display - tests/test_256bit.py: New test file with BIP-93 Vector 4 All existing 128-bit functionality preserved (backward compatible).
d901d7d to
510ecc7
Compare
- test_256bit_invalid_checksum_rejected: Verifies checksum validation - test_256bit_single_char_corruption: Tests corruption detection at 5 positions - test_73_char_length_rejected: Boundary test (one char short) - test_75_char_length_rejected: Boundary test (one char long) - test_mnemonic_words_are_valid_bip39: Verifies all words are valid BIP39 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove redundant if/elif branches in seed_bytes_to_mnemonic - Remove unused VALID_LENGTHS import from controller - Move bip39 import to module level in test file - Add expected mnemonic to VECTOR4 for stronger test validation - Add comments explaining magic numbers and position tests - Add .gitignore for Python artifacts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for 256-bit seeds (74-character codex32 strings → 24-word BIP39 mnemonics).
Changes
model.py: Auto-detect seed size from string lengthcontroller.py: Box mode prompts for seed size selectionview.py: Updated prompts and success displaytests/test_256bit.py: New test file with BIP-93 Test Vector 4How It Works
Test Output
All existing 128-bit functionality preserved (backward compatible).