Closed pokrovskyy closed 8 months ago
Update - I switched to "@cmdcode/crypto-utils": "2.0.2"
and now using this to generate private/public key pair:
const seckey = util.getSecretKey(secret)
const pubkey = util.getPublicKey(seckey, true)
And it now works 😄 (for anyone bumping into this) So I guess it is a matter of using the right key generation functions. However I would still appreciate the answer on how to do this properly with up-to-date library versions @cmdruid Thanks!
Public key version reserved for soft-fork upgrades
This error happens when you use a 33-byte pubkey in a taproot script instead of a 32-byte pubkey.
In newer versions of the crypto library, I have switched to using 32-byte pubkeys by default, since that is the direction things seem to be going.
The taproot upgrade reserves that 33rd byte as a version number for future upgrades.
I hope that helps!
oh, I see! will take that into account, makes sense 👌
Hi, I'm playing with taproot scripts via
tapscript
and bumped into this blocker when trying to send raw transaction on Bitcoin Signet viabitcoin-cli -signet sendrawtransaction
:Here is the code I'm using:
Is there anything wrong with how
get_pubkey
derives public key? Or any other reason I might be getting this strange error? Thanks!