Skip to content

Bitcoin accepted at checkout  |  Ships from Laval, QC, Canada  |  Expert support since 2016

Double SHA-256

Advanced Mining Basics

Also known as: hash256, dSHA-256

Definition

Double SHA-256 is the practice of running the SHA-256 hash function twice in a row over the same data — hashing the input, then hashing that result again. Bitcoin uses it everywhere proof-of-work matters: the block header, the coinbase transaction, and every step up the merkle tree.

Also known as: SHA-256d, sha256d, or simply “double-hash” (the “DHASH” you may see in mining hardware documentation).

Why hash twice instead of once?

A single pass would be SHA-256(data). Double SHA-256 is SHA-256(SHA-256(data)) — feed the 32-byte output of the first round back in as the input to the second. Bitcoin’s design applies this construction to block headers and transaction hashing as a defensive measure: hashing the digest a second time guards against a class of length-extension weakness in the underlying SHA-256 algorithm and adds a margin of safety without changing the security model. The result is still a 256-bit number, and that number is what miners compare against the target.

In proof-of-work, finding a valid block means discovering a nonce that makes the double-SHA-256 of the 80-byte block header come out at or below the target. Because the output is effectively random, the only way to find such a value is to try billions of nonces — which is exactly the brute-force search a mining rig performs.

Where it shows up in a block

Double SHA-256 is not used only on the header. When a pool builds work, it concatenates the coinbase pieces (coinbase_1 + extranonce1 + extranonce2 + coinbase_2) and double-hashes the whole thing to get the coinbase transaction hash. It then walks the merkle root: at each level it joins the current hash with a branch and double-hashes again, repeating up the tree until a single 32-byte root remains. That root is dropped into the header alongside the version, the previous block hash, the timestamp, and the compact difficulty bits, and the header itself is then double-hashed during the nonce search. So one block can involve thousands of double-SHA-256 operations before the final, ranking-determining hash is even attempted.

What this means for your ASIC at home

Every ASIC chip — from a single Bitaxe on your desk to a full hashboard stacked with chips — is purpose-built silicon that does one thing: double-SHA-256 the block header as fast as physics and power allow. Your hashrate, measured in terahashes per second, is literally a count of how many of these double-hash attempts the hardware completes each second.

There is a clever optimization worth understanding if you tune miners. SHA-256 chews through data in 64-byte chunks, and the first 64 bytes of the 80-byte header (the version, previous block hash, and the first 28 bytes of the merkle root) stay constant for a given job. So the controller pre-computes the SHA-256 internal state after that first chunk — the midstate — and ships only that plus the remaining 16 bytes to the chip. The ASIC then only has to finish the last block of the first hash and run the full second hash as it sweeps the nonce. When overclocking or undervolting, a chip that returns a nonce whose double-SHA-256 does not actually meet the target is reporting a hardware error — a useful signal that you have pushed frequency too high or voltage too low for stable operation.

This is also why mining is honest: a pool (or your own node in solo mining) can re-run the same double-SHA-256 in a millisecond to confirm your claimed share is real. Hashing is expensive to produce and trivial to verify — the asymmetry that lets a decentralized network trust math instead of gatekeepers. If you want to watch this in action on hardware you can actually inspect, the open silicon collected in the Bitaxe hub is the most transparent place to start, and the lineup at our miners directory shows the larger machines built on the same primitive.

Related terms: SHA-256, Proof of Work, Block Header, Merkle Root, Target, Hash

In Simple Terms

Applying SHA-256 twice in sequence, the specific hashing method Bitcoin uses for block mining.

Double SHA-256 is the practice of running the SHA-256 hash function twice in a row over the same data — hashing the input, then hashing that result again. Bitcoin uses it everywhere proof-of-work matters: the block header, the coinbase transaction, and every step up the merkle tree.

Also known as: SHA-256d, sha256d, or simply "double-hash" (the "DHASH" you may see in mining hardware documentation).

Why hash twice instead of once?

A single pass would be SHA-256(data). Double SHA-256 is SHA-256(SHA-256(data)) — feed the 32-byte output of the first round back in as the input to the second. Bitcoin's design applies this construction to block headers and transaction hashing as a defensive measure: hashing the digest a second time guards against a class of length-extension weakness in the underlying SHA-256 algorithm and adds a margin of safety without changing the security model. The result is still a 256-bit number, and that number is what miners compare against the target.

In proof-of-work, finding a valid block means discovering a nonce that makes the double-SHA-256 of the 80-byte block header come out at or below the target. Because the output is effectively random, the only way to find such a value is to try billions of nonces — which is exactly the brute-force search a mining rig performs.

Where it shows up in a block

Double SHA-256 is not used only on the header. When a pool builds work, it concatenates the coinbase pieces (coinbase_1 + extranonce1 + extranonce2 + coinbase_2) and double-hashes the whole thing to get the coinbase transaction hash. It then walks the merkle root: at each level it joins the current hash with a branch and double-hashes again, repeating up the tree until a single 32-byte root remains. That root is dropped into the header alongside the version, the previous block hash, the timestamp, and the compact difficulty bits, and the header itself is then double-hashed during the nonce search. So one block can involve thousands of double-SHA-256 operations before the final, ranking-determining hash is even attempted.

What this means for your ASIC at home

Every ASIC chip — from a single Bitaxe on your desk to a full hashboard stacked with chips — is purpose-built silicon that does one thing: double-SHA-256 the block header as fast as physics and power allow. Your hashrate, measured in terahashes per second, is literally a count of how many of these double-hash attempts the hardware completes each second.

There is a clever optimization worth understanding if you tune miners. SHA-256 chews through data in 64-byte chunks, and the first 64 bytes of the 80-byte header (the version, previous block hash, and the first 28 bytes of the merkle root) stay constant for a given job. So the controller pre-computes the SHA-256 internal state after that first chunk — the midstate — and ships only that plus the remaining 16 bytes to the chip. The ASIC then only has to finish the last block of the first hash and run the full second hash as it sweeps the nonce. When overclocking or undervolting, a chip that returns a nonce whose double-SHA-256 does not actually meet the target is reporting a hardware error — a useful signal that you have pushed frequency too high or voltage too low for stable operation.

This is also why mining is honest: a pool (or your own node in solo mining) can re-run the same double-SHA-256 in a millisecond to confirm your claimed share is real. Hashing is expensive to produce and trivial to verify — the asymmetry that lets a decentralized network trust math instead of gatekeepers. If you want to watch this in action on hardware you can actually inspect, the open silicon collected in the Bitaxe hub is the most transparent place to start, and the lineup at our miners directory shows the larger machines built on the same primitive.

Related terms: SHA-256, Proof of Work, Block Header, Merkle Root, Target, Hash

Explore the Full Glossary

Browse all Bitcoin mining terms from A to Z. Whether you are a beginner or expert, deepen your understanding of the mining ecosystem.

Mining Glossary

ASIC Miner Database

Compare 500+ miners with real-time profitability data, home mining scores, and detailed specs.

Compare Miners