<p>This is P2PKH nested inside P2WSH. What you provide is just witness script. To spend P2WSH transaction, you also need to provide witness items(varying upon witness script), which can fulfill the condition of witness script. It's not enough even if witness script matches witness program, as witness script will be executed when matches.</p>
<p>For P2PKH nested inside P2WSH, you need to provide valid signature and public key(from secp256k1) as well as witness script in the order of <code>&lt;signature&gt; &lt;public key&gt; &lt;witness scipt&gt;</code> at witness items. Public key must be digested into <code>b1217062623d9101426f61593cb1abc3e44ed004</code> when OP_HASH160, and its private key must generates signature which can be verified with public key when sign transaction appropriately. What you need to provide mostly same with P2PKH but with P2PKH script as witness script.</p>

CC BY-SA 4.0
2024-06-05T03:11:46.153Z
2024-06-05T03:11:46.153Z
Hyunhum Cho
<p>I just put few dollar in here.</p>
<p>Bech32 Address: <code>bc1qx6c07u2s6pu6d5ede8ee9hmynahp9edgg764cm58gfxmryk3ryqsxarnnv</code></p>
<p>Witness Script Hex <code>76a914b1217062623d9101426f61593cb1abc3e44ed00488ac</code></p>
<p>Witness Script Asm
<code>OP_DUP OP_HASH160 14&lt;b1217062623d9101426f61593cb1abc3e44ed004&gt; OP_EQUALVERIFY OP_CHECKSIG</code></p>
<p>Witness Version 0</p>
<p>Witness Program <code>36b0ff7150d079a6d32dc9f392df649f6e12e5a847b55c6e87424db192d11901</code></p>
<p>ScriptPubKey Hex    <code>002036b0ff7150d079a6d32dc9f392df649f6e12e5a847b55c6e87424db192d11901</code></p>
<p>ScriptPubKey Asm <code>OP_0 20&lt;36b0ff7150d079a6d32dc9f392df649f6e12e5a847b55c6e87424db192d11901&gt;</code></p>
<p>show me how to spend this, feel free if you want to just take the fund of it, i do this for educational for security building P2WSH address from P2SH redemscript hash160.</p>

CC BY-SA 4.0
2023-09-05T18:07:04.083Z
That is not P2TR as it as a witness version of 0. P2TR is witness version 1. It appears to be a P2PKH nested inside of a P2WSH.
Ava Chow
CC BY-SA 4.0
2023-09-05T19:11:51.477Z
Perhaps this sort of testing would be better directed at Testnet or Signet?
Murch
CC BY-SA 4.0
2023-09-06T00:49:53.083Z
sorry, i was missspell the type of Addresses, yes it's P2PKH nested inside of a P2WSH
Tepan
CC BY-SA 4.0
2023-09-06T00:51:15.770Z
i make the address for mainnet.
Tepan
<transactions><unconfirmed-transactions><p2sh><p2pkh><p2wsh>
How to spend P2WSH address with full redem script and witness program?
Tepan
# How to spend P2WSH address with full redem script and witness program?

(Asked by: username_0 on 2023-09-04)

I just put few dollar in here.

Bech32 Address: `bc1qx6c07u2s6pu6d5ede8ee9hmynahp9edgg764cm58gfxmryk3ryqsxarnnv`

Witness Script Hex `76a914b1217062623d9101426f61593cb1abc3e44ed00488ac`

Witness Script Asm
`OP_DUP OP_HASH160 14<b1217062623d9101426f61593cb1abc3e44ed004> OP_EQUALVERIFY OP_CHECKSIG`

Witness Version 0

Witness Program `36b0ff7150d079a6d32dc9f392df649f6e12e5a847b55c6e87424db192d11901`

ScriptPubKey Hex `002036b0ff7150d079a6d32dc9f392df649f6e12e5a847b55c6e87424db192d11901`

ScriptPubKey Asm `OP_0 20<36b0ff7150d079a6d32dc9f392df649f6e12e5a847b55c6e87424db192d11901>`

show me how to spend this, feel free if you want to just take the fund of it, i do this for educational for security building P2WSH address from P2SH redemscript hash160.

**Tags:** transactions, unconfirmed-transactions, p2sh, p2pkh, p2wsh

> **Comments:**
> **username_1**: That is not P2TR as it as a witness version of 0. P2TR is witness version 1. It appears to be a P2PKH nested inside of a P2WSH.  
> **username_2**: Perhaps this sort of testing would be better directed at Testnet or Signet?  
> **username_0**: sorry, i was missspell the type of Addresses, yes it's P2PKH nested inside of a P2WSH  
> **username_0**: i make the address for mainnet.  

---

## 1 answers

### Answer by username_3 on 2024-06-05. Score: 0

This is P2PKH nested inside P2WSH. What you provide is just witness script. To spend P2WSH transaction, you also need to provide witness items(varying upon witness script), which can fulfill the condition of witness script. It's not enough even if witness script matches witness program, as witness script will be executed when matches.

For P2PKH nested inside P2WSH, you need to provide valid signature and public key(from secp256k1) as well as witness script in the order of `<signature> <public key> <witness scipt>` at witness items. Public key must be digested into `b1217062623d9101426f61593cb1abc3e44ed004` when OP\_HASH160, and its private key must generates signature which can be verified with public key when sign transaction appropriately. What you need to provide mostly same with P2PKH but with P2PKH script as witness script.


---

