<blockquote>
  <p>What is the auhoritative source for providing hash of previous block?
  or do miners keep listening to latest blocks?</p>
</blockquote>

<p>There's no authoritative source, that's the whole point of Bitcoin. Miners keep listening for latest blocks, yes. They decide for themselves which block to accept. And since all miners (and clients) are programmed to accept only valid blocks (where its header hash is equal or below than the current target) they soon reach consensus upon which blocks are valid.</p>

<blockquote>
  <p>One more question: nonce size is only 4 bytes(32 bits). Given version,
  previousBlockHash, hashMerkleRoot, bits are constant, would not it be
  very easy to iterate through all possible nonces? 2^32 = 4 gigs = 4
  gig hash machine can finish this task in one second.</p>
</blockquote>

<p>More often than not, just that 4 byte nonce is not enough randomness to find a block. Miners constantly add new transactions - therefore the <code>hashMerkleRoot</code> isn't really constant.</p>

<p>Also I think there's an <code>extranonce</code> field which adds more space.</p>

CC BY-SA 3.0
2013-11-17T11:06:24.760Z
You cannot create a block with no transactions at all. Every block needs a coinbase transaction which claims fees and subsidy for the miner. Because of that, the merkle root can never be emoty. Also, it is inside this transaction that the extraNonce is located, so it affects the block header through the merkle root.
Pieter Wuille
CC BY-SA 3.0
2013-11-17T12:01:14.623Z
@PieterWuille thanks I removed that part of my answer. Perhaps you can answer more specifically on the issue of the transactions as I also wasn't aware of it.
Luca Matteis
CC BY-SA 3.0
2013-11-26T16:01:20.763Z
@PeterWuille Could you please point me to any documentation about extraNonce and generating MerkleRoot.
Htaras
CC BY-SA 3.0
2014-06-27T02:06:45.247Z
@Htaras the extranonce is documented here:
https://en.bitcoin.it/wiki/Transactions#Generation

Miners also tend to play with the block time to add extra randomness, especially in pool mining. This is one of the reasons block times are a little all over the place.
Matthieu
CC BY-SA 3.0
2013-11-17T10:54:56.580Z
2013-11-17T12:00:48.200Z
2013-11-17T12:00:48.200Z
Luca Matteis
<p>Referencing the <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow">Bitcoin wiki</a>, what is the auhoritative source for providing a hash of the previous block? Or do miners keep listening to latest blocks?</p>

<p>How is <a href="https://en.wikipedia.org/wiki/Merkle_signature_scheme" rel="nofollow">hash of the Merkle root</a> generated? </p>

<p>Can a miner generate a block with no transactions? That means generating block by keeping hash Merkle root as all 0s. </p>

<p>One more question: 
nonce size is only four bytes (32 bits). Given version, previousBlockHash, hashMerkleRoot, bits are constant, would it not be very easy to iterate through all possible nonces?</p>

<p>2^32 = 4 G = 4&nbsp;G hash machine can finish this task in one second.</p>

CC BY-SA 3.0
2016-03-31T16:17:45.953Z
-1 Please ask only about one topic per question post.
Murch
<mining-technical-details><nonce><block-header><merkle-tree><empty-blocks>
Bitcoin block hashing algorithm. nonce
Htaras
# Bitcoin block hashing algorithm. nonce

(Asked by: username_0 on 2013-11-17)

Referencing the [Bitcoin wiki](https://en.bitcoin.it/wiki/Block_hashing_algorithm), what is the auhoritative source for providing a hash of the previous block? Or do miners keep listening to latest blocks?

How is [hash of the Merkle root](https://en.wikipedia.org/wiki/Merkle_signature_scheme) generated?

Can a miner generate a block with no transactions? That means generating block by keeping hash Merkle root as all 0s.

One more question:
nonce size is only four bytes (32 bits). Given version, previousBlockHash, hashMerkleRoot, bits are constant, would it not be very easy to iterate through all possible nonces?

2^32 = 4 G = 4 G hash machine can finish this task in one second.

**Tags:** mining-technical-details, nonce, block-header, merkle-tree, empty-blocks

> **Comments:**
> **username_1**: -1 Please ask only about one topic per question post.  

---

## 1 answers

### Answer by username_2 on 2013-11-17. Score: 1 | Accepted answer

> What is the auhoritative source for providing hash of previous block?
> or do miners keep listening to latest blocks?

There's no authoritative source, that's the whole point of Bitcoin. Miners keep listening for latest blocks, yes. They decide for themselves which block to accept. And since all miners (and clients) are programmed to accept only valid blocks (where its header hash is equal or below than the current target) they soon reach consensus upon which blocks are valid.

> One more question: nonce size is only 4 bytes(32 bits). Given version,
> previousBlockHash, hashMerkleRoot, bits are constant, would not it be
> very easy to iterate through all possible nonces? 2^32 = 4 gigs = 4
> gig hash machine can finish this task in one second.

More often than not, just that 4 byte nonce is not enough randomness to find a block. Miners constantly add new transactions - therefore the `hashMerkleRoot` isn't really constant.

Also I think there's an `extranonce` field which adds more space.

> **Comments:**
> **username_3**: You cannot create a block with no transactions at all. Every block needs a coinbase transaction which claims fees and subsidy for the miner. Because of that, the merkle root can never be emoty. Also, it is inside this transaction that the extraNonce is located, so it affects the block header through the merkle root.  
> **username_2**: @username_3 thanks I removed that part of my answer. Perhaps you can answer more specifically on the issue of the transactions as I also wasn't aware of it.  
> **username_0**: @PeterWuille Could you please point me to any documentation about extraNonce and generating MerkleRoot.  
> **username_4**: @username_0 the extranonce is documented here: https://en.bitcoin.it/wiki/Transactions#Generation  Miners also tend to play with the block time to add extra randomness, especially in pool mining. This is one of the reasons block times are a little all over the place.  

---

