bitpay / bitcore

A full stack for bitcoin and blockchain-based applications
https://bitcore.io/
MIT License
4.81k stars 2.08k forks source link

PublicKey to `taproot` type Address error #3584

Closed finian closed 1 year ago

finian commented 1 year ago

I try to convert a pubkey to a taproot type address using codes like below:

pubkey.toAddress(undefined, 'taproot').toString()

And I got an error saying:

xxx/node_modules/bitcore-lib/lib/address.js:293
    info.hashBuffer = Hash.sha256ripemd160(Script.buildWitnessV1Out(pubkey).toBuffer());
                                                  ^

TypeError: Script.buildWitnessV1Out is not a function

I've search buildWitnessV1Out in the whole codebase. It seems to be absent. Am I missing something?

kajoseph commented 1 year ago

Unfortunately, the taproot work was never quite finished. I got really close with https://github.com/bitpay/bitcore/pull/3318 but then had to move on to other priorities. I really hope to circle back around to finishing that PR soon, but if anyone wants to pick it up and finish it out, that would be welcome :+1: