<p>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.</p>
<p>If you've heard about &quot;wrapping&quot; P2PKH in P2SH, that might mean using the P2PKH <em>script</em> (<code>OP_DUP OP_HASH160 &lt;public_key_hash&gt; OP_EQUALVERIFY OP_CHECKSIG</code>) as a P2SH redeem script instead of a bare output script (<a href="https://mempool.space/tx/677875fcb09e4bc773834133cabe06dc2f1ab5030f4bd722322f106ee24eb38e" rel="nofollow noreferrer">example transaction</a>). 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 (<a href="https://mempool.space/tx/3354d2797a005e70e862cbe79602ee8747d4a1ee00b952a54733cc0b64778738" rel="nofollow noreferrer">example transaction</a>), but again, not useful.</p>

CC BY-SA 4.0
2024-06-11T18:31:55.717Z
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.
Pieter Wuille
CC BY-SA 4.0
2024-06-11T18:30:04.177Z
2024-06-11T19:08:33.777Z
2024-06-11T19:08:33.777Z
Vojtěch Strnad
<p>No.</p>
<p>Outputs must always be spent according to the corresponding input type. Anything else would require a hardfork to introduce.</p>

CC BY-SA 4.0
2024-06-11T18:19:50.077Z
2024-06-11T18:31:53.600Z
2024-06-11T18:31:53.600Z
Pieter Wuille
<p>Is it possible to use a P2TR script-path to spend a legacy P2PKH UTXO? I have heard it is possible to &quot;wrap&quot; a P2PKH transaction with P2SH. Maybe it would be possible to &quot;wrap&quot; 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!</p>

<transactions><script><p2pkh><p2tr><p2sh-p2wpkh>
Can I spend a P2PKH transaction via the script-path of P2TR?
Mike C
# Can I spend a P2PKH transaction via the script-path of P2TR?

(Asked by: username_0 on 2024-06-11)

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!

**Tags:** transactions, script, p2pkh, p2tr, p2sh-p2wpkh


---

## 2 answers

### Answer by username_1 on 2024-06-11. Score: 2

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](https://mempool.space/tx/677875fcb09e4bc773834133cabe06dc2f1ab5030f4bd722322f106ee24eb38e)). 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](https://mempool.space/tx/3354d2797a005e70e862cbe79602ee8747d4a1ee00b952a54733cc0b64778738)), but again, not useful.

> **Comments:**
> **username_2**: 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.  

---

### Answer by username_2 on 2024-06-11. Score: 0

No.

Outputs must always be spent according to the corresponding input type. Anything else would require a hardfork to introduce.


---

