btcsuite / btcutil

Provides bitcoin-specific convenience functions and types
480 stars 410 forks source link

hdkeychain: add CloneWithVersion to set custom HD version bytes #181

Closed onyb closed 4 years ago

onyb commented 4 years ago
GH #179 https://github.com/btcsuite/btcd/pull/1617

This adds a new method to the ExtendedKey type that allows cloning the extended key with custom HD version bytes. It does not mutate the original extended key on which the method is called.

Added some tests to demonstrate the utility of this method, i.e., conversion between standard and SLIP-0132 extended keys.

mflaxman commented 4 years ago

What's the status of getting this merged? It's needed to take advantage of the functionality added in https://github.com/btcsuite/btcd/pull/1617.

onyb commented 4 years ago

@mflaxman Thanks for the reminder. Kinda forgot to follow up on this with the other reviewers. Should be quick, since the changes are quite straightforward.

mflaxman commented 4 years ago

FYI: I open-sourced my hackey code (that doesn't use these pending PRs) if you want to see what a use-case looks like.

https://github.com/mflaxman/human-rng-golang