How to spend P2WSH address with full redem script and witness program?
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.
Top Answer/Comment:
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.
상단 광고의 [X] 버튼을 누르면 내용이 보입니다