Definition
A SHA-256 midstate is the saved internal hash state produced after processing the first 64-byte chunk of a Bitcoin block header. Because SHA-256 ingests data in 512-bit (64-byte) blocks, the 80-byte header splits into a first chunk of 64 bytes and a 16-byte tail. The first chunk - version, previous-block hash, and the first 28 bytes of the Merkle root - never changes while a chip sweeps nonces, so its compression is computed once and the resulting state is reused for every attempt.
What goes in the second chunk
Only the header's tail varies during nonce grinding: the last 4 bytes of the Merkle root, the timestamp, the difficulty bits, and the 4-byte nonce. By caching the midstate, a miner re-runs only the second SHA-256 round per attempt rather than the full two-round computation, roughly halving the work of the first hash pass.
How work is delivered
This is why a job sent to mining chips is not a literal 80-byte header. The control board typically supplies the 32-byte midstate plus the remaining tail fields, and each chip reconstructs the second chunk internally and sweeps its nonce range. The optimization predates ASICs - it was already used in FPGA and getwork-era mining - and remains foundational to how modern hardware is fed work.
The midstate trick depends on the structure described in our Double SHA-256 and Block Header entries.
In Simple Terms
A SHA-256 midstate is the saved internal hash state produced after processing the first 64-byte chunk of a Bitcoin block header. Because SHA-256 ingests data…
