Closed zargarzadehm closed 4 months ago
Hi @zargarzadehm , we are taking look at it
Hi @zargarzadehm, there could be some misuse of the field. But currently the (non-hardened) child key derivation only use the publickey, chainocode to compute next level child, the version seems not impact anywhere. I guess the whole structure kept mainly to be compatible with test suite from e.g. btcsuite
Hi @zargarzadehm, there could be some misuse of the field. But currently the (non-hardened) child key derivation only use the publickey, chainocode to compute next level child, the version seems not impact anywhere. I guess the whole structure kept mainly to be compatible with test suite from e.g. btcsuite
Do you mean for production purpose we should use DeriveChildKeyFromHierarchy method directly, instead of derivingPubkeyFromPath
?
https://github.com/bnb-chain/tss-lib/blob/7113b68867a703940aa0c2150fa80ea63ab8d07b/ecdsa/signing/key_derivation_util.go#L55
Is there a specific reason for setting
HDPrivateKeyID
as the Version for the extended PublicKey in the functionderivingPubkeyFromPath
? It seems like it should beHDPublicKeyID
.For instance, in this unit test, you are deriving using
keys[0].ECDSAPub
, while the Version set inderivingPubkeyFromPath
isHDPrivateKeyID
, which implies the response would involvexprv
instead ofxpub
.