What is the origin of the data that the bitcoin algorithm operates on? According to the bitcoin wiki, the data used comes from calling getwork.


  getwork is a JSON-RPC defined at https://en.bitcoin.it/wiki/Getwork as "An RPC method used by a miner to get hashing work to try to solve."


After reviewing the source here: https://github.com/bitcoin/bitcoin/blob/142e604184e3ab6dcbe02cebcbe08e5623182b81/src/main.cpp#L3352 I was unable to determine the code for the GetWork method. I am mostly curious about the source of the data though. Although the bitcoin system is said to be entirely transparent, it seems to skimp on information regarding the data used.

Where/what is the origin of the data that is being worked on by the bitcoin hashing algorithm?
The proof of work that miners do is a double sha256 hash on 80 bytes of data.

Where do the 80 bytes come from?

They are build from enough data to describe the current block (and the transactions it contains) and a pointer to the previous block.

To wit:


4 bytes version number
32 bytes hash of the previous block
32 bytes Merkle root of all the transactions contained in this block
4 bytes timestamp
4 bytes current difficulty target
4 bytes nonce


These 80 bytes are concatenated and have the shit sha'd out of them until the required difficult is reached.

More info