AD elektro Star Wars

How bitcoin mining works and how to do it profitably

Catalogue

Article

Updated

Bitcoin has been around for more than 10 years now, but there’s still a lot of confusion and misinformation about it, particularly when it comes to mining. It’s common to see mining described as a way to earn “passive income”, or as an environmental disaster due to the network’s energy consumption. Neither description is very accurate. In this article, we’ll take a no-nonsense approach to explain Bitcoin mining and bust the common myths about it. Then we’ll tell you what it really takes to make money mining Bitcoin in 2019 and beyond.

How Bitcoin Mining Works And How To Do it Profitably? – Overview

  1. The Basics of Bitcoin Mining
  2. Proof of Work (Cost) and Block Rewards (Revenue)
  3. How expensive is it to attack Bitcoin?
  4. How to Make Money Mining Bitcoin in 2019 and Beyond
  5. How to Buy Cryptocurrency Mining Machines
  6. The Factor No. 1 in Mining Profitability
  7. Bitcoin Mining Pools
  8. The Future of Bitcoin Mining
  9. Set Up a Mining Account
  10. Last Thoughts

The Basics of Bitcoin Mining

Bitcoin mining is a complex topic that can’t really be learned deeply in a single day, let alone through a single article. With that being said, you can at least understand it on a high level if you know a few basic principles about how it works.

Jak funguje tezba bitcoinu
The whole issue about bitcoin minig is very complicated. At least we will try to briefly give you an idea of it.

In a nutshell, mining is how people get paid to process Bitcoin transactions. They simply power up some computers, connect them to the network, and have the opportunity to earn revenue by batching a bunch of validated transactions together and broadcasting them to all the other miners. The batch of transactions is like a page in an accounting book, but in the cryptosphere it’s a block in the blockchain instead. And if the block a miner finds gets accepted by the majority of other miners and added to the chain of blocks containing the entire history of transactions, the miner makes money. Of course, outside of the nutshell, it’s a bit more complicated than that.

Proof of Work (Cost) and Block Rewards (Revenue)

First, let’s talk about Proof of Work (PoW), as this is perhaps the most important concept in Bitcoin mining. The idea of PoW is that every single computation a mining machine performs consumes some electricity, which makes mining resource-intensive (i.e. costly). As a result, there is a strong economic incentive against attacking Bitcoin: it would cost a lot of money.

On the other hand, there is also an economic incentive to encourage mining. That is, the block reward: a transaction in every block that sends newly created bitcoins along with all of the block’s transaction fees to the miner who successfully solves a puzzle and “finds” the block.

Jak funguje tezba bitcoinu
Attacking Bitcoin with anything less than 50% of the total mining power will fail.

i

Together, these two principles motivate people to mine because they can earn revenue, while also motivating them not to attack Bitcoin because doing so can be extremely expensive.

To illustrate this, let’s go through an example from the point of view of a potential attacker. In order to successfully take control of the Bitcoin blockchain, an attacker would need to have more than 50% of the total mining power in the network. (We’ll provide more context on what 50% actually looks like later in this section.)

The reason for needing over 50% is that Bitcoin has some consensus rules so that miners can agree about the state of the Bitcoin transaction ledger even though they are spread out around the world and don’t directly communicate with each other. For example, one of these rules is that a transaction should only be considered valid and get added to the blockchain if the sender has enough funds in their wallet to cover the amount being sent. In other words, the rule just says the obvious point that nobody can spend money that they don’t actually have.

BLOCKTV – Mining industry maturing despite challenges – Jan Čapek (Braiins co-CEO)

So, if a person or group of people wants to confirm a transaction that isn’t technically valid (i.e. a double spend in which they attempt to spend the same bitcoins twice), they need to control the majority of the mining power and therefore do a majority of the Proof of Work. Even then, such behavior is quite risky for an attacker as the rest of the network may reject a chain containing any fraudulent transactions and a split (called a “fork”, as shown in the image in the next section) may occur, after which there are two chains and the coins on the chain containing fraudulent transactions may be valued significantly lower or even be worthless.

How expensive is it to attack Bitcoin? 

Now let’s run some numbers so you get an idea for what this actually looks like.  First, you need to know that the base unit for a single Bitcoin mining computation is 1 hash, which is like plugging a number into an algorithm and running the algorithm 1 time. For some perspective, a high-end laptop (for gaming) will have a processing capacity of about 20 Mh/s (i.e. 20 million hashes per second). At the time of writing (Nov. 2019), the total mining power of the Bitcoin network is around 100 Exahash/s (1 018 h/s), meaning that an attacker would need to control at least 50 Eh/s of mining power in order to be successful. Imagining that we had unlimited access to high-end laptops with 20 Mh/s of mining power each, we would need 2.5 trillion laptops to produce 50 Eh/s.

Jak funguje tezba bitcoinu
Attacking Bitcoin with less than 50 % mining force won't be successful.

i

If we assume that the attacker is using the most popular mining machines today –  which produce about ~14 Terahash/s of mining power while consuming ~1370 Watts – then they would need more than 3.57 million devices to control 50% of the total mining power.

As for cost, they would be consuming about 5 billion Watts to run all the machines, which would equate to 5 million kWh (for a 1-hour long attack). Assuming they have access to that much power at the relatively cheap price of US 0.10 USD/kWh, the cost of sustaining such an attack would be approximately 500,000 USD per hour, or 12 USD million per day. Maybe more significantly, the initial cost of purchasing 3.57 million mining machines (at about 450 USD a piece) would be 1.6 USD billion. And there even more costs involved, such as power supply units (PSUs) for distributing electricity to the machines, not to mention the cost of renting or buying the actual facility where all of the machines are setup.

Jak funguje tezba bitcoinu
If you want to attack Bitcoin, you will need huge computational power and your own power station.

This is exactly why Proof of Work is so important to Bitcoin. Where past currencies were backed by gold and modern currencies are backed by government mandates, Bitcoin is backed by the physical energy consumed to keep it secure.

Finally, we should mention that the incentive to attempt an attack like the one we’ve illustrated above is practically nonexistent. It would likely cause the value of Bitcoin to drop rather steeply, making it very difficult to earn back the significant amount of money invested into the attack. The only logical reason for attacking Bitcoin at this point in time would be a state (e.g. China, USA, etc.) trying to eliminate it as competition for their fiat currency.

Recapitulation: the most important facts about bitcoin mining

In summary, these are the three most important takeaways you should understand about Bitcoin mining before considering whether or not to try to mine yourself:

  1. Mining costs money because it consumes a lot of electricity and because the machines that you use to mine are costly and limited in supply.
  2. Earning revenue as a miner is only possible if you follow the consensus rules in sync with the rest of the network participants. No cheating!
  3. More mining power in the Bitcoin network makes it more expensive to attempt an attack on Bitcoin.

With those principles in mind, let’s now dive into the mining industry today and what it takes to mine profitably.

How to Make Money Mining Bitcoin in 2019 and Beyond 

There are a lot of factors that determine whether or not Bitcoin mining will be profitable, and we’ll review all of them in this section. First, however, we should start with an overview of the cryptocurrency mining industry’s history.

History of Cryptocurrency Mining Hardware

In the early days of Bitcoin (~2010), you could effectively mine with a regular old CPU. You would simply download the Bitcoin software on your laptop or desktop and start mining. As more people joined the network and the total mining power increased rapidly, GPUs became more popular. This is because GPUs (graphic processing units) are more specialized than general purpose CPUs, making them more efficient at continuously performing similar computations as is the case in cryptocurrency mining.

The days of GPU mining for Bitcoin were also short-lived. Nowadays the entire industry is dominated by specialized devices, called ASICs (application-specific integrated circuit). An ASIC is a type of computer that is extremely good at performing a single, specific task – in this case, Bitcoin hash computations. In comparison, GPUs are much less specialized, as they have multiple purposes such as rendering high-resolution video or computer game graphics.

Jak funguje tezba bitcoinu
Historical chart of Bitcoin’s hashrate and hardware progresses since 2010.

When it comes to cryptocurrency mining, specialization makes all the difference. Such a difference, in fact, that it hasn’t been profitable to mine Bitcoin without an ASIC since 2013. In other words, the cost of electricity to power a CPU or GPU is higher than the revenue you can earn by mining Bitcoin with one.

How to Buy Cryptocurrency Mining Machines

As for Bitcoin and the other ASIC-mineable cryptocurrencies, one big obstacle you’re likely to face if you want to start mining is a difficulty finding affordable hardware. For example, there are currently only a few major players developing and producing ASICs for cryptocurrencies that are mined with the SHA-256 algorithm (e.g. Bitcoin):

  • Bitmain – latest ASIC: Antminer S17 (3 000 USD, 56 Th/s, consumption 2 520 W)
  • MicroBT – latest ASIC: Whatsminer M20S (2 700 USD, 68 Th/s, consumption 3 360 W)
  • Canaan – latest ASIC: Avalonminer 1066 (1 800 USD, 50 Th/s, consumption 3 250 W)
  • Ebang – latest ASIC: EBIT E11++ (2 400 USD, 44 Th/s, consumption 1 980 W)
  • Innosilicon – latest ASIC: T3 + (2 150 USD, 52 Th/s, consumption 2 200 W)

i

This is actually a far more competitive landscape than it was just a couple of years ago, which is encouraging. However, it should be mentioned that all 5 of the above manufacturers are based in China.

It’s also critical to keep in mind that there is an extremely high demand for efficient ASICs and – with so few manufacturers – a limited supply. Unless you have a large operation and establish personal relationships with manufacturers, you’ll likely have to pay full retail price for machines and lose precious time waiting for them to be delivered from China. Not only that, but it’s common for manufacturers to only accept payment with cryptocurrencies, so you may need to purchase a large amount of Bitcoin through an exchange just to be able to buy some machines.

Jak funguje tezba bitcoinu
GPUs on Alza.co.uk – however, all of them are not suitable for bitcoin mining.

The goal of saying this isn’t to discourage mining, but rather to make sure you have a realistic understanding of what it takes to actually make money mining Bitcoin given the modern landscape. Acquiring hardware that enables you to compete with other miners around the world is an essential but quite difficult step to take if you are new to mining. And even if you do manage to make a purchase, you’ll have to research extremely thoroughly to ensure that you can be profitable even as newer ASICs hit the market and the competition increases.

i

Although the days of CPU and GPU mining are over for Bitcoin, that isn’t the case for many other cryptocurrencies. For example, notable coins including Ethereum, Ethereum Classic, and Monero are all minable with GPUs today. However, we should note that it’s on the Ethereum roadmap to eventually stop Proof of Work mining altogether and shift to an alternative consensus model called Proof of Stake. That’s a topic for another article, but the point is that you should research deeper into the Ethereum project and current status before planning to mine it.

The No. 1 Factor in Mining Profitability

Acquiring mining hardware is a costly and essential step in becoming a miner, but it isn’t the most important factor to determine long-term profitability. Ultimately, we can consolidate the biggest factors influencing the success of a mining operation into the following four points:

  • Cost of hardware (e.g SHA-256 ASIC miners)
  • Market price of Bitcoin
  • Difficulty to mine
  • Cost of electricity

We’ve already talked about the first one, hardware. Now let’s go through the rest of the factors. Perhaps the most obvious factor in profitability is the market price of Bitcoin mined, which is what determines your potential revenue. A somewhat less obvious but equally important factor is the mining difficulty, which refers to the average amount of computations that are required in order for somebody to find a new block.

Difficulty is directly proportional to the total mining power of the network, meaning that the more mining power there is, the more difficult it is to find a block. When more machines go online, the difficulty adjusts higher so that more mining power is required to find a block, thus keeping the speed of block production consistent over time. In other words, difficulty increases proportionally to the total mining power of the network so that blocks are produced at the same rate (e.g. every 10 minutes for Bitcoin) year after year.

Jak funguje tezba bitcoinu
The most popular ASIC mining machine in the world with open-source Braiins OS firmware.

But it’s the final factor, cost of electricity, that is by far the most important when it comes to mining profitability. This is because the majority of daily operational costs for any miner come from paying for the electricity to power the mining machines.

In fact, this is also the reason why Bitcoin mining isn’t nearly as bad for the environment as some people and media outlets claim it is. The cheapest electricity is the surplus energy produced from renewable sources such as hydroelectric dams, solar panels, and wind farms, and this is exactly the electricity that is most commonly used for Bitcoin mining.

On that subject, famous venture capitalist, Peter Thiel, recently made headlines by contributing 50 USD million to a mining startup called Layer1 in Texas. The US hasn’t been competitive in Bitcoin mining for many years due to a lack of cheap electricity, but large wind farms in Texas provide an opportunity for Layer1 to run an efficient operation that can compete with miners in other parts of the world, namely China.

Jak funguje tezba bitcoinu
Renewable energy powers the majority of the Bitcoin mining network.

Recapitulation: profitable bitcoin mining

  1. Most Bitcoin mining is done with cheap renewable energy
  2. Electricity costs are the most important factor that determines your mining profitability

The market price of the coin being mined and its difficulty are practically the same for all miners at any given time. Hardware costs are negotiable, so they can vary a bit more, but ultimately they’ll be similar for every major player. That’s why it’s a miner’s electricity cost that determines how profitable (or unprofitable) they can be.

Bitcoin Mining Pools

Another important fact to know about Bitcoin mining is the existence of mining pools. Since mining is a highly competitive and risky business, it’s possible for miners who have a relatively small portion of the total network mining power to operate for days or even weeks at a time without finding a block. Just imagine spending 5 USD on electricity in a day and not earning any revenue.

Jak funguje tezba bitcoinu
For small miners is very profitable set up their mining force into the „pool“. By the pool they increase the chance on regular income.

To minimize this risk, the majority of miners “pool” their mining power together with other operators to improve the stability of revenue, similarly to a lottery pool in which a group of people aggregate their tickets to increase their chances of winning. When any member of the pool finds a block, the revenue is split among all of the members proportionally to the mining power each has committed. This way, every miner makes less per payout but the payouts are far more frequent, which is preferable for business owners to cover operating costs.

The first ever mining pool is called Slush Pool and was founded in Prague in 2010. Today, it’s operated by a company called Braiins and remains the largest pool outside of China. Meanwhile, Braiins is also an industry leader in open-source software development for mining devices. For this reason, we recommend Slush Pool to all prospective Bitcoin miners because it’s not just a local company but also the most established and trusted pool in the entire industry.

Jak funguje tezba bitcoinu
Homepage of Slush Pool – the original Bitcoin mining pool.

As with hardware manufacturers, the majority of mining pools are currently located in China. This is considered by many people to be the least decentralized aspect of Bitcoin because more than 50% of the total mining power is going through just a few closely-related pools. However, the work Braiins is doing aims to change the core mining protocol used by miners and pools throughout the industry, solving the centralization issue with pools in the process.

The Future of Bitcoin Mining

The Bitcoin mining stack refers to all of the software involved in mining BTC. It includes firmware on the ASIC machines themselves, as well as a protocol to connect the ASICs with other mining infrastructure, such as pools.

Tweet by Jackson Palmer about publishing new version of Stratum protocol for mining Bitcoin.

Due to limitations of the current Bitcoin mining protocol (i.e. communication protocol connecting pools and miners), called Stratum, Bitcoin is not as decentralized as it can be. This is because the mining pools have the sole ability to select which transactions are added to blocks, while actual miners themselves just have to confirm whichever transactions their pool selects.

To solve this issue, Braiins has developed a major upgrade: Stratum V2. This version of the protocol allows miners to choose their own transaction sets instead of pools, further distributing power in the network and improving decentralization. Not only that, but Stratum V2 greatly reduces physical infrastructure costs by improving data efficiency of the protocol by about 10×.

Jak funguje tezba bitcoinu
Control your entire mining operation from your laptop, easily monitoring your performance and payouts.

In addition to the Stratum project, Braiins has also been developing two firmware components for the ASIC machines themselves: Braiins OS and bOSminer. Together, these components connect miners to the Bitcoin network and distribute mining work to each of the specialized SHA-256 computing chips in the ASICs. Both of these projects from Braiins are completely open-source, aiming to bring greater transparency and standardization to mining.

The necessity for open-source firmware became apparent in 2017, when one of the major ASIC manufacturers covertly included an efficiency improvement in their firmware called AsicBoost. Since the manufacturer didn’t tell anybody about it, they could effectively mine at a 10-15% more efficient rate than anybody else. Once this was discovered, Braiins quickly began working on an open-source alternative that people could trust instead of the factory firmware being developed behind closed doors by manufacturers.

Jan Čapek (Braiins co-CEO) on the open-source initiative in Bitcoin mining – Stratum V2, Braiins OS and bOSminer.

The necessity for open-source firmware became even more clear when the same manufacturer, Bitmain, introduced a backdoor called Antbleed into their firmware that enabled them to track every machine sold and even shut off mining remotely.

i

With Stratum V2, Braiins OS, and bOSminer, the entire Bitcoin mining stack will be transparent and open-source. This is a significant step forward for Bitcoin as a whole, as it makes the network more secure, decentralized, and robust. It’s all the better that Braiins is based in Prague (just like us), bolstering our claim that Prague is the Bitcoin capital of Europe.

How to Get Started Mining

Starting a profitable mining operation will not be an easy task, especially if you live somewhere with expensive electricity. That being said, there are ways to get involved regardless of where you live and what you pay for power.

The first thing you should do is find out your electricity cost per kWh and research mining machines that you can purchase. You don’t have to limit yourself to only the latest machines, as many people sell used ones for steep discounts. Then, once you have some numbers, plug them into a Bitcoin mining profitability calculator (example) and see what the results are.

Jak funguje tezba bitcoinu
Free to use Bitcoin mining profitability calculator.

If the calculation produces a positive outlook, then it’s worthwhile to look more seriously into setting up an operation. You’ll want to figure out how many machines you can buy, how you’ll supply them with power, how you’ll cool them, and so on.

i

On the other hand, if your calculations come back with poor results, then you can consider an alternative option such as purchasing hashing power on a secondary market. This essentially means that you agree to a contract with somebody else who operates and maintains the physical mining operation, while you get to choose what to do with the actual mining power.

Finally, if you want an even more passive strategy, you can purchase a cloud mining contract in which you pay an up-front fee that guarantees you a certain amount of mining power for a specific time period. However, this method does not guarantee a set payout, because factors such as difficulty and the coin’s market price are unpredictable. Therefore, you should be aware of the risk to not get a positive return on your investment before entering a cloud mining contract.

Set Up a Mining Account

Once you have some machines or purchased hashing power on a secondary market, you’ll want to set up an account with a mining pool. We’ll use our local project, Slush Pool, as an example.

  1. Slush Pool makes this extremely easy, as you can set up an account with just a username, email, and password. No other personal information is needed.
  2. Jak funguje tezba bitcoinu
    Sign up form to Slush Pool – the world's first Bitcoin mining pool.
  3. Open your ASIC’s user interface (e.g. Braiins OS dashboard) and paste the pool’s URL to the appropriate location to start submitting your mining work to the pool.
  4. Jak funguje tezba bitcoinu
    ASIC’s settings interface, with open-source Braiins OS firmware instead of a stock closed-source system provided by manufacturers.
  5. Start mining and manage your operation from the dashboard.
  6. Jak funguje tezba bitcoinu
    Slush Pool dashboard interface – all mining related data points presented in one clear and easy to use graphical interface.

Last Thoughts

The days of mining cryptocurrency as a nerdy hobby are long gone. Nowadays, mining is a highly competitive business full of risk and strategy. If you have the will and business acumen to compete, it can be engaging and profitable. But it certainly isn’t a business model for the faint of heart.

i You might be interested in:
1. How to star mining cryptocurrency?
2. SAFE Network (ALL YOU NEED TO KNOW)
3. Hardware Wallets - How to Update Your Firmware.
4. Bitcoin.
5. STORJ: Everything you need to know.

In the end, Bitcoin and other Proof of Work cryptocurrencies can’t exist without a large network of miners spread across the world. This is what makes them resilient to attacks. If Bitcoin continues to grow in the following years as it has during the past decade, there’s no doubt that it will soon pose a serious threat to the monetary control of nation states such as America and the EU. When that day comes, it’s the miners that will ensure that no government or institution can kill Bitcoin.


Daniel Frumkin

Daniel Frumkin

Daniel Frumkin creates technical dokumentacion and is a part of business development in Braiins (Slush Pool & Braiins OS). He is also author of book about blockchain technology. Nowadays he works on technical specification of Stratum V2 protocol. Twitter: @dfrumps

4.5 16×
Viking USB Flash Drive 16GB 4v1 Silver
Flash Drive - USB 2.0 and Lightning, USB-C and Lightning, capacity of 16GB, write speed up to 20MB/s, read speed up to 30MB/s, OTG, durable, with key loop, metal, silver colour
27.90 €
Buy
In stock 1 pcs
Order by midnight, get it at the AlzaBox in the morning.
Info
Order Code: VKNG071
4.8 468×
TREZOR Bitcoin Wallet Black
Hardware Wallet - coded, OLED display 128 x 64, easy to use with Windows, OS X, and Linux, USB
59.90 €
Buy
In stock > 5 pcs
Order by midnight, get it at the AlzaBox in the morning.
Info
Order Code: TREZBIT1
4.8 468×
TREZOR Bitcoin Wallet White
Hardware Wallet - encryption, OLED display 128x64, easy to use, compatible with Windows, OS X, Linux, USB
59.90 €
Buy
In stock > 5 pcs
Order by midnight, get it at the AlzaBox in the morning.
Info
Order Code: TREZBIT
4.8 95×
TREZOR T
Hardware Wallet - encryption, supports 500 currencies, USB-C, microSD, Password Manager
179.90 €
Buy
In stock > 5 pcs
Order by midnight, get it at the AlzaBox in the morning.
Info
Order Code: TREZBIT1d
Print
P-DC1-WEB19
We will call you and advise you professionally
+420 225 340 120
Order inquiry
Question about the product
Please enter your telephone:
Call me
We care about your privacy Alza.cz a. s., Company identification number 27082440, uses cookies to ensure the functionality of the website and with your consent also to personalisage the content of our website. By clicking on the “I understand“ button, you agree to the use of cookies and the transfer of data regarding the behavior on the website for displaying targeted advertising on social networks and advertising networks on other websites.
More information Less info