Closed roman-mc closed 2 years ago
Check out how P2SH works in detail: https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki
(btw you should likely just use p2wsh or p2tr since those are the more modern formats)
Issues with your script at a glance:
Thank you @Roasbeef for informative answer
btw you should likely just use p2wsh
Probably you are right, are there examples of p2wsh? 🙂 Or the link you attached is for p2wsh too?
Here's an example: https://github.com/lightningnetwork/lnd/blob/master/input/script_utils.go#L325-L351
In this case, this method would be used for signing: https://pkg.go.dev/github.com/btcsuite/btcd/txscript#RawTxInWitnessSignature
I have a trouble with forming and signing P2SH transaction. I have no trouble with signing P2PKH, only with P2SH
After evaluating the script (vm.Execute) I get error "false stack entry at end of script execution"
So the code is: