Why is it really hard for the ASIC miner to generate a hash output that is below a certain value?

#bitcoin

#mining

#proof-of-work

Reply to this note

Please Login to reply.

Discussion

ASIC mining is kind of a bug in bitcoin ecosystem.

I believe Monero got it right in mining system.

A miner runs the SHA-256 algorithm on the block of transaction data + a random number called a nonce

So if the block is 1234, the nonce is X, after running the hashing function, you get something like:

1234X -- SHA256 --> 1CD87...

Where the number 1CD87... (going on for 64 characters) is the hash.

If you change the nonce to Y, the function will output something completely different:

1234Y -- SHA256 --> 03F2A...

So what the miners do is test a ton of nonces until they get a hash that starts with a certain number of zeros. Those leading zeros are what make the hash a "small number", like

9850 = 9850

0840 = 840

0065 = 65

0003 = 3

But since the hash is completely random, it's basically a lottery to get such a small hash given any nonce. You have to try nonce, after nonce, after nonce ... Which is what makes miners have to work so hard.

ASICs have the SHA256 algorithm built out in a physical circuit to make the calculation as fast as possible too, but even then, the difficulty adjustment makes it so the miners just have to keep working harder and harder as more hash power comes online.

Great explanation man! 👍🏻