<p>The proof of work that miners do is a double sha256 hash on 80 bytes of data.</p>

<p>Where do the 80 bytes come from?</p>

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

<p>To wit:</p>

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

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

<p><a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow">More info</a></p>

CC BY-SA 3.0
2014-03-25T17:31:33.163Z
2014-03-25T19:53:36.270Z
2014-03-25T19:53:36.270Z
Martin Redmond
<p>According to the bitcoin wiki, the data used comes from calling getwork.</p>

<blockquote>
  <p>getwork is a JSON-RPC defined at <a href="https://en.bitcoin.it/wiki/Getwork" rel="nofollow">https://en.bitcoin.it/wiki/Getwork</a> as "An RPC method used by a miner to get hashing work to try to solve."</p>
</blockquote>

<p>After reviewing the source here: <a href="https://github.com/bitcoin/bitcoin/blob/142e604184e3ab6dcbe02cebcbe08e5623182b81/src/main.cpp#L3352" rel="nofollow">https://github.com/bitcoin/bitcoin/blob/142e604184e3ab6dcbe02cebcbe08e5623182b81/src/main.cpp#L3352</a> 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.</p>

<p>Where/what is the origin of the data that is being worked on by the bitcoin hashing algorithm?</p>

CC BY-SA 3.0
2014-01-13T22:26:40.673Z
possible duplicate of [What are bitcoin miners really solving?](http://bitcoin.stackexchange.com/questions/8031/what-are-bitcoin-miners-really-solving)
Stéphane Gimenez
CC BY-SA 3.0
2014-01-13T22:33:44.877Z
@StéphaneGimenez - Your answer from the link was informative. However, it merely points out the type of data being solved, and not where it comes from. You state there is data "waiting for inclusion" but give no source as to where that data originates.
Travis J
CC BY-SA 3.0
2014-01-13T22:35:04.450Z
Maybe you should clarify your question then.
Stéphane Gimenez
CC BY-SA 3.0
2014-01-13T22:37:40.177Z
@StéphaneGimenez - Is that a sufficient edit? If not, feel free to make an edit or suggestion for how it would be more clear please. My main curiosity is in the source of the data. Your answer seems to imply a majority of it is just concatenation of previous hashes. But there is also inclusion of new data - where does that new data originate from?
Travis J
CC BY-SA 3.0
2014-01-13T22:42:38.457Z
All the data comes from peers, new transactions and recent block creations. All this is checked for validity and used generate a new block which must then be completed with the right nonce.
Stéphane Gimenez
CC BY-SA 3.0
2014-01-13T22:47:24.043Z
@StéphaneGimenez - So the entirety of data being hashed by bitcoin is generated by the use of bitcoin? Sorry if this seems naive, I am not trying to badger.
Travis J
CC BY-SA 3.0
2014-01-13T22:50:18.493Z
@TravisJ Yes, that's right. The client monitors the network, checks everything for validity, and determines the current blockchain. It then looks at proposed transactions and sees which are valid. The current blockchain is all that's strictly needed for mining, but miners generally try to include as many valid transactions as they can as well.
David Schwartz
<getwork><raw-data>
What is the origin of the data that the bitcoin algorithm operates on?
Travis J
# What is the origin of the data that the bitcoin algorithm operates on?

(Asked by: username_0 on 2014-01-13)

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?

**Tags:** getwork, raw-data

> **Comments:**
> **username_1**: possible duplicate of [What are bitcoin miners really solving?](http://bitcoin.stackexchange.com/questions/8031/what-are-bitcoin-miners-really-solving)  
> **username_0**: @username_1 - Your answer from the link was informative. However, it merely points out the type of data being solved, and not where it comes from. You state there is data "waiting for inclusion" but give no source as to where that data originates.  
> **username_1**: Maybe you should clarify your question then.  
> **username_0**: @username_1 - Is that a sufficient edit? If not, feel free to make an edit or suggestion for how it would be more clear please. My main curiosity is in the source of the data. Your answer seems to imply a majority of it is just concatenation of previous hashes. But there is also inclusion of new data - where does that new data originate from?  
> **username_1**: All the data comes from peers, new transactions and recent block creations. All this is checked for validity and used generate a new block which must then be completed with the right nonce.  
> **username_0**: @username_1 - So the entirety of data being hashed by bitcoin is generated by the use of bitcoin? Sorry if this seems naive, I am not trying to badger.  
> **username_2**: @username_0 Yes, that's right. The client monitors the network, checks everything for validity, and determines the current blockchain. It then looks at proposed transactions and sees which are valid. The current blockchain is all that's strictly needed for mining, but miners generally try to include as many valid transactions as they can as well.  

---

## 1 answers

### Answer by username_3 on 2014-03-25. Score: 1

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](https://en.bitcoin.it/wiki/Block_hashing_algorithm)


---

