<blockquote>
<p>Moreover, the hash function creates something like a 32byte number might be using SHA256. So, I want to know who creates random numbers? and how nodes do guessing?</p>
</blockquote>
<p>It's a 32-bit number. There are only 2^32 possible values for a 32-bit number, about 4 billion, and realistic bitcoin mining hardware attempts trillions of hashes per second. So miners are just designed to try all of them which typically takes much less than a second.</p>
<p>Of course, the odds of any of them producing a valid block are very close to zero, given that only one miner succeeds on average every ten minutes. So the vast majority of blocks that miners attempt to mine turn out to be unmineable and the miner must try all 2^32 possibilities on a different block.</p>

CC BY-SA 4.0
2020-12-03T16:19:06.307Z
2020-12-03T16:19:06.307Z
David Schwartz
<blockquote>
<p>I want to know who creates random numbers?</p>
</blockquote>
<p>Nobody.</p>
<blockquote>
<p>and how nodes do guessing?</p>
</blockquote>
<p>Mining nodes do this by constructing a block, hashing it and seeing if the hash is less than the target. If not, they retry constructing another block with small variations in contents.</p>
<blockquote>
<p>Please let me know if my concept is wrong.</p>
</blockquote>
<p>Your concept is wrong. Ordinary nodes don't create and broadcast suggestions for blocks. The mining process could better be described as trial and error, it can be deterministic rather than random.</p>

CC BY-SA 4.0
2020-12-03T14:11:43.160Z
2020-12-03T14:16:44.807Z
2020-12-03T14:16:44.807Z
RedGrittyBrick
<p>I believe your answer (and more) can be found here:</p>
<p><strong>Book</strong>: Mastering Bitcoin; <strong>Chapter 10</strong>: 'Mining and Consensus'; <strong>Section</strong>: <a href="https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch10.asciidoc#successfully-mining-the-block" rel="nofollow noreferrer">Successfully Mining The Block</a></p>
<p><strong>Snippet</strong>:</p>
<blockquote>
<p>Next, the mining node [...] transmits the block header to his mining
hardware, which starts testing trillions of nonces per second. Because
the nonce is only 32 bits, after exhausting all the nonce
possibilities (about 4 billion), the mining hardware changes the block
header (adjusting the coinbase extra nonce space or timestamp) and
resets the nonce counter, testing new combinations.</p>
</blockquote>

CC BY-SA 4.0
2020-12-04T13:07:10.530Z
2020-12-04T13:07:10.530Z
Vlad Stan
<p>I searched for a lot. Previous answers on the bitcoin stack exchange did not answer my question.</p>
<p>Well, According to my research, Any node can collect a set up <strong>unconfirmed transactions</strong> into a block and <strong>broadcast</strong> to the rest of the network as a suggestion for what the <strong>next block</strong> in the chain should be, by solving the <strong>cryptographic hash</strong> by <strong>random guesses</strong>. Moreover, the <strong>hash function</strong> creates something like a <strong>32byte number</strong> might be using <strong>SHA256</strong>. So, I want to know who creates random numbers? and how nodes do guessing?</p>
<p>Please let me know if my concept is wrong. I will appreciate your guidance. Thanks</p>

CC BY-SA 4.0
2020-12-03T13:54:50.917Z
@RedGrittyBrick I just need the answer to my question. Don't need extra information that how algorithms work.
Haider Yaqoob
<bitcoin-core><blockchain><bitcoind><blockchain.info>
How nodes solve cryptographic hash by random guesses in bitcoin network
Haider Yaqoob
# How nodes solve cryptographic hash by random guesses in bitcoin network

(Asked by: username_0 on 2020-12-03)

I searched for a lot. Previous answers on the bitcoin stack exchange did not answer my question.

Well, According to my research, Any node can collect a set up **unconfirmed transactions** into a block and **broadcast** to the rest of the network as a suggestion for what the **next block** in the chain should be, by solving the **cryptographic hash** by **random guesses**. Moreover, the **hash function** creates something like a **32byte number** might be using **SHA256**. So, I want to know who creates random numbers? and how nodes do guessing?

Please let me know if my concept is wrong. I will appreciate your guidance. Thanks

**Tags:** bitcoin-core, blockchain, bitcoind, blockchain.info

> **Comments:**
> **username_0**: @username_2 I just need the answer to my question. Don't need extra information that how algorithms work.  

---

## 3 answers

### Answer by username_1 on 2020-12-03. Score: 1 | Accepted answer

> Moreover, the hash function creates something like a 32byte number might be using SHA256. So, I want to know who creates random numbers? and how nodes do guessing?

It's a 32-bit number. There are only 2^32 possible values for a 32-bit number, about 4 billion, and realistic bitcoin mining hardware attempts trillions of hashes per second. So miners are just designed to try all of them which typically takes much less than a second.

Of course, the odds of any of them producing a valid block are very close to zero, given that only one miner succeeds on average every ten minutes. So the vast majority of blocks that miners attempt to mine turn out to be unmineable and the miner must try all 2^32 possibilities on a different block.


---

### Answer by username_2 on 2020-12-03. Score: 0

> I want to know who creates random numbers?

Nobody.

> and how nodes do guessing?

Mining nodes do this by constructing a block, hashing it and seeing if the hash is less than the target. If not, they retry constructing another block with small variations in contents.

> Please let me know if my concept is wrong.

Your concept is wrong. Ordinary nodes don't create and broadcast suggestions for blocks. The mining process could better be described as trial and error, it can be deterministic rather than random.


---

### Answer by username_3 on 2020-12-04. Score: 0

I believe your answer (and more) can be found here:

**Book**: Mastering Bitcoin; **Chapter 10**: 'Mining and Consensus'; **Section**: [Successfully Mining The Block](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch10.asciidoc#successfully-mining-the-block)

**Snippet**:

> Next, the mining node [...] transmits the block header to his mining
> hardware, which starts testing trillions of nonces per second. Because
> the nonce is only 32 bits, after exhausting all the nonce
> possibilities (about 4 billion), the mining hardware changes the block
> header (adjusting the coinbase extra nonce space or timestamp) and
> resets the nonce counter, testing new combinations.


---

