What is Bitcoin Mining and How Does it Work?

11 Jun 2018
Share Print-Ready Version

When digital currency is discussed in the mainstream media, it’s practically used interchangeably with the word Bitcoin. Other digital currencies are rarely mentioned. Bitcoin’s skyrocketing value and media presence have snowballed in recent years, but it’s important to note that Bitcoin mining often applies to the mining of digital currencies other than Bitcoin.

 As new investors flock to the blockchain “Gold Rush,” many are asking themselves important questions. How does blockchain work? Where do Bitcoins come from? What is Bitcoin mining and how does it work? All of these are relevant questions to ask when investing in digital currency or blockchain projects and infrastructure.

To understand the answers to these questions, it’s important to first understand what blockchain technology is and how it works.

What is blockchain?

Although blockchain and Bitcoin are often mentioned together, blockchain itself is a far-reaching technology that has use cases outside of the world of finance.

Explaining all the ins and outs of blockchain technology could easily fill a whole book, but for our purposes, the basics will suffice.

The blockchain is a digital ledger that keeps track of information in a decentralized, chronologically timestamped way, which makes it impossible to unilaterally and maliciously alter once it's been recorded. The type of information that each “block” might contain ranges from vital sign records in the healthcare industry to, in our case, digital currency transactions.

Each block of information is chained together chronologically to create a chain of blocks of data, or a blockchain.

What is especially innovative and important about blockchain is that it’s spread out, or decentralized, in a peer-to-peer (P2P) network. There is no single server housing the Bitcoin blockchain that keeps track of how everyone spends their money. Instead, lots of people have records of the Bitcoin blockchain. Anyone is free to download the current data and share it with other users.

This makes anything on the blockchain incredibly difficult, if not impossible, to hack. Everyone who has a copy of the blockchain information is also sharing it with other people on the blockchain, and everyone is updating their records to include the most up-to-date information. If one person wants to alter the blockchain to say they have a million Bitcoin, everyone else on the network will say, “No, that doesn’t look right,” and will reject that data as invalid. The decentralization and immutability of blockchain networks are what makes them a perfect foundation for digital currency.

For a more in-depth look at blockchain technology and its use cases, IBM offers a free whitepaper and For Dummies book on the subject. Similarly, Oracle offers a free report on the blockchain.

What are Bitcoin nodes?

While the term might sound intimidatingly technical at first, a node is simply any computer that connects to the Bitcoin network. However, not all nodes are created equal. Here are a couple of common types of nodes:

Full nodes

A full node is critical to Bitcoin infrastructure because it downloads all the blocks and transactions that have ever occurred on the network and then checks them against the network’s consensus rules. If a block or transaction does not follow these rules, then a full node says, “No,” and rejects the data. They share their information with the rest of the network in P2P style as discussed above. Hosting a full node currently requires just under 200GB of space.

Pruned nodes

Pruned nodes take up much less hard drive space but still serve a purpose in the network. A pruned node only keeps more current information from the end of the chain and records new transactions for transmission to other nodes on the network.

For any type of nodes on the Bitcoin network to hold transaction information, Bitcoins must exist to spend. So, how do Bitcoins come into existence? This is one area in which miners help.

What is Bitcoin mining? Why is it called “mining” if it’s all digital?

Bitcoin mining is the process of “discovering” new Bitcoins in the network, allowing them to enter circulation.

Just like gold in the Earth, there is a finite number of Bitcoins that can come into existence. You can’t mine gold if all of it has already been extracted, and you can’t mine Bitcoin if all of them have already gone into circulation. There are 21 million Bitcoin that are presently available, barring any network changes. It is not expected that all of these coins will be found until around the year 2140. Just like gold, Bitcoins are buried, and miners must work to extract them. In the case of Bitcoin mining, the work doesn’t involve hard labor with a pick and axe but instead involves solving difficult number puzzles. Like gold mining, the more that’s taken out, the harder it becomes to mine more.

Some people have also described Bitcoin mining as a process similar to “minting” money in fiat currency, although in this case, the number of coins that can be minted is finite.

Why do Bitcoin miners need to solve a puzzle?

In order to mine Bitcoin, miners solve puzzles that allow them to essentially work as auditors on the network and prevent double spending of coins, i.e. spending the same Bitcoin twice. Since there is no central power that regulates Bitcoin itself, those who are part of the network must verify transactions and ensure the nodes on the network are keeping legitimate, up-to-date, cohesive records of Bitcoin spending. 

Miners verify transactions to have the chance to win Bitcoin by getting the right answer to the puzzle first. If multiple miners get the right answer at the same time, the miner who did the most work wins the Bitcoin.

In short, Bitcoin miners solve numeric puzzles to keep the Bitcoin network running safely and honestly, and are rewarded for their efforts.

What’s involved in the puzzles Bitcoin miners solve?

The puzzles that Bitcoin miners solve to help verify transactions are cryptographic hash functions. They are “essentially one-way encryption without a key,” according to Ameer Rosic, 

who also explains that it is impossible to cheat on these types of puzzles because there is no better way to solve them than to guess.

Of course, more computing power means more and faster guesses. More computing power also means higher resource consumption, which is why we build our mining operations in countries like Iceland, Sweden, and Norway.

To make guesses toward the target cryptographic hash (which must be under a certain number), Bitcoin miners start by generating “nonces,” or numbers used only once. To compare these numbers, the target hash is a 64-digit hexadecimal number, which is 256 bits, while a nonce in Bitcoin mining is only 32 bits.

As mentioned previously, mining Bitcoin becomes increasingly harder the fewer Bitcoins there are available to mine. Right now, the chance of a nonce producing a viable hash, e.g. one that is under the specified number, is less than 1 in 2 trillion—in other words, much rarer than winning the lottery. When a miner succeeds, however, they have performed a proof of work (PoW), which is a piece of data that “proves” that what they provided was difficult, time consuming, and costly. This allows others on the network to verify that their efforts are valid. Bitcoin uses a proof of work called “hashcash" in order to reward miners.

How and why do Bitcoin miners get paid?

Bitcoin miners get paid for their work to help the entire ecosystem of the Bitcoin network function as intended and to keep Bitcoin users fair and honest. As they verify transactions alongside their mining peers, they are competing to earn money by solving difficult computational problems. Once the transactions are verified and the problem is solved, they create a data block, which is transmitted to other nodes on the network, all of which together create the blockchain—the foundation of digital currency technology.

Whenever Bitcoin miners verify transactions and are the first to solve a problem, they are awarded a set number of Bitcoins, which changes after every 210,000 blocks. The current rate is a 12.5 Bitcoin reward for creating each new Bitcoin block.

At times, multiple miners simultaneously come up with a workable solution to the puzzle. In these cases, whichever miner did the most work in verifying transactions and completing the puzzle receives the payout and the other winner’s valid block is left out, becoming an orphan block, and they receive nothing.

In summary, Bitcoin miners get paid by offering their computer resources toward solving puzzles, which helps verify transactions on the Bitcoin network blockchain to prevent double-spending.

Why mining is the backbone of blockchain infrastructure

Although Bitcoin mining was once a hobby for cryptography enthusiasts, it has evolved into a full-blown profession. As mentioned, Bitcoin mining becomes increasingly difficult over time and requires more and more computer resources. A growing population of Bitcoin users also creates more transactions that need to be verified. Bitcoin miners help keep Bitcoin alive and well and fuel the network so that owners of the currency can spend it without substantial delays. They also keep Bitcoin out of the hands of any one regulator, maintaining its decentralized nature.

By supporting Bitcoin and blockchain infrastructure through the likes of professional miners, investors help to grow the future of digital currency and the freedom that comes with it. They also help to remove middlemen from currency markets. Last but not least, they support an industry that will come up with the next big disruptive technology that arises after this one.