Blocks, Mining and Forks

Blocks, Mining and Forks: Key Concepts

Our new blog series ‘School of Block” continues with a look at three key terms of the cryptocurrency world. Today we look at blocks, mining and forks three of the concepts that are at the very base of cryptocurrency. By the end of this article, you’ll know enough to understand these concepts how blockchain tech and crypto works, and maybe even enough to start mining! Our aim is to be the best cryptocurrency exchange in Canada, and educating our users is a great way to do it.

Hot On The Block

A block is a record of all the transactions that have recently taken place on a blockchain. To understand how they work, their importance, and how they keep the entire bitcoin system running, we can go back to the beginning of bitcoin.

When bitcoin was launched by Satoshi, he created 50 bitcoins, and sent them to his address. He shared the earliest bitcoin software with some other people who were working on similar projects, and they began to run the bitcoin software as well.

Soon after, Satoshi sent Hal Finney, another pioneer in cryptocurrency, ten bitcoin. This was the first transaction on the bitcoin network, and hence the first block on the blockchain was mined.

The First Transaction

At this point, Satoshi’s bitcoin address was debited 10 bitcoin, and Finney’s address was given 10 bitcoin. For this change to actually go into effect, it needed to be changed in the distributed ledger.  At the time, there were maybe 100 people running the bitcoin software – a bitcoin node – on their computer.

Broadcasting Blocks

Each new block that solves the problem also verifies the accuracy of the last block, creating a chain of verification – “a blockchain” – where each block lends more credibility to all the previous blocks. The older a block, the more trustworthy the information in that block is. To understand how the blockchain works, you need to have a little understanding of the cryptography that secures it. If it wasn’t already obvious, the term “cryptocurrency” comes from “cryptography” and “currency.”

Where does the transaction go?

Any transaction, (something like “Satoshi sends Finney 10 bitcoin”) gets broadcast across the bitcoin network to all the other computers/nodes. All of these nodes then update their ledgers to reflect the changes at the address (Satoshi has 40 bitcoin, and Finney now has ten). All of the nodes agree that this is a legitimate transaction – that each address has the correct amount of bitcoin attached to it. Now, this needs to become permanent somewhere. If you are looking to try this out and see it in action, make a purchase on Bitbuy, the best place to buy Bitcoin in Canada, then click “view on blockchain”. You’ll see a record of your transaction on the publicaly available blockchain records.

Mining

Creating a permanent record is where “mining” comes in. Satoshi created the first 50 bitcoins, and sent some to Hal Finney. But, the system isn’t very useful if it’s just a group of people sending the same 50 coins around. So, every 10 minutes, the system awards new bitcoins to the node that can solve a complex math problem. Inside part of this math problem is an updated copy of all the newest transactions that occurred, so that they may be permanently stored. The problem is a “cryptographic hash” of all this information.

Hash It Out

A cryptographic hash is kind of like the Cryptoquote puzzles in a newspaper – some information (a famous quote, in the puzzles) is hidden inside a secret code. In the case of bitcoin, the problem is a lot harder than swapping some letters, and requires a computer processor to run through millions of potential solutions. There are multiple solutions to each problem, but the first node to solve the problem gets to publish the solution, and wins the reward: some new bitcoin.

Know Your Nodes

Nodes that are running the software to solve these problems are called “miners,” because their computers are chipping away at a problem, hoping to be rewarded with digital gold in the form bitcoin. Miners solving these problems are what keeps the network running and secure, as we’ll see soon.

Mining Limits Supply

The network will stop creating new bitcoins when there are 21 million in existence. New bitcoin can only be created by mining, and the rewards for mining get smaller over time. More than 80% of these 21 million coins have already been created. When the network started, the reward was 50 bitcoins. At the moment, the reward for solving the puzzle and publishing a block is 12.5 bitcoins. Around 2140, the reward will be .00000002 bitcoins. After that, there will be no more reward for mining, and the network will need to find another way to incentivize miners to publish new blocks (possibly transaction fees).

Mining Problems: Now vs Then

When bitcoin began, the mining problems were relatively easy to solve, and the rewards were greater. Any PC on the network had a reasonable chance of cracking the code, and winning 50 bitcoin (the reward is currently 12.5 bitcoin). Now that bitcoin has become so popular, the problems have also become a lot harder to solve. This is because the system is set up to reward new bitcoin every ten minutes. Now that there are so many more mining nodes on the network, (about 100,000) with much more processing power, the math problems need to be more difficult to keep the network busy trying to solve the question for about ten minutes.

Now, instead of personal PCs, highly specialized mining computers (aka ASICs – application specific integrated circuits) need to be used in order for someone mining to have a chance at being rewarded. These units draw a lot of power, require special attention to their cooling, and often have to be pooled together (in a “mining pool”) to have a reasonable chance of being rewarded with bitcoin.

Is Mining Harmful To The Environment?

The mining system is a major point of criticism for bitcoin. Mining is very energy intensive, meaning bitcoin has a huge energy and CO2 footprint. Certainly, Bitcoin mining requires tremendous computer power that uses a lot of energy, so this is a logical conclusion.

Other cryptocurrencies have devised ways to mine/ reward their coins with less expensive equipment and less energy use. Litecoin is an example of this.

However, Coincentral wrote a fantastic piece comparing the costs of Bitcoin mining on the environment. When looking at the environmental cost of Bitcoin’s “competitors”, the gold and banking industries are actually much more harmful to the environment.

H/T Coincentral

What the Fork?

Now that you know about mining and cryptocurrency, let’s moved on to some more advanced concepts. In software, to “fork” a project, or some code, means to copy some original software code, and make improvements or changes to it. As most software changes over time with new features and bug fixes, “forking” can be seen as a way to take pieces of open-source work and give them new, creative uses. It is often expected that someone forking code makes some contribution back to the base (original) code, like fixing any bugs that they find. These improvements can then be implemented so that any future developers forking the base code don’t need to re-invent the wheel.

Forking is Not Theft

Developers maintain open-source projects and libraries of code, so that other developers can re-use bits of their work for new uses and creative applications. These come with varying licenses, like the MIT License that Bitcoin was released under, which permits anyone to copy the code for any reason. Other software, like Google’s search algorithm, or Facebook’s news feed code, are protected under copyright, and can definitely not be forked legally.

Hard Forks – When Cryptocurrencies Break Up

Scuffles in other cryptocurrencies have led to currencies being split in two, known as a hard fork. One of the most well-known examples of this was when Ethereum “Classic” split away from the original Ethereum when a hacker stole $50 million in ether from Ethereum’s DAO (Decentralized Autonomous Organization). Most ethereum miners realized that a hack of that scale was bad for the community and a growing cryptocurrency, and revised the blockchain to give the funds back. The majority of ethereum supported this fix.  A smaller group took the stance that “that’s part of the game,” and forked the network to basically start over from the point of the theft, legitimizing the hack. At the time of writing, and 30 months after the hack, Ethereum Classic now has about 3% the market cap of Ethereum.

Soft Fork

Another type of a fork that a cryptocurrency or blockchain can undertake is a soft fork. A soft fork is a method of upgrading a blockchain that is backward compatible with previous versions of the same blockchain. Unlike hard forks, soft forks do not require nodes on the network to upgrade to maintain consensus. All blocks on the soft-forked blockchain follow the old set of consensus rules as well as the new ones.

An example of a soft fork would be the implementation of a new rule changing the network block size from 1MB to 500KB. enforce the new consensus rule of 500KB.

Famous Forks

When Bitcoin Cash hard forked from Bitcoin, it aimed to solve the scalability problem: With bitcoin blocks being capped in size (1MB), and a new block being created every ten minutes, there was a limit to how many transactions could be included in each block. This worked out to (roughly 5 transactions per second). Occasionally, more activity on the network would cause a backlog of transactions, and transaction fees would soar as users had to pay their way to the front of the line. Bitcoin Cash wanted to solve this by changing the transaction size to 8MB, meaning, 8x as many transactions per block. The original Bitcoin has tested or implemented a number of technologies to solve this scalability problem: Lightning Network and SEGWIT being two of the most well-known solutions.

Wrapping Up

As you can see, the tech behind cryptocurrency and how its created isn’t as simple as it may have seemed. We hope you enjoyed the article and will continue to learn with us on our School of Block blog series!

Want to learn more? Check out our full Bitbuy Resources section including more School of Blog posts, podcasts, and the latest news from the cryptocurrency and blockchain industries.