btcsuite / btcutil

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

Add helper functions to generate (nested) segwit addresses from extended key #192

Closed setpill closed 2 years ago

setpill commented 3 years ago

Resolves #105

Credit to @bjarnemagnussen for writing the original code. I manually rebased his patch on top of latest master, fixed a typo and renamed the current ExtendedKey.Address function to be in line with the naming scheme from the patch. In place of the renamed function a simple wrapper function with a deprecation notice was added for backwards compatibility.

Roasbeef commented 2 years ago

IMO this should live along the rest of the code in btcutil.Address, the only extra hop needed is to obtain the raw public key (which now has new types as of the v2 version of this module). Closing this for now, can be re-opened in the btcd repo.