Convert WIF to Witness PubKey Hash Address in Go

1

1

How can WIF be easily converted to WitnessPubKeyHash in Go?

We need to get the public key from WIF and than calculate witness program as ripemd160(sha256(compressed_pub_key)).

But is there a function in btcutil to convert the public key to witnessProg required by NewAddressWitnessPubKeyHash function:

func NewAddressWitnessPubKeyHash(witnessProg []byte, net *chaincfg.Params) (*AddressWitnessPubKeyHash, error)

Jakub N

Posted 2019-05-03T15:06:52.710

Reputation: 11

No answers