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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.