# Near preimages, applicable to Bitcoin?

Bitcoin mining relies on generating a smaller hash than the so-called target (a function of the so-called difficultly), thus is vulnerable to a truncated preimage attack (you just need to obtain a certain number of leading zeroes).

I believe this is called a near preimage attack.

What is the current status of attacking truncated second preimages of SHA-256?

• Actually, Bitcoin mining seems closer to requiring to find $X$ such that $\text{SHA-256}(\text{SHA-256}(X))<\text{target}$ (I have the details fuzzy); so the function to attack is not $\text{SHA-256}$, but rather $\text{SHA-256}^2$. In any case, I know no attack, even theoretical, on even (full) $\text{SHA-256}$. – fgrieu Mar 27 '14 at 7:41
• Often referred to as SHA-256d – Cryptographeur Mar 27 '14 at 10:01
• As far as I know, bitcoin mining is pretty much a brute-force effort: Try out different combinations, e.g. starting at a random value and then increment by $1$, so that you don't cover numbers that someone else already checked. There is no cryptanalysis done, or any kind of advanced attack technique. – tylo Mar 27 '14 at 14:29
• @tylo I think the question was whether cryptanalysis techniques existed to improve upon brute force and thereby defeat the Bitcoin proof-of-work scheme. – Thomas Mar 28 '14 at 13:32