btclib-org / btclib

btclib: a python3 library for 'bitcoin cryptography'
https://btclib.org
MIT License
97 stars 42 forks source link

improved bip32 derivation #112

Closed fametrano closed 1 year ago

fametrano commented 1 year ago

Avoided updating parent_fingerprint and index in multi-level derivation (as already done for depth). This save an EC multiplication in every non-hardened private key derivation. Also added test for explicit public key derivation, strangely missing from BIP32 test vectors where one could always use private derivation + xpub_from_xpriv instead of public key derivation.

giacomocaironi commented 1 year ago

I don't think the speed improvement of these changes will be noticeable

fametrano commented 1 year ago

I don't think the speed improvement of these changes will be noticeable

I agree. Nonetheless, why not saving redundant variable updates plus an EC multiplication in every non-hardened private key derivation?