After my previous post about the history of bitcoin and the Bitcoin blockchain, I wanted to get a better understanding of how bitcoin and the Bitcoin blockchain work and to share this with you. Please note that I purposely distinguish between bitcoin and Bitcoin. The reason I do this is that bitcoin refers to the cryptocurrency “bitcoin” and Bitcoin refers to the software that facilitates the transfer and safekeeping of bitcoin, the currency. In this post, I take bitcoin and the Bitcoin blockchain as an example but the main concept works the same for every blockchain of any cryptocurrency.
Blockchain
Bitcoin’s blockchain is a distributed, cryptographic and fixed database that uses proof of work to keep the ecosystem in sync. The Proof of Work (PoW) is the original “agreement” algorithm in a Blockchain network. This algorithm is used to confirm transactions between sender and receiver. The PoW deals specifically with how transactions are grouped in blocks and how those blocks are chained together to create Bitcoin’s blockchain. Blockchain is fully decentralized and distributed across peer-to-peer networks. I’ll get back to the Proof of Work later in this post.
Peer-to-peer (P2P)
Peer-to-peer networks are a special kind of distributed system. They consist of individual computers (also called “nodes”) that make their computational resources (process power, storage capacity and data/network bandwidth) directly available to all other members of the network without a central point of coordination: it’s fully decentralized. All nodes in the network are treated as equal concerning their rights and roles in the system. Additionally, they are both suppliers and consumers of resources. Peer-to-peer systems have very useful applications like file sharing, content distribution and privacy protection. The more users or customers use the peer-to-peer software, the larger and more powerful the system becomes. Let’s find a good example of a peer-to-peer system now.
In the ’90s, you bought music in a physical shop in the form of CDs. CDs were pretty pricy and one of the reasons for this was all the middlemen that were between the producer and the consumer inside the CD supply chain. In 1999 a guy named Shawn Fanning tinkered about the idea of sharing this music with other people all over the world with help of the internet, eliminating all the middlemen (but unfortunately also the artists) in the process. Together with his coworkers, he developed a software program that enabled a peer-to-peer system for sharing music. The software was called Napster and kicked off the era of multimedia piracy. Piracy still exists but with parties like Netflix and Spotify, this is far smaller than back in the late ‘90s/early ‘00s. With parties like Netflix and Spotify, artists are getting paid now but the middlemen are kept out of the supply chain. Even without all the middlemen, the system still works nowadays: access to music and movies/TV series for a decent price for the consumer and a good reward for the artist.
Now back to the financial service system. I think it’s crazy how many middlemen are involved in simple financial transactions. The big advantage of peer-to-peer systems is that direct interactions occur between contractual partners instead of indirect interactions through a middleman which costs money but also time. This reduces processing time and costs: like the access to music and movies/TV series. The Napster example shows that peer-to-peer systems have the potential to reshape whole industries based on the idea of replacing the middleman with peer-to-peer interactions.
I think that peer-to-peer systems can replace a lot of unnecessary supportive services like payments, money-saving, loans, insurance, validations of birth certificates, passports, driving licenses, identity cards, educational certificates, IP/patents and labor contracts.
The verification of transactions
Because everyone can tap into Bitcoin’s blockchain at any place to see the record of debits and credits between different accounts, the blockchain creates a system of global trust. Everything is completely transparent so everyone is on the same level of playing field.
Every transaction recorded in Bitcoin’s blockchain must be cryptographically verified to ensure that people that try to send bitcoin are really owning the bitcoin they send. The transactions are not added one at a time but in “blocks” that are “chained” together. This also explains the name “blockchain”.
Information can only be added to the Bitcoin blockchain over time and cannot be deleted. So once information is confirmed in Bitcoin’s blockchain it is permanent and can’t be erased or reversed.
For the Proof of Work, you need computers, called miners. They use PoW to compete with one another to get the privilege to add blocks of transactions to Bitcoin’s blockchain: this is how transactions are confirmed. Every time a computer (miner) adds a new block to the chain, it gets rewarded in bitcoin for doing this. That is the reason why the computers are competing with each other: to receive income in the form of bitcoin.
The miner only gets paid when all the other computers in the peer-to-peer network agree with the transaction and the ledger. When someone tampers with the ledger, the network won’t agree because it will not match with the ledgers that the other peers have. The award will be refused then and the next miner gets the award after all peers compare their ledgers agree on the added block and the full ledger. This way authenticity is guaranteed.
Mining
In the Bitcoin network, the goal of a miner is to add individual blocks to the blockchain. In order to do so, a miner needs to do two things:
- Verify one megabyte (MB) worth of transactions. In theory that can be a single transaction but in most cases it is more often several thousand: this depends on how much data each transaction stores;
- To add a block of transactions to the blockchain, miners need to solve highly sophisticated mathematical puzzles. This is the actual Proof of Work. What they do is come up with a 64-digit hexadecimal number which is called “hash”. The hash needs to be less than or equal to the target hash. The miner’s computer spits out hashes at different rates, guessing all possible 64-digit numbers until they arrive at a solution. It’s pretty close to throwing the dice and hope you get the numbers you want (sort of a gamble).
Many miners all over the world compete to add each block. The miner who solves the problem will add the block, along with its approved transactions, to the blockchain. The winning output of this contest is called “the golden hash”, hence the name that bitcoin is the new gold. The miner that produces this golden hash is awarded for its work (currently) 6.25 bitcoin (or in the case of another blockchain, another type of cryptocurrency). As of today, this would mean that the golden hash is rewarded with 237.5K€.
But stop: stay here! Don’t run away and try to start setting up a bitcoin mining business with your computer or mobile phone. In 2009 when it all started this was possible but nowadays you need expensive hardware, large amounts of electricity and very specific software to receive the golden hash. And you are competing with a huge amount of other miners that use the same sophisticated hardware (or even more sophisticated) than what you probably have. Mid-July 2021 the difficulty rate was 14 trillion. This means that the chance of a computer producing a hash below the target is 1 in 14 trillion. In other words: the chance of winning the lottery is far more likely than getting the “golden hash”. Because the most sophisticated mining computers spit out many hash possibilities, the chance of getting the “golden hash” increases. However, mining bitcoin requires a tremendous amount of energy and sophisticated computing operations.
I don’t want to be too negative with mining but there is another catch: the reward rate is cut in half every 210.000 blocks. This means roughly every four years. The process is called “halving” and this is algorithmically enforced because only a predictable, unalterable rate of new bitcoins is introduced into the existing supply.
Many miners join mining pools: they connect with other miners and with all the miners in the pool they contribute their shared hash power to find golden hashes. The pool then shares in the profits, with different models for how these profits are split. A single miner might find a block once every 2-3 months or worse. By being part of a pool, the miners get more chances and a more predictable revenue stream.
Bitcoin is not going to vaporize when miners leave because mining is becoming too expensive. When miners leave, the complexity of the puzzles automatically is reduced so the chance of getting the “golden hash” increases. This then leads to a greater value of the asset because miners will make more money and automatically attracts new miners into the ecosystem, thereby maintaining the continuity of the network: that’s the power of the blockchain ecosystem!
Is bitcoin a hedge against inflation?
The central banks can print as much money as they want. This leads to inflation because it decreases the value of money over time. Bitcoin has a fixed limit of 21 million coins that can ever be created. This means that you can’t create new bitcoins out of thin air once the limit is reached. This makes it less sensitive to inflation.
The COVID-19 pandemic was a great test for this theory. Many countries began injecting trillions of euros into their economies. This required money printing to meet the stimulus requirements for its citizens. Because of this crazy amount of money creation, the value of money is going down and the value of assets with a limited supply like crypto, real estate, precious metals and shares/stocks are going up. In my opinion, proof that bitcoin (and other cryptocurrencies) is a good hedge against inflation. The figures are enough proof as it is.
But just a second: what happens with the miners when all coins are mined?
Over 18.5 million bitcoins have been mined in the past decade. This means that there are still 1.5 million bitcoins to be mined. Because the reward rate is cut in half with every 210.000 blocks, it will still take quite some time to mine the last 1.5 million bitcoins. The expectation is that the last bitcoin will get in circulation in the year 2140.
On top of the award of bitcoins with every “golden hash” that is mined, miners also receive a small transaction fee based on the number of transactions. The average fee is now about 5 euros per transaction and varies based on the number of transactions done. A block has a lot of transactions inside so the average block that is mined now, nets a fee of a few hundred euros. With the increase of the Bitcoin network, the fees will also increase. When the last bitcoin is mined the expectation is that the fees will be in the thousands of euros.
Can you manipulate blocks in a blockchain?
One of the reasons why I love blockchain so much is that its design prevents anyone from deleting or changing a record once it has been created. This makes it very useful for applications like cryptocurrency where it is important that records of currency spent cannot be changed or deleted. It would also be very useful for other kinds of records like e-voting, financial records, manufacturing records, insurance records, etc.
In order to be able to manipulate blocks in a blockchain you need to launch a “51 percent attack”. This attack can be performed when a single cryptocurrency miner or a group of miners gain control of more than 50% of a network’s blockchain. These kinds of attacks are the biggest threats for people who use and buy cryptocurrencies.
When a currency transaction is done, newly mined blocks must be validated by a consensus of computers (nodes) attached to the network. Once this validation is done/approved, the block is added to the chain. Because of this system, no single person or entity has control over it.
When a majority of the hashrate (the speed of mining) is controlled by one or more miners in a 51% attack, however, the cryptocurrency network is disrupted. Those who are responsible for the 51% attack would be able to:
- Exclude new transactions being recorded
- Modify the ordering of transactions
- Prevent transactions from being validated or confirmed
- Reverse transactions to double-spend coins
- Block other miners from mining coins or tokens within the network
In other words: they will be able to manipulate the blockchain.
A 51% attack scenario is rare though. The reason for this is that it is very costly: you need to invest in the logistics, the hardware and the electricity costs and the total sum of this can be very significant. It’s hard to manipulate blocks for Bitcoin because of its huge hash rate and because of the fact that this hash rate is still growing. Because the Return on Investment (ROI) for cybercriminals must be worthwhile as well, they need to make the consideration if they go for the attack or not. In order to get a 51%+ hashrate for the major cryptocurrencies, you need a tremendous amount of firepower: hardware and electricity. For Bitcoin, estimations are set at 10+ billion USD on the hardware and 10+ million dollars per day for electricity cost. This makes it close to impossible to do this attack on Bitcoin. Especially because of the fact that it is extremely hard to obtain the hardware at the moment with an overheated chip market. Because of this, my advice is to only invest in major cryptocurrencies if you don’t want to run the risk to lose your cryptocurrencies because of a hack. The chances that those networks will be hacked are close to zero. Investing in very small cryptocurrencies increases this risk.
Final thoughts
It’s quite a ride to fully grasp the concept and the potential of blockchain, including possible threats. The journey in the world of cryptocurrency and blockchain has just begun for me and I’m looking forward to learning more about the relatively new subject in Fintech and share it with other people.
Feel free to ask me any questions or give me additional tips/advice on cryptocurrency and blockchain by contacting me. If you want to keep in the loop when I upload a new post, don’t forget to subscribe to receive a notification by e-mail.