How Is Bitcoin Mined?

LocalBitcoins
The LocalBitcoins blog
6 min readSep 15, 2021

--

Guest article by James Page

See also: ¿Cómo se mina el Bitcoin?

Bitcoin mining is mostly known as a popular way of earning bitcoins without having to buy the cryptocurrency. While it is certainly true that users can earn Bitcoin through mining, there is also another crucial aspect to mining: it keeps the Bitcoin blockchain secure against bad faith actors and protects the integrity of Bitcoin transactions. The security of the cryptocurrency rests entirely on the shoulders of Bitcoin miners.

Essentially, Bitcoin mining is a competitive process to validate the next block of Bitcoin transactions. Successful miners who are able to prove that they are processing valid transactions are awarded with Bitcoin for their efforts.

Here is a short guide to explain how Bitcoin mining works to broaden your understanding of the mining process and help you decide whether you can profit from Bitcoin mining.

What Is Bitcoin Mining?

Bitcoin is a decentralized digital currency without a monitoring central authority. Since there are validators (peers on the network) who can authorize minting new units of currency, or secure the digital asset transactions against hackers, Bitcoin incentivizes cryptocurrency users to secure the digital safety of the cryptocurrency through Bitcoin mining. This process generates new bitcoins and gives mining rewards in BTC to successful miners.

In order to understand how Bitcoin mining works, you need a basic understanding of the Bitcoin blockchain. Developed by mysterious inventor Satoshi Nakamoto, blockchain technology allows digital currency transactions to operate securely without a central authority.

You can think of Bitcoin blockchain as a public ledger. All validated Bitcoin transactions are added to this ledger as blocks of 1 MB of data. Each new block is created based on the data of the previous block, creating an unbroken chain of transactions.

Since all the blocks are chained to each other through cryptography, no one can alter a block without also tampering with all the previous blocks in the chain. Only an entity that controls 51% of Bitcoin’s network can possibly mess with the blockchain and add false transactions, but since Bitcoin is a widely-used, popular digital asset, the risk stays minimal.

Bitcoin miners race each other in order to provide the cryptographic proof that shows the block of transactions they are adding to the blockchain is indeed valid. Miners broadcast the proof once they have it, and all the users in Bitcoin’s peer-to-peer network can easily verify the results. This process, also known as the proof-of-work protocol, is the consensus mechanism that allows Bitcoin to function.

How Does Bitcoin Mining Work?

Cryptography plays an important role in Bitcoin mining. Bitcoin’s proof-of-work protocol runs a cryptographic algorithm — SHA-126 — to assign a target value — a block hash — to each Bitcoin block that gets mined. The algorithm uses the previous block hash to come up with a new block hash.

Hashing is easy to illustrate. For example, if you put the previous sentence through the hashing algorithm, you and everyone else who runs it through the algorithm receives the same value. However, if you add a random letter to the sentence, the output hash value will be completely different. The only way for others to receive the same hash value is to try adding random letters to the sentence and run it through the algorithm until they find the right letter.

A simple hash function. Changing only one letter in the sentence on the left results in a completely different hash.

Bitcoin miners do the same thing but with numbers. Miners take the previous block hash, and run it through the algorithm with random numbers until they find the right number that produces the target hash (or a value lower than the target hash). This is basically guess work, but it is still very hard since miners might have to hash millions of numbers before they find the right value.

Once a miner finds the right number that satisfies the proof-of-work algorithm, they can add a new block of transactions to the Bitcoin blockchain. Everyone else can verify the validity of the block by simply running the winning number through the algorithm to see if it checks out.

The Bitcoin protocol adjusts how hard it is to find the right hash value every two weeks, based on the total computing power in the network. As new miners join the race, mining difficulty increases to keep the growth of the blockchain steady. It takes around 10 minutes to mine a Bitcoin block, on average.

The more miners participate in the mining process, the more leading zeroes there will be in the target hash making mining more difficult.

What Do You Need to Mine Bitcoin?

Bitcoin mining requires brute force computational guessing. Miners have to run through numbers as fast as they can in order to come up with the correct hash value before other miners, so that they can reap the rewards of their efforts.

Bitcoin mining difficulty and the computing power necessary to mine Bitcoin are measured in hash rates. A hash rate defines how many hashes a mining rig can make per second. A miner’s hash rate can be measured in megahashes per second (MH/s), gigahashes per second (GH/s), and terahashes per second (TH/s). The faster a mining rig can run through the hashes, the better the miner’s chance of mining a block. This is why most miners use special mining hardware, ASICs, created specifically for mining.

As Bitcoin mining became more and more popular over the years, the difficulty increased as well, making it hard for solo miners to successfully mine Bitcoin blocks. As a result, miners began to combine their computing power through mining pools to mine Bitcoin collaboratively and share the rewards.

What Do You Need to Mine Bitcoin?

If you are wondering whether you can make a profit from mining Bitcoin, there are few factors you should consider. In order to mine Bitcoin successfully, you need mining equipment. While you can use your laptop for CPU or GPU mining, their significantly lower hash rate puts you at a disadvantage. If you are serious about mining Bitcoin, consider buying ASIC miners.

Another important step is to join a mining pool. Joining a mining pool will increase your odds of getting mining rewards significantly, but most mining pools charge a certain fee for their service. A mining pool could also offer free service in exchange for transaction fees, as does Antpool.

Different mining pools have different reward distribution structures that you should take into account. Some reputable mining pools you can consider are Slush Pool (the first and oldest Bitcoin mining pool), F2Pool, or one of the biggest mining pools Poolin.

Finally, one of the most important things to consider is the price of electricity in the region where you live. Bitcoin mining requires a considerable amount of energy, and you will also likely need cooling equipment to manage the heat level of your mining rig. If the cost of electricity that is needed to run your mining rig and cooling equipment is too high, it might be hard to make a profit with Bitcoin mining.

You can find Bitcoin mining calculators online that help you decide whether mining can be profitable for you. Most mining pools also offer calculators that will help you see how much BTC you can earn through mining.

A Few Words Before You Go…

Bitcoin mining is a competitive but potentially rewarding process for Bitcoin miners. As a Bitcoin miner, you can earn BTC and transaction fees, while also providing security for the digital asset.

However, as Bitcoin mining has become quite popular over the years, it has gotten harder to earn a profit from individual mining efforts. If you are thinking about getting into Bitcoin mining, you need to buy dedicated mining equipment and join a mining pool to boost your chances of success.

--

--