This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
SURI HD derivation confuses ChainCode
with index i
#3396
Labels
J2-unconfirmed
Issue might be valid, but it’s not yet known.
Disclaimer: I'm not a cryptographer, talked to @burdges about it to make sure I'm reading stuff right. Jeff can fill in details if I missed anything.
Current sr25519 derivation code feeds
DeriveJunction
s asChainCode
s to soft/hard derivation methods, using empty byte arrays fori
in both cases. This seems to be fine for what we are doing (bothChainCode
andi
end up in the same hash anyway), but is not the intended use of the API.The consequences are that we are missing the extra entropy from the
ChainCode
product of previous key expansion in subsequent derivations. This is probably fine as we still have complete entropy of the original secret key, and my understanding after talking to Jeff as of why the extra entropy exists in BIP32 in the first place is that nobody knows :P.TL;DR: We are feeding derivation junctions as chain codes instead of
i
, and throwing away chain codes from previous expansions, which is probably fine.The text was updated successfully, but these errors were encountered: