I found some interesting Bitcoin transactions which are not standard P2PK or P2SH as I know. Is it defined in some BIP?
For example address 3EkQ11eacyfodKBRha9aJ8KTPsnSVTvSz8(looks like a P2SH address) has two transactions .
The locking script in transaction "a0291c60be14e035c76801cefd6ca3f8f9198565f283a5754c51601b0e765b25"[transaction A] is
HASH160 [PUSHDATA(20)8f3d4fe30b0d014ffed3acff545c77cd0538411a] EQUAL
The unlocking script in transaction "61d8ace861aaf3de140d894ff32bedf2918719357d6b1d4099f0ed92cee8fcf9" [transaction B] is
PUSHDATA(22)[0014286bba43a72607dbfaec7500008ce1af1334a74d]
This transaction is not locked by requesting a digital signature。Since no one know the data to generate hash 8f3d4fe30b0d014ffed3acff545c77cd0538411a before the second transaction is created.
But if someone monitor this kind of UTXOs, and once there is a new transaction[transaction C] to consume this kind of UTXOs is appeared in Bitcoin network, it create a new transaction [Transaction D] by
1.Copy the input as the transaction C
2.Change the output to his own Bitcoin address
3. Increase the transaction fee (higer than transaction C)
Transaction D is also a valid transaction!
Once the transaction C and transaction D are in miner's memory pool, transaction D may be processed prior to transaction C.
Does this mean some one could steal the Bitcoin?