What Is Bitcoin Mining & How It works ?
What is Bitcoin Mining?
Cryptocurrency mining is painstaking, costly, and only sporadically rewarding. Nonetheless, mining has a magnetic appeal for many investors interested in cryptocurrency because of the fact that miners are rewarded for their work with crypto tokens. This may be because entrepreneurial types see mining as pennies from heaven, like California gold prospectors in 1849. And if you are technologically inclined, why not do it?
KEY TAKEAWAYS
- By mining, you can earn cryptocurrency without having to put down money for it.
- Bitcoin miners receive Bitcoin as a reward for completing "blocks" of verified transactions which are added to the blockchain.
- Mining rewards are paid to the miner who discovers a solution to a complex hashing puzzle first, and the probability that a participant will be the one to discover the solution is related to the portion of the total mining power on the network.
- You need either a GPU (graphics processing unit) or an application-specific integrated circuit (ASIC) in order to set up a mining rig.
How To Mine Bitcoins
"So after all that work of verifying transactions, I might still not get any bitcoin for it?"
That is correct.
To earn bitcoins, you need to meet two conditions. One is a matter of effort; one is a matter of luck.
1) You have to verify ~1MB worth of transactions. This is the easy part.
2) You have to be the first miner to arrive at the right answer, or closest answer, to a numeric problem. This process is also known as proof of work.
"What do you mean, 'the right answer to a numeric problem'?"
The good news: No advanced math or computation is involved. You may have heard that miners are solving difficult mathematical problems—that's not exactly true. What they're actually doing is trying to be the first miner to come up with a 64-digit hexadecimal number (a "hash") that is less than or equal to the target hash. It's basically guesswork.
The bad news: It's guesswork, but with the total number of possible guesses for each of these problems being on the order of trillions, it's incredibly arduous work. In order to solve a problem first, miners need a lot of computing power. To mine successfully, you need to have a high "hash rate," which is measured in terms of megahashes per second (MH/s), gigahashes per second (GH/s), and terahashes per second (TH/s).
That is a great many hashes.
If you want to estimate how much bitcoin you could mine with your mining rig's hash rate, the site Cryptocompare offers a helpful calculator.
Mining and Bitcoin Circulation
How Much a Miner Earns
If you want to keep track of precisely when these halvings will occur, you can consult the Bitcoin Clock, which updates this information in real-time. Interestingly, the market price of bitcoin has, throughout its history, tended to correspond closely to the reduction of new coins entered into circulation. This lowering inflation rate increased scarcity and historically the price has risen with it.
If you are interested in seeing how many blocks have been mined thus far, there are several sites, including Blockchain.info, that will give you that information in real-time.
What Do I Need To Mine Bitcoins?
The "Explain It Like I'm Five" Version
Let's say I'm thinking of the number 19. If Friend A guesses 21, they lose because of 21>19. If Friend B guesses 16 and Friend C guesses 12, then they've both theoretically arrived at viable answers, because of 16<19 and 12<19. There is no "extra credit" for Friend B, even though B's answer was closer to the target answer of 19. Now imagine that I pose the "guess what number I'm thinking of" question, but I'm not asking just three friends, and I'm not thinking of a number between 1 and 100. Rather, I'm asking millions of would-be miners and I'm thinking of a 64-digit hexadecimal number. Now you see that it's going to be extremely hard to guess the right answer.
If B and C both answer simultaneously, then the ELI5 analogy breaks down.
In Bitcoin terms, simultaneous answers occur frequently, but at the end of the day, there can only be one winning answer. When multiple simultaneous answers are presented that are equal to or less than the target number, the Bitcoin network will decide by a simple majority—51%—which miner to honor. Typically, it is the miner who has done the most work or, in other words, the one that verifies the most transactions. The losing block then becomes an "orphan block." Orphan blocks are those that are not added to the blockchain. Miners who successfully solve the hash problem but who haven't verified the most transactions are not rewarded with bitcoin.
What Is a "64-Digit Hexadecimal Number"?
Well, here is an example of such a number:
0000000000000000057fcc708cf0130d95e27c5819203e9f967ac56e4df598ee
The number above has 64 digits. Easy enough to understand so far. As you probably noticed, that number consists not just of numbers, but also letters of the alphabet. Why is that?
To understand what these letters are doing in the middle of numbers, let's unpack the word "hexadecimal."
As you know, we use the "decimal" system, which means it is base 10. This, in turn, means that every digit of a multi-digit number has 10 possibilities, zero through nine.
"Hexadecimal," on the other hand, means base 16, as "hex" is derived from the Greek word for six and "deca" is derived from the Greek word for 10. In a hexadecimal system, each digit has 16 possibilities. But our numeric system only offers 10 ways of representing numbers (zero through nine). That's why you have to stick letters in, specifically letters a, b, c, d, e, and f.
If you are mining bitcoin, you do not need to calculate the total value of that 64-digit number (the hash). I repeat: You do not need to calculate the total value of a hash.
So, what do "64-digit hexadecimal numbers" have to do with bitcoin mining?
Remember that ELI5 analogy, where I wrote the number 19 on a piece of paper and put it in a sealed envelope?
In bitcoin mining terms, that metaphorical undisclosed number in the envelope is called the target hash.
What miners are doing with those huge computers and dozens of cooling fans is guessing at the target hash. Miners make these guesses by randomly generating as many "nonces" as possible, as fast as possible. A nonce is short for "number only used once," and the nonce is the key to generating these 64-bit hexadecimal numbers I keep talking about. In Bitcoin mining, a nonce is 32 bits in size—much smaller than the hash, which is 256 bits. The first miner whose nonce generates a hash that is less than or equal to the target hash is awarded credit for completing that block and is awarded the spoils of 6.25 BTC.
In theory, you could achieve the same goal by rolling a 16-sided die 64 times to arrive at random numbers, but why on earth would you want to do that?
The screenshot below, taken from the site Blockchain.info, might help you put all this information together at a glance. You are looking at a summary of everything that happened when block #490163 was mined. The nonce that generated the "winning" hash was 731511405. The target hash is shown on top. The term "Relayed by Antpool" refers to the fact that this particular block was completed by AntPool, one of the more successful mining pools (more about mining pools below). As you see here, their contribution to the Bitcoin community is that they confirmed 1768 transactions for this block. If you really want to see all 1768 of those transactions for this block, go to this page and scroll down to the heading "Transactions."
"So how do I guess at the target hash?"
All target hashes begin with zeros—at least eight zeros and up to 63 zeros.
There is no minimum target, but there is a maximum target set by the Bitcoin Protocol. No target can be greater than this number:
00000000ffff0000000000000000000000000000000000000000000000000000
Here are some examples of randomized hashes and the criteria for whether they will lead to success for the miner:
"How do I maximize my chances of guessing the target hash before anyone else does?"
You'd have to get a fast mining rig, or, more realistically, join a mining pool—a group of coin miners who combine their computing power and split the mined bitcoin. Mining pools are comparable to those Powerball clubs whose members buy lottery tickets en masse and agree to share any winnings. A disproportionately large number of blocks are mined by pools rather than by individual miners.
In other words, it's literally just a numbers game. You cannot guess the pattern or make a prediction based on previous target hashes. The difficulty level of the most recent block at the time of writing is about 17.59 trillion, meaning that the chance of any given nonce producing a hash below the target is one in 17.59 trillion. Not great odds if you're working on your own, even with a tremendously powerful mining rig.
"How do I decide whether bitcoin will be profitable for me?"
Not only do miners have to factor in the costs associated with expensive equipment necessary to stand a chance of solving a hash problem. They must also consider the significant amount of electrical power mining rigs utilize in generating vast quantities of nonces in search of the solution. All told, bitcoin mining is largely unprofitable for most individual miners as of this writing. The site Cryptocompare offers a helpful calculator that allows you to plug in numbers such as your hash speed and electricity costs to estimate the costs and benefits.
What Are Coin Mining Pools?
Mining rewards are paid to the miner who discovers a solution to the puzzle first, and the probability that a participant will be the one to discover the solution is equal to the portion of the total mining power on the network. Participants with a small percentage of the mining power stand a very small chance of discovering the next block on their own. For instance, a mining card that one could purchase for a couple of thousand dollars would represent less than 0.001% of the network's mining power. With such a small chance at finding the next block, it could be a long time before that miner finds a block, and the difficulty going up makes things even worse. The miner may never recoup their investment. The answer to this problem is mining pools. Mining pools are operated by third parties and coordinate groups of miners. By working together in a pool and sharing the payouts among all participants, miners can get a steady flow of bitcoin starting the day they activate their miner. Statistics on some of the mining pools can be seen on Blockchain.info.
"I've done the math. Forget mining. Is there a less onerous way to profit from cryptocurrencies?"
As mentioned above, the easiest way to acquire bitcoin is to simply buy it on one of the many exchanges. Alternately, you can always leverage the "pickaxe strategy." This is based on the old saw that during the 1849 California gold rush, the smart investment was not to pan for gold, but rather to make the pickaxes used for mining. Or, to put it in modern terms, invest in the companies that manufacture those pickaxes. In a cryptocurrency context, the pickaxe equivalent would be a company that manufactures equipment used for Bitcoin mining. You may consider looking into companies that make ASICs equipment or GPUs instead, for example.
Is Bitcoin Mining Legal?
The legality of Bitcoin mining depends entirely on your geographic location. The concept of Bitcoin can threaten the dominance of fiat currencies and government control over the financial markets. For this reason, Bitcoin is completely illegal in certain places.
Bitcoin ownership and mining are legal in more countries than not. Some examples of places where it is illegal are Algeria, Egypt, Morocco, Bolivia, Ecuador, Nepal, and Pakistan.4 Overall, Bitcoin use and mining are legal across much of the globe.
Risks of Mining







No comments