Blockchain and Bitcoins

Vrishabh Patel
Jun 30, 2018 · 9 min read

So with all the hype going off around Bitcoin, it’s difficult to understand the exact science that goes behind it. Bitcoins are based on the Blockchain technology. Simply put, they are one of the applications of the Blockchain technology.

What is a blockchain?
A blockchain is a distributed ledger. As the name suggests, a blockchain is a chain of blocks linked to one another, with some data stored in it. Unlike traditional data storage, which is centralized in a single place. However, the data in a blockchain is decentralized. It is stored on a Peer to Peer Network (P2P), which is open to everyone. That means anyone can access the contents within a blockchain.

What is a block?
Now, let’s move to the blocks. The blocks within a blockchain consist the following:
1. Transactional Data
2. Timestamp
3. Hash of the block
4. Hash of the previous block

What is ‘Hashing’?
Hashing in a simple term is the transformation of any type and size of data into a fixed length data form using a mathematical function. Hash is the resultant output received from hashing. This is the identity of a block which is unique for every data block in the world. No two hashes can be ever same. Think of it like a fingerprint of a block.

In a blockchain, all the information that exists within a block is ‘hashed’. Every block will have a hash value of its own as well as the hash value of the previous block. Which means block 100 will have hash value of itself and of block 99. Block 50 will have hash value of itself and of block 49. Block 2 will have hash value of itself and of block 1. Block 1 will have the hash value only of itself. As there is no block before it, it cannot have a hash value of the previous block and hence it is known as a genesis block.

Alright, we get that. But why is everyone so excited about it?

That’s because the modification of data in a blockchain isn’t easy. The moment you try to modify the information within a block, its hash value will change. And it won’t correspond to the hash value which was stored in the next block resulting into an error. So whenever there is a change to be made, it has to be approved by everyone in the P2P network.

But then the processors these days are capable of calculating thousands of hashes within a second. To prevent this, some safety measures are put in place too. For instance, the blockchain used by bitcoin, is designed in such a manner that a hash can be calculated only after 10 minutes. Which means a new block is added to the chain after every 10 minutes which has information of all the recent modifications to the database that take place in those 10 minutes. Also, it has to be approved by everyone else in the network and not just only you. So if you’re about to pull a fraud, you need extremely high processing speeds which currently don’t exist and will have to take control of the P2P Network which is not practically possible. So it’s safe. Extremely safe.

What does Bitcoin have to do with Blockchain?
Let’s get to bitcoins now. It has the same technology. And the information contained within the block is the name of the sender, the name of the receiver and the amount involved. Along with the hash value of that block and the block before it.

Every 10 minutes, the system compiles all the recent transactions that took place in last 10 minutes and then added to the end of the distributed ledger (blockchain). This block has to be approved by everyone in the network. In order to approve it, the hash value must be decrypted first. Once that’s done, every system will check it and then approve it.

How is a block verified?
To verify the block, a user is required to find a number, called nonce, which is an incremental number. Once the number is found, it can be verified within a split second. However, finding that number, is what takes lot of time and processing. It generally follows an ascending order of numbers (1, 2, 3, and so on) before the ‘target value’ is found. So it basically happens like this:

  1. Hash of the previous block is combined with the hash of the current block and a nonce is selected.
  2. The new hash thus created is compared with the targeted value.
  3. The new hash can be either greater than the targeted value or lower than the targeted value.
  4. If the new hash is greater than the targeted value, then the next nonce is selected and the process takes place all over again.
  5. When the new hash is smaller than the targeted value, then you’ve solved the block.

How do you ‘mine’ Bitcoins?
This is where Bitcoins come in. When a user successfully verifies a new block that’s added to the network, it is rewarded by the system for the processing carried out by it, in order to ensure that the blockchain maintains its integrity. This reward is in terms of bitcoins and some portion of the transaction amount as transaction fees. Upon successful hashing of every block the miner receives 12.5 bitcoins. This reward is halved every after successful decryption of 210,000 blocks, that’s 4 years to be precise (10 minutes for a new block to generate).

Reduction in block reward over the years

In the beginning when Bitcoins were introduced, the decryption of each block rewarded 50 bitcoins. That was in 2008. In 2012, the reward was reduced to 25. In 2016 the reward was reduced to 12.5 and by 2020 the reward will be reduced to 6.25 bitcoin per block decrypted. Eventually the reward will be reduced to zero by the year 2140 and the total number of bitcoins that will exist will be 21 million. The record keeping will then be rewarded by transaction fees only.

Wow. Free money!

No, it’s not that easy. The blockchain in bitcoin is designed to adjust the level of difficulty.

What is mining difficulty?
After every 2016 blocks (14 days), the system adapts itself based on the number of miners and the time taken by them to verify block. So at any point of time it must take 10 minutes to hash a verify a block. The number of miners constantly keeps on increasing and therefore the total processing power being used also increases. Ideally it should take less time to carry out the verification as everyone is solving the blocks together.

Plot of mining difficulty over the years

But that doesn’t happen as after 2016 blocks, the system will set the difficulty, to a level, such that the coins mined within the last two weeks should be completed only in the next two weeks and not before that. Which means that no matter if there’s one person processing a block or a million people, it will always take 10 minutes. But since with a million people processing the blocks together, the difficulty will be at such a level that you as an individual will have no scope of mining any bitcoin.

In the beginning, when bitcoin was introduced, you could’ve mined bitcoins using a spare laptop of yours with any average processor that it had. But as the difficulty increased, processors became incapable of being able to decrypt the data. Graphics cards were however still capable of processing the data due to their specialized processing capabilities. As they’re more or less restricted to process a specific type of data so they’re up for the task. However, as the difficulty increased, even graphic cards became obsolete, ASIC miners were introduced which are capable of the task.

What are ASIC Miners?
Application Specific Integrated Circuit (ASIC) Miners are devices or appliances that are specifically designed to solve the math problems in the blockchain of bitcoin. They can’t do anything else.

They suck a huge load of power and they can cost up to about 3000 dollars. And they’re always out of stock, with average waiting periods being around 6 months. So by the time you receive your miner, the difficulty in the system would’ve been to such a level, that even an ASIC Miner won’t be able to mine much from the system. As you need to take into consideration the amount that you spend on the power that you consume behind it and the initial amount that you pay to buy it.

An ASIC Miner

However, there’s alternatives available right now such as Ethereum, Zcash, Dash, Ripple and Monero which can be profitable using ASIC miners.

What happens when all the bitcoins are mined?
Bitcoins are limited in supply and the total number of bitcoins that can ever exist is 21 million of them. That will happen by the year 2140. So what happens when all of them are mined? So as I mentioned earlier, there’s two things that a miner gets when he successfully Hashes a block — Bitcoins and Transaction Fees. As and when the bitcoin reward starts decreasing, the transaction fees being offered goes on increasing. So, once all the bitcoins have been mined, the incentive that the miners will receive will be solely in terms of transaction fees.

Transaction Fees Replacing Block Rewards

What problems does it pose?
So, why are many countries banning Cryptocurrencies? That’s because traditional currencies are regulated by a governing authority who decide when to issue new currency and of what denomination. Cryptocurrencies on the other hand are unregulated and no authority can ever be formed to regulate it. That’s because it’s entirely based upon the individuals mining them so there’s no way to control how much Cryptocurrency is being circulated in the economy at any given point of time. Imagine how it would affect inflation and deflation without the governments being able to control the currencies to bring things back on track.

What benefits would it give?
It solves on the biggest problems that exist in any form of digital currency - The problem of double spending. It means that the same money can be spent twice on two different transactions as digital money can potentially be replicated. However, the same doesn’t go with bitcoins. As we saw earlier that every block has a unique identity, it is not possible to have the same block appear twice in any given condition.

Is it safe?
Nothing can ever be truly robust. There will always be something that make systems vulnerable. Even blockchain technology is not spared by it. There’s different types of attacks that can take place on a bitcoin user. One of the attacks requires a person to take control of around 51% of the P2P Network so that he can dis-confirm other users’ blocks while confirming his own so that he gets all the bitcoins being generated and block any transaction which he wants. However, taking into consideration the current difficulty level, that would require the even more computational power than that of all the top 500 supercomputer brought together.

There however has been one huge theft of bitcoins. Mt. Gox, was a bitcoin exchange based in Tokyo which launched in 2010 and by 2013, it handled 70% of all the bitcoin transaction worldwide. In February of 2014, Mt. Gox announced that around 8,50,000 bitcoins were stolen. The value of all these bitcoins at the time was around 450 million dollars.

Should you mine bitcoins?
At this point, mining in bitcoins is would not be profitable for you in any circumstances. You can definitely mine other options that are available but the profitability will never be as high as bitcoins. So, if you want to make this as a prime source of income, it won’t turn out to be good for you. However, if you should definitely try to do it once just for the fun of it.

Vrishabh Patel

Written by

A commerce student who tries to write articles about science and technology.