# Is Bitcoin mining chance based?

This answer says that Bitcoin is not chance based, may I know how it is deterministic and does not have any associated probability of mining a coin?

To sum up the mining process: miners have a potential future block and they need to solve a problem based on that block to prove that they worked on it (Proof of Work). They apply a hash function to the block and get back a hash. The hash needs to have some properties, e.g. start with 3 zeros. If it doesn't, the miners change a value in the block (called nonce) and apply the hash function again. The new hash will be different. If it still doesn't start with 3 zeros miners repeat the process until they find a hash that starts with 3 zeros. For more details, please read this to understand the mining process.

A hash function is in itself deterministic. However, the mining process is not. Thus, the answer in the link you provided is wrong. If everyone was trying to mine identical blocks with identical nonces of the same exact order then it might be, in a sense, deterministic but that is not the case.

Everyone has a chance to win (although it is so small that in practice doesn't occur). See here for some examples.

The number of attempts to close a block is probabilistically determined by the law of large numbers. In other words, it is theoretically possible for you to generate at your first try an hashing that meets the target even using your paper and pencil but the probability is very low.

As analogy, if you bet on zero playing at roulette you have 1/36 of chance per try. It turns out that you can win at your first try or most likely you don't. If you repeat the try N times (say 1000 times), you will observe that you will win a number K of bets, where K/N is a random variable that has an expected value of 1/36. That does NOT mean that your K/N is equal to 1/36, it means that if you repeat the N sequence again and again you will observe K/N average value will be close to 1/36.

In the same way, mining a block is like betting on zero on a roulette with many many more numbers (your odds being much much lower) and according to the number of attempts you can do (say per hour) it is probabilistically defined how many blocks you will be likely to close in the same period.

• Good answer with the analogy. You should try to aerate the text more though, try to make it more readable. Feb 23 '16 at 22:20