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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle invalid curve point during derivation #9

Open
0xys opened this issue Sep 12, 2021 · 0 comments
Open

Handle invalid curve point during derivation #9

0xys opened this issue Sep 12, 2021 · 0 comments

Comments

@0xys
Copy link
Owner

0xys commented Sep 12, 2021

Overview

Although the probability is extremely low (one in 2^127), bip32 CFD function would produce invalid private key or public key. bip39 spec requires implementer to handle this edge case.

xprv child derivation

https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#private-parent-key--private-child-key

In case parse256(IL) ≥ n or ki = 0, the resulting key is invalid, and one should proceed with the next value for i. (Note: this has probability lower than 1 in 2127.)

xpub child derivation

https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#private-parent-key--private-child-key

In case parse256(IL) ≥ n or Ki is the point at infinity, the resulting key is invalid, and one should proceed with the next value for i.
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

No branches or pull requests

1 participant