March 05, 2021

Bitcoin 101 - Mining bitcoin

In last week's blog post, we already got a glimpse of mining bitcoin when we explained how a bitcoin transaction works. We learned that mining is necessary to process transactions and remain a single source of truth regarding who owns what. Mining fulfills two more functions, which we'll explore in this blog post!
Bitcoin 101 - Mining bitcoin

Hello Humble Stackers! Welcome to our blog, we post company updates and selected Bitcoin stories here. Maybe even some new deals and special offers too!

Why do we mine bitcoin? ⛏️

Mining bitcoin fulfills multiple functions within the bitcoin network. As we saw last week, mining is necessary to confirm transactions so that the bitcoin network participants can transact with one another. Furthermore, bitcoin mining enables a fair issuance scheme for newly created bitcoin.

At a predetermined rate (embedded in the bitcoin source code), every new block contains some new bitcoin for the miner who finds the block. When Satoshi Nakamoto created bitcoin, the issuance rate was 50 bitcoin per block, halved every four years. This so-called "halving" occurs approximately every four years until all the 21 million bitcoin are issued.

However, the main reason why we need mining in bitcoin is to keep the network secure. Since the bitcoin network does not have a centralized power to show everyone who owns what, we need a decentralized network of computers that maintain this ledger. By design, bitcoin is only secure as long as at least 51% of the bitcoin miners behave honestly. Therefore, the more computers that mine bitcoin, the harder it becomes for anyone to cheat.

What are computers doing when they "mine"? 💻

Mainstream media occasionally refer to bitcoin mining as computers executing complex computations and make it sound more complicated than it is. The mining process closer resembles solving a Sudoku puzzle than any advanced calculation. Let's explore why!

Every computer that mines bitcoin delivers a certain amount of computational power. According to the network's overall computational network, miners calculate a number known as the "difficulty" every two weeks. This number ensures that a new block is created roughly every ten minutes despite miners joining and leaving the network.

Miners collect unconfirmed transactions from bitcoiners worldwide and create a summary of all these transactions (more commonly known as a "hash", check out this online tool to play around with the algorithm used in bitcoin). Together with some generic transaction data (metadata) and a random number (also known as "nonce"), they again hash these three data points.

The miners then compare this to the target number they calculate based on the previously mentioned "difficulty", also known as the "target". If the calculated hash is smaller than the target, the block is valid, and the miner broadcasts it to the rest of the miners. Once this happened, every miner checks if the block is valid, and every miner starts from scratch to mine a new block. If the calculated hash is bigger than the target, the miner changes the "nonce", creates a new hash, and again compares it to the target.

Currently, billions of attempts (of random numbers) and rehashing the data points are necessary to find a new valid block. Since bitcoin mining requires a lot of (computational) work, this concept is also known as "Proof-of-Work" (PoW). On the other hand, verifying whether a block is valid doesn't require a lot of energy at all. A miner inputs the three data points into the hashing function and checks if they get the same result as the miner who found the block.

Doesn't this sound similar to a Sudoku puzzle? They are also hard to solve but very easy to check if the provided solution is correct. As more miners join the bitcoin network, finding a valid block becomes harder (as the "difficulty" rises). You may compare this to an ever-growing Sudoku puzzle with more and more squares!

If you look at the transaction hashes of a few recent blocks, you'd probably see a similarity:

  • 000000000000000000078c54e2f33b11584c37c3fc61f1e966c698cab405b7b9
  • 00000000000000000005188933c5f8e73a84cfd7e356ed56d939e92a17fd5fe0
  • 000000000000000000067edc970ca2a111bf39e0d4db04c9d8dfabdadc0fcefc
  • 0000000000000000000bfde9e3b39cc8cdfb3757a7ede75f07adb7e4482f702b
  • 00000000000000000009759720df6cd9e2b9befd06ad67b73d838cc5887fce46

Exactly! They all start with a lot of zeros. Miners found these blocks after making billions of attempts of finding a hash lower than the target (the more trailing zeros, the better). They all tried to solve the "Sudoku" puzzle and show the rest of the miners their correct solution first.

Although this was a more technical blog post, we hope you've enjoyed reading about the bitcoin mining process. If you have further questions, don't hesitate to reach out to us!

More Bitcoin 101

We hope you’ve enjoyed our sixth blog post in the series “Bitcoin 101 - What is bitcoin?”. If you want to know more about the bitcoin mining process, stay tuned for the next blog post! We’ll be publishing one blog post every week answering many of the questions we’ve heard from our Stekking users who are new to bitcoin:

  1. What is bitcoin?
  2. How and where can I buy bitcoin?
  3. How and where can I use bitcoin?
  4. Where should I keep my bitcoin stored safely?
  5. How does a bitcoin transaction work?
  6. How does bitcoin mining work?
  7. What are the advantages and disadvantages of using bitcoin?
  8. What is a blockchain and how does it work?
  9. How does bitcoin compare to other cryptocurrencies?
  10. Why should I want to have bitcoin?

Share Article

Stay in the know

Register and get updated on the latest news about

Register Now