Bitcoin

Bitcoin Cash – Generate P2SH-P2WPKH address with Hash160 in script and unlock script for BCH

We used the script’s hash160 (OP_0 hash160OfPubkey) to create a Pay-to-Script-Hash nested within Bitcoin Cash’s Pay-to-Witness-Public-Key-Hash (P2SH-P2WPKH) address. If you try to spend with BCH from this address, you will receive the following error message:

mandatory-script-verify-flag-failed (Script evaluated without error but finished with a false/empty top stack element) (code 16)

Can someone help me understand what unlock script I need to use to spend from my P2SH address in Bitcoin Cash? Currently the unlock script (signature publicKey) works for Bitcoin, but I’m not sure about BCH.

I would appreciate any insight or examples of BCH compatible unlock scripts for these P2SH addresses. thank you!

Related Articles

Back to top button