witness knowledge – How can I inform from the `getrawtransaction` if a transaction signaled Taproot?

0
51


  1. It’s nonetheless not clear to me what tx model quantity a Taproot transaction makes use of.

Any transaction model quantity can have Taproot inputs or outputs.

  1. Is there a option to know through the ins (through getrawtransaction RPC name) if it is a TPR transaction?

There is no such thing as a such factor as a “Taproot transaction”; there are Taproot outputs and Taproot inputs. Transactions can freely combine Taproot inputs with different inputs, and Taproot outputs with different outputs.

Taproot outputs could be acknowledged by having a scriptPubKey consisting of OP_1 adopted by a 32-byte push.

Taproot inputs are outlined as simply inputs that spend taproot outputs. It’s for now potential to acknowledge them simply based mostly on enter knowledge, although this isn’t assured to stay potential with future upgrades:

  • If an enter has precisely one witness stack merchandise (after eradicating the non-obligatory annex, if any), it’s both a Taproot key path spend, or an odd zero-input P2WSH spend.
  • If an enter has two or extra witness stack objects (after eradicating the non-obligatory annex, if any), and the final merchandise of these begins with byte 0xc0 or 0xc1, it’s a BIP342 taproot script path spend (such an enter can’t presumably be a P2WPKH spend because the prefix bytes are usually not legitimate public key header bytes, and never P2WSH spends, as a result of these prefix bytes are invalid in script).

LEAVE A REPLY

Please enter your comment!
Please enter your name here