# How nodes solve cryptographic hash by random guesses in bitcoin network [duplicate]

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

• @RedGrittyBrick I just need the answer to my question. Don't need extra information that how algorithms work. Dec 3, 2020 at 13:54

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.

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.