What Is the Relationship Between Bitcoin and the Blockchain?

This is one of the first questions asked by persons who are new to cryptocurrency. Even some experienced crypto investors struggle to answer this question.

To put it simply, the blockchain is a ledger that is copied and kept by thousands of computers at any given point of time. 

In a conventional paper-based ledger, every page references the previous page to ensure that records are kept in order. Even the slightest change in an old entry can have a compounding effect on all entries that come after it. 

Similarly, in blockchain, virtual blocks (basically a batch of transactions) act as the pages of a paper-based ledger. These blocks are chained together to form an immutable, distributed, and decentralized ledger, where all entries are linked to previous entries. An exact copy of this digital ledger is held by each ‘node’ on the network. Bitcoin was the first application to use blockchain technology and is by far the most popular one too. 

Bitcoin can be obtained using two main methods. The most popular method is to actually buy it with fiat currency by going to a cryptocurrency exchange. Another way is to log onto the bitcoin protocol and do some ‘work’ to earn bitcoins.

By showing successful proof of work, you will be rewarded with some cryptocurrency. The ‘work’ to be done is called ‘mining,’ and the people who do mining are called ‘miners.’

At the time of this writing, approximately 90% of the total supply of 21 million Bitcoins have been mined. In other words, about 2 million Bitcoins are yet to be released.

All you need is a computer with an internet connection to start mining Bitcoin. Mining is nothing but solving a mathematical puzzle. Whoever provides the solution first, will be rewarded with some Bitcoins. 

In 2009, 50 Bitcoins were awarded to winning miner. As per the Bitcoin protocol, this reward is ‘halved’ around every four years. In May 2020, the reward was halved to 6.25 bitcoins.

But you cannot earn that money by using a simple laptop or PC. You need to invest in powerful ASIC (Application Specific Integrated Circuits) machines, like that shown below.

Additionally, if you want to earn a living mining Bitcoin, you will need tons of electricity to run the machines and keep them cool. So, if you are planning to set up a mining farm, then you better choose a state or country that offers cheap electricity.

What Do I Need to Solve When Mining Bitcoin?

Before we answer this question, you need to understand what ‘hashing’ is.

Simply speaking, hashing is the act of inputting data of any length into a hashing function (or hashing algorithm) to produce a unique fixed-length string as an output. 

One of the most popular hashing algorithms (and the one used by Bitcoin) is SHA-256. This function was developed by the US National Security Agency (NSA) in 2001. 

Hashing functions are deterministic. In other words, a specific input will always produce a unique output. The probability of two different inputs having the same output is practically zero.

Another other notable feature of hashing algorithms is that you can never guess the input by looking at the output. Thus, hashing functions are also called one-way functions. Input can lead to output, but output cannot lead to input. 

Look at it this way, if you pass oranges through a juicer, you will get a glass full of juice, but there is no way you can pass a glass of juice through any machine to get the oranges back.

Even a slight change in input data will change the output data string completely.

So What Puzzle Do Bitcoin Miners Solve?

Every block consists of specific fixed data (the list of transactions in the block, timestamps, previous block references, etc.) and variable numeric data (nonce). Now, the miner must combine the fixed data with the nonce, and hash them using the hashing algorithm to get a value lesser than a ‘target’ value. The first miner to find the lowest nonce value that satisfies the required criteria is the winner of the mining reward. 

Every miner must start from nonce value 0 (Zero) and check if the hash output if its lower than the target value. If not, then nonce is incremented by one, and the same process is repeated. This process continues until the hash output of the header data and nonce is lesser than the target value.

Presently, the target starts with 18 zeros. So, if your hash has 18 or more leading zeroes, or is smaller than the target, you win the block reward.

What Is Mining Difficulty?

The bitcoin protocol is programmed to create a new block every 10 minutes.

If there are too many miners with too much computational power, then a block may get mined in, say, 8 minutes. In this case, the Bitcoin protocol will increase the target ‘difficulty’ so that more computational power is needed to solve the puzzle to bring the block mining frequency back to 10 minutes. 

Conversely, if there are too few miners and low computational power, then block frequency will increase to, say, 12 minutes. In this case, the mining difficulty target will be reduced. This is usually the case when Bitcoin’s market price goes down, causing miners to exit.  

We hope that this article has given you better insight into how mining and mining difficulty works. While it may seem a bit abstract now, actually getting into mining can help to put some of these concepts into perspective.