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

Added address function generateDerivedHDPrivKeyWIF #146

Closed
wants to merge 6 commits into from

Conversation

raffecat
Copy link

@raffecat raffecat commented Jul 31, 2023

In address.c, generateDerivedHDPrivKeyWIF(extended_private, out_privkey_wif)
Converts an extended HD private address (dgpv, tprv) to a WIF-encoded private key.

In bip32.c, dogecoin_hdnode_serialize_privkey_wif(node, chain, outstr, strsize)
Serialize the private key from a HD node as a WIF private key string.

In chainparams.c, chain_from_bip32_prefix(bip32extkey)
Determine chainparams from a BIP32 extended private or public key.

In tool.c/tool.h/tool_tests.c
  hd_privkey_wif(hd_privkey, out_privkey_wif, inout_size)
  Convert a BIP32 extended private key to WIF format.

In bip32.c/bip32.h/bip32_tests.c
  dogecoin_hdnode_serialize_privkey_wif(node, chain, outstr, strsize)
  Serialize private key from HD node as WIF private key string.

In chainparams.c/chainparams.h
  chain_from_bip32_prefix(bip32extkey)
  Determine chainparams from BIP32 extended private or public key.
It makes more sense as an address function, and should be available
to language wrappers the same as other address functions.

Added documentation in address.md
@raffecat raffecat changed the title Added hd_privkey_wif tool and dogecoin_hdnode_serialize_privkey_wif Added address function getPrivKeyWIFForHDAddress Jul 31, 2023
@raffecat raffecat changed the title Added address function getPrivKeyWIFForHDAddress Added address function generateDerivedHDPrivKeyWIF Jul 31, 2023
@raffecat
Copy link
Author

raffecat commented Aug 1, 2023

Note - I have proposed renaming this function to convertHDKeyToECPrivKey in #149 to better reflect its purpose, since it actually just converts the HD PrivKey to a different format (bare EC Priv Key) in WIF encoding.

Removed dogecoin_hdnode_serialize_privkey_wif.
@raffecat
Copy link
Author

raffecat commented Aug 1, 2023

Revised PR to use dogecoin_privkey_encode_wif since I noticed that in @xanimo 's code :)

Copy link
Member

@xanimo xanimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK <3 gonna wait to merge so michi and ed can have a look over.

@raffecat raffecat closed this Aug 2, 2023
@raffecat raffecat deleted the rc-hd-privkey-wif branch August 2, 2023 05:04
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

Successfully merging this pull request may close these issues.

2 participants