0
Maybe my question is stupid, but
imagine that I'm trying to spend inputs from p2sh.
For example, p2sh scriptPubKey looks like:
OP_SHA256 4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a OP_EQUAL
I know, that the SHA256(0x01) = 4bf5122f...85459a (hacker do not know that, until I broadcast tx)
So I broadcast transaction with the folowing scriptsig:
OP_1 (0x51)
Why hacker can't take this unconfirmed transaction, extract scriptsig, and replace outputs to his own outputs ?
Also, what to do, if RBF (replace-by-fee) flag is set?
Of course, I'm not talking about transactions with OP_CHECKSIG
Just to be technically correct, a
– JBaczuk – 2018-12-17T15:30:33.307P2SHscriptPubKeyis actuallyOP_HASH160 <scriptHash> OP_EQUAL`, see https://en.bitcoin.it/wiki/Transaction#Pay-to-Script-HashYes, thank you. Is there any diff with HASH160, or problem the same ? – Andrew – 2018-12-17T15:37:28.630
It's not really relevant to the question, just for correctness. – JBaczuk – 2018-12-17T15:49:31.410