I am trying to sign a raw transaction that spends output #2 (txindex 1) from this transaction:
The output is a 1-of-4 multisig P2SH and I think I may have a mistake in the transaction structure used to generate the signature. The signature I calculate is different (as in cryptographically different) to the one that bitcoin core gives me using signrawtransaction.
As I see it this is the transaction structure which must be signed:
TxIn: 01 bdec74e1a37efc77324bb81d2375c5af090ca02debedb7af18fa1e85756d7c26 01000000
subScript: 17 a9 14 37fe3f20433380be4c742c978d3a9712c509656e 87
The double-sha256 value used to calculate the signature is
But the Bitcoin network rejects my transaction calculated from this transaction structure.
I will happily provide more information such as redeemScript and pubKeys/privateKeys if the mistake should not be in the transaction structure.
Any help is appreciated! Thanks!