Post
Topic
Board Development & Technical Discussion
Re: Is this reward for SHA-1 preimage correctly constructed?
by
pooya87
on 01/08/2021, 05:00:55 UTC
Collision is already taken, I think about preimage.
Since you didn't provide the hash itself and user can choose any inputs (and their hashes) this is not preimage, this is collision.

Quote
Quote
Also the second OP_2DUP needs to be OP_SWAP so that you "swap" the 2 stack items and hash the other item.
Without duplication, that public key would be lost during hashing, so using OP_CHECKSIG later would always evaluate to false.
I was talking about the second duplication which is followed immediately by a drop, OP_2DUP OP_DROP could be replaced by OP_OVER to do the same thing:
x y -(OP_2DUP)-> x y x y -(OP_DROP)-> x y x
x y -(OP_OVER)> x y x

Quote
There is also no need for a OP_CheckSig in a hash collision script.
Without it, any miner could steal coins from the winner. This is not a collision, this is preimage.
[/quote]
OK. That makes sense but it is still a collision but only limited to valid public keys, it would have been preimage if the script contained the hash.