Skip to content

fix: ensure indexBits matches mnemonic checksum capacity (#55)#61

Open
mvmax-dev wants to merge 1 commit into
bitaps-com:masterfrom
mvmax-dev:fix/issue-55
Open

fix: ensure indexBits matches mnemonic checksum capacity (#55)#61
mvmax-dev wants to merge 1 commit into
bitaps-com:masterfrom
mvmax-dev:fix/issue-55

Conversation

@mvmax-dev
Copy link
Copy Markdown

This PR fixes Issue #55 where using embeddedIndex: true with 12-word mnemonics could lead to silent wallet loss.

Changes:

  • Dynamically calculate indexBits based on the input mnemonic's entropy length (12-word = 4 bits, 24-word = 8 bits).
  • Added validation to ensure the total number of shares does not exceed the bit capacity of the mnemonic's checksum field.

This prevents x-coordinate truncation and collisions that cause recovery to fail or produce incorrect results.

Verified with 100 random split/combine trials on 12-word mnemonics.

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

Successfully merging this pull request may close these issues.

1 participant