Is it possible to use a P2TR script-path to spend a legacy P2PKH UTXO? I have heard it is possible to "wrap" a P2PKH transaction with P2SH. Maybe it would be possible to "wrap" the P2PKH transaction, then spend it via script-spend path of P2TR? I don't care how weird, inefficient, or expensive it may be. This is mostly for my benefit to learn more about the Bitcoin protocol, including rare edge cases. I do not care how expensive the transaction would cost-- if it is a valid transaction, I'd like to hear about it. Thank you so much in advance!
2 Answers
The ways in which you can spend a UTXO are limited to what its output script allows, constructions available for other types of scripts are not transferable. So no, you can't spend a P2PKH UTXO using P2TR rules.
If you've heard about "wrapping" P2PKH in P2SH, that might mean using the P2PKH script (OP_DUP OP_HASH160 <public_key_hash> OP_EQUALVERIFY OP_CHECKSIG
) as a P2SH redeem script instead of a bare output script (example transaction). This is possible, but not useful, since there's no reason to hash the key and not use it directly. You can do the same with script-path P2TR (example transaction), but again, not useful.
-
The wrapping isn't just useless in this case, but irrelevant, as it's something that has to be decided before the output is created. Commented Jun 11 at 18:31
No.
Outputs must always be spent according to the corresponding input type. Anything else would require a hardfork to introduce.