What I am wanting to create is a Bitcoin script that will do the following:
- check <data1> against <sig1>
- check <data2> against <sig2>
then only redeem if both sig checks work but *additionally* I need it to ensure that <data1> is identical to <data2> and that <sig1> is different to <sig2>.
Is this even possible?
If <data1> must be identical to <data2>, then essentially aren't you saying that you require two the following:
- check <data> against <sig1>
- check <data> against <sig2>
Though it seems roundabout, OP_CHECKMULTISIG could potentially be used. If you put <data> in a null output and require 2-of-2 signatures that sign the output, then in effect that would mean <sig1> and <sig2> have to be valid signatures of <data>.
Here's my cursory attempt. The problem with it (in addition to whatever problems I don't see) is that the scriptPubKey doesn't pass the "is_p2sh()" test since it's not "OP_HASH160 <20 bytes> OP_EQUAL". Since I'm not sure how far you're willing to go from Bitcoin in your endeavor, I figure I'll include this anyway.
redeemScript:
2 <sig1Pubkey> <sig2Pubkey> 2 OP_CHECKMULTISIG
scriptSig:
0 <sig1> <sig2> <serializedRedeemScript>
scriptPubKey:
// This part copies <sig1> and <sig2> to the alt stack for later.
2 OP_PICK OP_TOALTSTACK 1 OP_PICK OP_TOALTSTACK
// Normal P2SH stuff.
OP_HASH160 <redeemScriptHash> OP_EQUAL
// Bring <sig1> and <sig2> back from the alt stack. The top stack item will be true if they are not equal.
OP_FROMALTSTACK OP_FROMALTSTACK OP_EQUAL OP_NOT
At any rate, hopefully this will give you some ideas.