This is what I've wondered too. If you know a given, known input x results in output y -- despite the fact that changing one bit in the input provides a different output -- couldn't this be useful if you know input x resulted in output y which solved a block?
I don't know much about cryptography, but let's say at current difficulty 1,000,000, input x results in output y that would solve a block at difficulty 1,500,000. Knowing this, why couldn't you simply input known x repeatedly to provide output y and solve blocks repeatedly until the difficulty adjusts?
The input isn't just "x" it is made up of 6 components
Version
Previous hash
Merkle root
Timestamp
Difficulty
Nonce
When you solve a block at a minimum the previous hash changes hence no prior inputs will ever be valid again.
https://en.bitcoin.it/wiki/Block_hashing_algorithmAn example might help.
Essentially the header input is just one giant 640 bit input. For example:
Version: 01000000 (version 1)
Previous hash: 81cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000 (from the prior block)
Merkle root: e320b6c2fffc8d750423db8b1eb942ae710e951ed797f7affc8892b0f1fc122b (based on tx in the block)
Timestamp: c7f5d74d (unix time)
Difficulty: f2b9441a (difficulty is a compact bit representation)
Nonce: 42a14695 (a 32bit number. your miner starts at 00000000 and goes to ffffffff before starting on a new header)
So that becomes one giant 640 bit input.
Input:
0100000081cd02ab7e569e8bcd9317e2fe99f2de44d49ab2b8851ba4a308000000000000e320b6c
2fffc8d750423db8b1eb942ae710e951ed797f7affc8892b0f1fc122bc7f5d74df2b9441a42a146
95
Your miner double hashes it.
potential block hash = SHA256(SHA256(input)
Potential Block Hash:
00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d (bitcoin does some weird stuff w/ endianess but lets ignore that)
Now difficulty represents how hard it is to find a block. It is more for us humans the network looks at the inverse of difficulty which is the "target".As difficulty goes up the target gets smaller. To solve a block the block hash must be a 256 bit number which is smaller than the target.
Current Target: 00000000000009AE020000000000000000000000000000000000000000000000
Block Hash: 00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d
This block hash is smaller than the target so it "solves" the block (if and only if all the inputs are still valid - which they aren't).
Actually this block hash is really small. It would be below the target even if difficulty was in the hundred million range.