-
Notifications
You must be signed in to change notification settings - Fork 447
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
Sanity checks for entropy size #37
Conversation
26ba2c2
to
1b8e64b
Compare
@dcousens I think the other PR should be reverted, are you gonna commit revert it or rollback history? I can rebase after |
d1f0dc8
to
1f9b012
Compare
|
I'm happy for you to revert it in this PR |
This reverts commit 952d415. Conflicts: index.js
da4a20c
to
0023ef8
Compare
limit max entropy to 1024 bytes, at which point we've reached the max size of the checksum.
0023ef8
to
2a5f482
Compare
We shouldn't forget about this. |
@dcousens definitely. We should ping @voisine and @prusnak about the following constraints which apply to BIP39.
I'll open a PR on bitcoin/bips to prompt discussion, since other implementations seem to have made different approaches. NBitcoin is restrictive, but avoids it by rejecting entropy where the length isn't one of these: 128, 160, 192, 224, 256. Bitcore-Mnemonic produces mnemonics it can't decode: BitcoinPHP (mine) had the same issue, and for variable length entropy, I resorted to padding to avoid problems. Ruben patched it already :) |
Was the conclusion:
? |
In #33 I tried coming up with a solution to deal witih odd sizes of entropy and the resulting checksum hell.
Instead the only sane solution seems to be to do better sanity checks in the entropy;
The only alternative for the max 1024 bytes would be to pad the checksum to keep the first rule in tact, but since the BIP39 spec doesn't mention anything like that it doesn't seem like a good choice.