<p>1) Yes, it is correct.</p>

<p>2) It is deprecated. Generally, it is used to write the result of the mining over to be sent to the pool. This is to ensure the result is of correct length and adheres to some rules. In practice, it is always the same trailing string of numbers.</p>

CC BY-SA 3.0
2012-10-11T13:28:09.360Z
So the hash1 value itself is never actually used? It just serves as a formatting template?
ConstableJoe
CC BY-SA 3.0
2012-10-11T13:46:18.417Z
@ConstableJoe Well, it's not used for any calculations, it is deprecated in general and eventually it will be left out of the getwork protocol.
ThePiachu
CC BY-SA 3.0
2012-10-12T03:57:38.807Z
Interesting. Seems pretty useless, unless I'm missing something.
ConstableJoe
CC BY-SA 3.0
2012-10-11T07:04:57.350Z
2012-10-11T07:04:57.350Z
ThePiachu
<p>The first answer <a href="https://crypto.stackexchange.com/questions/1862/sha-256-midstate">here</a> does a good job explaining how the SHA-256 function requires more than one input (an initial one is specified by to the SHA-256 specs). As far as I understand it, the "midstate" value is the initial hash of the first half of the data, used to later serve as an input into the double-hash of the second half of the data.</p>

<p>Is this correct?</p>

<p>And <a href="https://bitcoin.stackexchange.com/questions/2906/in-getwork-how-does-one-calculate-the-value-of-hash1">here</a> is an explanation of what the "hash1" value actually is and means, but what is it used for?</p>

CC BY-SA 3.0
2015-03-27T04:15:54.990Z
What do you mean by "half" here? If `b=SHA(a=SHA(data))`, a = "initial hash" and b = "second half"? So, `a` is the midstate?
Geremia
CC BY-SA 3.0
2015-06-11T06:21:12.410Z
[This](https://crypto.stackexchange.com/a/1884/6733) defines midstate well; it's "the contents of the 'state' after having processed the first [SHA256] block." Thus, it's not `a` in `b=SHA(a=SHA(data))` if `data` is longer than one SHA256 block (64 bytes). Isn't the Bitcoin block header 80 bytes?
Geremia
<api><mining-technical-details><getwork>
What are midstate and hash1 used for in mining?
ConstableJoe
# What are midstate and hash1 used for in mining?

(Asked by: username_0 on 2012-10-10)

The first answer [here](https://crypto.stackexchange.com/questions/1862/sha-256-midstate) does a good job explaining how the SHA-256 function requires more than one input (an initial one is specified by to the SHA-256 specs). As far as I understand it, the "midstate" value is the initial hash of the first half of the data, used to later serve as an input into the double-hash of the second half of the data.

Is this correct?

And [here](https://bitcoin.stackexchange.com/questions/2906/in-getwork-how-does-one-calculate-the-value-of-hash1) is an explanation of what the "hash1" value actually is and means, but what is it used for?

**Tags:** api, mining-technical-details, getwork

> **Comments:**
> **username_1**: What do you mean by "half" here? If `b=SHA(a=SHA(data))`, a = "initial hash" and b = "second half"? So, `a` is the midstate?  
> **username_1**: [This](https://crypto.stackexchange.com/a/1884/6733) defines midstate well; it's "the contents of the 'state' after having processed the first [SHA256] block." Thus, it's not `a` in `b=SHA(a=SHA(data))` if `data` is longer than one SHA256 block (64 bytes). Isn't the Bitcoin block header 80 bytes?  

---

## 1 answers

### Answer by username_2 on 2012-10-11. Score: 2 | Accepted answer

1) Yes, it is correct.

2) It is deprecated. Generally, it is used to write the result of the mining over to be sent to the pool. This is to ensure the result is of correct length and adheres to some rules. In practice, it is always the same trailing string of numbers.

> **Comments:**
> **username_0**: So the hash1 value itself is never actually used? It just serves as a formatting template?  
> **username_2**: @username_0 Well, it's not used for any calculations, it is deprecated in general and eventually it will be left out of the getwork protocol.  
> **username_0**: Interesting. Seems pretty useless, unless I'm missing something.  

---

