gmaxwell, you remind that part of me that says "not so fast..." to "of course..." statements. You are thoughtful; thanks for your help and insight!
I'm not seeing how OP_CAT (at least by itself) facilitates any of the high level examples there. Can you give me a specific protocol and set of scripts to show me how it would work?
I am simultaneously to prove that I need OP_CAT and trying to find a way to do without it. I guess I can't have it both ways.
In very very short, it involved verifying that hash(salt+data) indeed equals [suchhash]. Providing salt and data, the script can confirm hash(salt), hash(data) and hash(salt+data) and validates the transaction based of whether the hashes match what was claimed. However, I think I found a way around that, which will involve more never-broadcasted transaction and more multsig addresses. etc. i.e. the process is more complex and exhaustive, but I think the OPs available allows an alternative implementation.
As I fell like I'm finding my way toward "a solution without OP_CAT", the next biggest wall seems to be: Even if I can make scripts that do exactly what I want, will the network accept and broadcast them?
I am about to start experimenting on testnet, but even if it works on testnet, that doesn't tell me if it is going to work on the mainnet.
The OP_CAT would indeed simplify the process of what I am thinking of, but it seems that the main scenarios would be resolved, i.e. I wouldn't "need" OP_CAT, even though it would have made it easier.
One of the protocol is about two parties escrowing money for future instant payments, i.e. off-net renegotiation of the balances. An extended version could allow decentralised banking for Bitcoin. (isn't that what Bitcoin IS?) Yes, but I am talking about instant proof/guarantee of receiving a minimum of n confirmations, after escrow/deposits are placed.
It seems that it would only require one non-standard script, which would look like this:
inputs: pubkey signature secret
OP_DUP
OP_EQUAL
OP_IF OP_ELSE OP_EQUALVERIF OP_ENDIF
OP_ROT OP_CHECKSIGVERIFY OP_SWAP OP_HASH160 OP_EQUAL
As it is, this would allow either of two party to claim the output if they can provide the other's party secret, secret which hash to the hardcoded hashA or hashB, depending of who is signing.
(How is that useful is part of a bigger picture that I will talk about later in another thread.)
This script is untested and incomplete; I also needs to allow both signatures to validate the transaction.
So the question is now: should I bother testing that on testnet or is it doomed because the network wouldn't like it, e.g. too many nodes not broadcasting unknown, strange and/or non-standard transactions?