How does cryptocurrency mining work

In a nutshell, crypto mining is a lottery. The machine you use for mining (such as an ASIC miner or your CPU/GPU) checks random numbers one by one, which, when added with other block parameters and hashed, are supposed to meet a certain condition. If the condition is met, you can add the block to the chain and seize the prize for yourself.

The most exciting thing is that in truth every machine, even the weakest computer has a probability to find that right number. Of course, the more combinations you are able to check in a given second, the better your chances of finding the block.

To make it simple - imagine a lottery in which you buy tickets with random numbers from 1 to 1,000,000. If the number on your ticket is less than 1,000 then you win the prize. Simple right? If you buy one ticket your chances are 1,000/1,000,000 which is 1/1000 or 0.1%. On the other hand, if you buy 1,000 tickets then the probability that you win is 10%. If you buy 10,000 tickets then in theory you have a 100% chance of hitting the jackpot, but since it's a game of chance it could happen that none of the tickets has a number below 1,000. But it could also happen that on the 2nd or 3rd ticket you hit the right number.

So as you can see from this example, whether you buy one ticket or 100 tickets you have a chance to win every time, but the more tickets you buy, the greater your chance.

And exactly the same way crypto mining works with the difference that it is the miner that “generates the tickets” and you pay for it with electricity. If you have a 12TH/s miner, that means such a miner checks 12,000,000,000,000 hashes ("lottery tickets") per second. Seems like a lot right? Unfortunately, it's not much because in the case of cryptos based on the SHA256 algorithm (i.e. the popular Bitcoin, BitcoinCash, or eCash) there are as many as 2^256 numbers in the pool.

If you are interested in how exactly the probability of hitting a block is calculated, how the hash is generated for a block, or what the blocks are all about, I encourage you to visit our site. From time to time we will try to publish short materials explaining the complicated but exciting world of crypto.