Mining the Blockchain

Mining the Blockchain

Mining the Blockchain for Bitcoin

Why Is It Called Mining?

It's funny how we continue to use words and phrases for which the original context no longer applies.

For example, we still say "dialing a number" although it's been many years since telephones had dials. "Filming an incident" refers to the photographic process of exposing an image to a photo sensitive thin film, even though it's now all digital. We speak of "taping" a show, but video tape was replaced long ago by CD's, which were in turn replaced by solid-state memory. Many newsreaders report that the landslide or pandemic  "decimated" the village, although decimate (derived from the Latin decem, meaning 10) actually refers to a Roman army punishment where 1 in every 10 members of a cohort was killed by his fellow soldiers as a substitute for punishing the entire cohort. "Devastated" would be more accurate.

Here we are using the term "bitcoin mining" though it bears little resemblance to traditional mining for commodities such as gold.

But there are similarities.

  • A major investment in both equipment and labor is required.
  • The mining process is both labor and time intensive.
  • The effort required increases as the commodity becomes scarcer.
  • There is a limited, fixed supply of the commodity and it will eventually all be mined.

In his original white paper, Satoshi Nakamato stipulated that there would only ever be 21 million bitcoin. However, this is not merely a stipulation. It is built into the structure of the bitcoin blockchain.

Let's look at how all this works.

Bitcoin Mining

Bitcoin miners run powerful computers (more on that later) devoted to running specialized software that automatically flags when there is a new block of bitcoin transactions waiting to be verified. There are around 3,500 transactions per block.

Before a new block can be added to the blockchain, it must be verified. Miners will receive a new block to verify roughly every 10 minutes.

The new block comes with a mathematical puzzle that has to be solved by the bitcoin miner computers. The puzzle, referred to as an algorithm, results in the calculation of a hash value, which looks like a long string of letters and numbers. There is only one correct hash value for each bitcoin transaction block on the blockchain. Calculating the correct hash value is very much a trial and error process, which is why it requires a lot of computer power.

The first miner to solve the algorithm is rewarded with bitcoins. Originally, each block mined was rewarded with 50 bitcoin, but this is halved  approximately every four years. In 2012, it was halved to 25 bitcoin, in 2016 to 12 and a half and in 2020 to 6 and a quarter.

Once a majority (51%) of the miners have agreed that the hash value is correct, the block is regarded as verified and is added to the block chain. It's transactions are executed and the next block is presented to the miners for solution. This ensures that the transactions in each block can only be executed once. No double dipping!

Note that the actual process is a little more complex than presented here, but the above will give you an overview.

So, "mining the blockchain for bitcoin" is the term used to describe the process of adding transaction records (blocks) to the decentralized ledger file called the bitcoin blockchain. This file contains an immutable record of every bitcoin transaction ever made, going back to 2009.

The computers used for mining form a peer-to-peer network. Each is running specialized mining software that allows each computer to communicate securely with all others on the network. This is how each node in the network "knows" when the hash value has been calculated correctly and moves to verify it.

The bitcoin network runs 24/7 and processes millions of dollars worth of bitcoin every day. It has been running continuously since 2009 and has never been hacked.

Types of Mining

The process of mining can get really complex and a regular desktop or laptop PC can’t cut it. It requires powerful computer hardware, along with lots of electricity and fans to keep the rig cool. Specialized computers have been developed specifically to mine the blockchain.

Although we talk of blockchain mining, it's almost exclusively bitcoin mining in the real world.

Broadly speaking, there are three types or categories of bitcoin mining:

Individual Mining

When mining is done by an individual, they must register as a miner and download the requisite software. As soon as there are sufficient transactions to create a block, the algorithm problem is sent to all the users in the peer to peer network to solve. The first one to solve it gets rewarded with the current bitcoin allocation.

Once the solution is found, all the other miners in the blockchain network will validate the decrypted value and then add it to the blockchain. The transaction is thereby verified and cannot be subsequently changed.

Blockchain Pool Mining

Pool Mining

In pool mining, a group of users works together to approve the transaction. The complexity of the data encrypted in the blocks makes it difficult for any single miner to decrypt the encoded data alone. So, a group of miners works as a team to solve it. After the validation of the result, the reward is then split between all users.

Cloud Mining

Cloud mining eliminates the need for personal computer hardware and software as that's all taken care of by a third party offering cloud-based hardware and software as a service. It’s a hassle-free method to extract and verify blocks as the cloud miner owns the machinery and handles all of the admin.

While it is hassle-free, it has its own set of disadvantages as well. The operational functionality is limited and you the customer have no control. As a result, cloud mining is rife with scammers. Reward profits are generally low. Software upgrades are restricted and so is the verification process. Cloud miners typically offer a choice of plans, with rewards increasing with costs. But remember the old saying "if it sounds too good to be true, it probably is".

Acquiring Bitcoins

You can exchange fiat currency like US dollars for bitcoins, you can exchange other cryptocurrency for bitcoins or you can mine them. As described previously, users are rewarded in bitcoins for mining bitcoins because the mining process is how transaction blocks are verified and added to the blockchain. This mechanism is the essential pivot around which the bitcoin economy revolves. The cost and difficulty of mining bitcoins individually continues to increase while at the same time the reward reduces. At some point of time, mining rewards will almost certainly take the form of a transaction fee. Which will itself probably be paid in bitcoins by the people who initiated the transactions.

Uses of Blockchain Mining

1. Validating Transactions

Bitcoin transactions take place in huge numbers every single day. As cryptocurrencies function without any sort of  central administrator, foolproof authentication has to be built into the process itself. In other words, trust resides only in the blockchain. With fiat currency, trust is placed in a number of human actors, including government, banks, brokers and so on. So, what is the authentication method with such cryptocurrencies? With each transaction, new blocks are added to the blockchain in the network and the validation lies in the mining results from the blockchain miners.

2. Confirming Transactions

Miners work the blockchain mining process to confirm whether the transaction is authentic or not. All confirmed transactions are then included in the blockchain, which has never been hacked. However, it's up to the individual to keep their access codes to the blockchain secret. The concept of individual responsibility is paramount.

3. Securing the Network

To secure the transaction network, bitcoin miners work together. With more users mining the blockchain, the blockchain network security increases. Network security ensures that there are no fraudulent activities happening with the cryptocurrencies.

ASIC Bitcoin Miner

Dragonmint ASIC Bitcoin Miner

Application Specific Integrated Circuits (ASICs)

Originally, anyone with a halfway decent desktop or laptop computer could set themselves up as a bitcoin miner.

The ability of a computer to mine bitcoin can be calculated as its hashing power, which is directly related to how quickly (and efficiently, taking into account the cost of the electricity consumed) it could solve the hashing problem and validate the block.

Bitcoin miners then discovered they could get more hashing power from graphic cards. So for a while, all the top bitcoin miners were using computers with powerful graphic cards.

But sooner rather than later, even the most powerful graphic cards could no longer mine the blockchain efficiently. They have been replaced by computers specifically designed for crypto mining. They are called ASICs, which is an acronym for Application Specific Integrated Circuits. They can be thought of as bitcoin generators.

ASICs use a lot of electricity and are prone to over-heating. So you will usually find them in a thermally regulated data center in a location with low cost electricity. Until recently, this meant China.

Profitability Factors

The bitcoin price and the total network hash rate are the two main factors that will affect your profitability.

Here are the  important factors to take into account when you are wondering which bitcoin mining ASIC to buy:

  • Hash rate. How many hashes per second can the bitcoin miner make? More hashes cost more, which is why efficiency is crucial.
  • Efficiency. You’ll want to buy the most efficient bitcoin mining hardware possible. At the time of writing, this was the Bitmain AntMiner S5, but this can change rapidly as new models are developed. All bitcoin miners are big consumers of electricity. You need to acquire one that converts the most amount of electricity into bitcoins. The Bitmain AntMiner S5 generates a hash rate of roughly 1 GH/s for every 0.51 Watts, which equates to 0.51 J/GH. It is suitable for both hobby miners and entry-level home mining operations, with the added benefit of a low weight profile at just under 2.5KG. For more information on current ASICs, check out this article.
  • Price. How much does the bitcoin miner cost? Cheap mining hardware will mine fewer bitcoins, which is why efficiency and electricity usage are important. The fastest and more efficient mining hardware is going to cost more.

Don’t try to buy a miner based on only price or only hash rate. The best ASIC miner is the most efficient bitcoin miner. Aim for value.

In addition to a bitcoin mining ASIC, you’ll need some other bitcoin mining equipment:

  • Power Supply. Bitcoin rigs need special power supplies to make the most efficient use of the mains power electricity.
  • Cooling Fans. The ASIC hardware can easily overheat which will cause it to stop working, maybe as it's just about to crack the hashing algorithm. You need a sufficient number of cooling fans to keep your hardware working at all times.
  • Backup generators. You may want generators as a backup in case your main electricity supply goes down.

Mining as an Individual or as Part of a Group

Warning: It's usually the cost of electricity that makes most bitcoin mining unprofitable. That's why, until recently, most bitcoin mining was done in China, which has cheap electricity and a relaxed approach to pollution. If you go down this track, be sure to factor in the electricity cost.

Bitcoin Mining Setup

Purchase a custom mining hardware: You need to purchase an Application-specific Integrated Circuit (ASIC) miner to mine bitcoins. While purchasing an ASIC Blockchain miner, you should consider its efficacy in hashing power and take a note of its pricing policies.

Purchase a power supply: Blockchain miners consume a lot of power. So, get a dependable power supply which is compatible with the ASIC miner that you purchase.

Obtain a bitcoin wallet. Bitcoins are stored in digital wallets in an encrypted manner. This will keep your bitcoins safe. A bitcoin wallet has both a private key and a public bitcoin address. The private key is what you use to access your public key or bitcoin address and interface with the bitcoin network. You can get one from Bitcoin Wallet.

Secure the wallet. Since there is no ownership on bitcoins, anyone who gains access to your wallet can use it without any restriction. So, enable two-factor authentication and store the wallet on an external device such as a flash drive. Connect it to your computer with internet access only when you wish to trade.

Choose a mining pool. This is the best shot you can get to earn bitcoins easily. There are many mining pools which charge something like two percent of your total earnings. When you join, you create sub-accounts that can be used to track your contributions to the pool and therefore your proportion of the rewards. Here is a step by step process:

  • Connect the power supply to the ASIC blockchain miner, ideally via a UPS (Uninterruptable Power Supply).
  • Connect the ASIC blockchain miner to your modem/router.
  • Boot up your ASIC blockchain miner.
  • Enter your router’s IP address in a web browser.
  • Find "connected devices" in the router's miner page.
  • Find your ASIC blockchain miner and click on it to display the device information.
  • Copy and paste the IP address of your ASIC blockchain miner into your web browser.
  • Log in to the ASIC miner with the default username and password that are "Root" and "Root".
  • Select "Miner Configuration" to set up the miner according to your preferences.
  • Enter the URL, username, and password for your mining pool on the Miner Configuration page of the ASIC Miner.
  • Click ‘Save and Apply’ to save your credentials for future use.

Start mining and in periodic intervals check your profitability.

Whenever you witness a return on your investment, withdraw your earnings and put them in your own secure wallet.

Mining in the Cloud

Bitcoin Cloud Mining Powerful Computer

WARNING: Most bitcoin cloud mining offers are scams! Proceed down this track with caution.

Obtain a bitcoin wallet. Bitcoins are stored in digital wallets in an encrypted manner. This will keep your bitcoins safe. A bitcoin wallet has both a private key and a public bitcoin address. The private key is what you use to access your public key or bitcoin address and interface with the bitcoin network. You can get one from Bitcoin Wallet.

Secure the wallet. Since there is no ownership on bitcoins, anyone who gains access to your wallet can use it without any restriction. So, enable two-factor authentication and store the wallet on an external device such as a flash drive. Connect it to your computer with internet access only when you wish to trade.

Choose a cloud mining service provider. Cloud mining service providers allow users to rent processing or hashing power to mine bitcoins remotely. One such cloud mining service provider is Genesis Mining. Please note that this is not a recommendation. I have no experience with them. Always do your own due diligence.

Choose a cloud mining package. To choose a package, you will need to decide on how much you are willing to pay and keep your eyes open to the hashing power the package will offer. Cloud mining companies will mostly estimate your ROI (Return on Investment) based on the current market value of bitcoins.

Always put your earnings in your own secure wallet as described previously.