Chapter 3 : Bitcoin’s technical aspects
In this third chapter we will explore Bitcoin from a technical standpoint. We will focus on the journey of a transaction, identifying the participants and grasping the roles of nodes and miners.
Table of content :
- Explaining a transaction
- Bitcoin nodes
- Miners
- Mining and ecology
Section 1 – Explaining a transaction
Bitcoin operates as a trustless peer-to-peer network. It incentivizes integrity for all the network participants. Let’s take a closer look at how a transaction works.
1. Issuing a transaction
Bob’s wallet issues the transaction:
– 1 BTC will be sent to Alice’s public address
– 1 sat/vB will be charged for the transaction fee
2. Signing with the wallet
Bob uses his private key to sign the transaction.
This process will unlock the bitcoin which is going to be spent.
3. Broadcasting
The transaction is broadcasted to the Bitcoin network through the nodes. This flow of information enables all the participants to keep the transaction on their server, this way having a set of all unconfirmed transactions from the miners.
If Bob’s wallet has been broadcasting a fraudulent transaction, the nodes will reject it and won’t share it to peers. Unconfirmed transactions are stored in the mempool of each node.
4. Creating a block
Once the transaction is broadcasted to the network in the mempools, miners are tasked to include it in a new block.
Miners will create candidate blocks, and try to include as many transactions as possible in it. Miners validate transactions and secure the network through their hashpower.
5. Proof-of-Work
In order to validate blocks, the miners must solve proof of work challenges.
It consists in solving mathematical problems that are difficult but easy to verify, using powerful dedicated machines designed for this task (ASICs).
The first miner to solve the proof of work challenge wins the competition by broadcasting the new block and its result.
6. Adding a block
The miner who wins the proof of work challenge piles up the new block on the chain and is rewarded with a monetary compensation consisting of:
– Newly issued bitcoins
– Fees from user transactions included in the block
The winning miner is the sole recipient of the reward. Small miners can join in mining pools to increase their odds of finding a block and smooth revenue disparity.
7. Block propagation
We made it!
My node just received the last block, which includes the first Bob’s transaction confirmation.
I have successfully received the funds in my wallet!
Bitcoin has no tolerance for fraudulent behavior:
– You can’t sign a transaction without a private key
– Invalid transactions cannot be broadcasted to the network
– Fraudulent blocks cannot be broadcasted to the network either
Fraudsters are rejected by the network.
Section n°2 – Bitcoin nodes
Bitcoin nodes are the protocol’s core. They act as communication beacons and thus guarantee the protocol’s decentralization.
How much does a node cost?
Running a node requires little computational power, but enough storage to hold 500GB of data (in 2022 1TB is recommended), and an internet connection.
Raspberry Pi is an ideal solution to run your node 24/7. Total cost would be around €200 and around 30GB of monthly bandwidth.
Alternatively, you can download Bitcoin Core on your computer!
Running a node does not earn you anything.
What is a node for?
A node is software that connects to the Bitcoin network. It’s your own little private server able to communicate with other peers on the network.
It keeps a copy of the database and the consensus rules, verifies transactions and propagates the blocks.
The whole set of nodes forms the Bitcoin network and guarantees one of the crucial aspects of its decentralization.
It’s the nodes that make Bitcoin robust, censorship-resistant and impossible to ban or stop.
Keep a copy of the transaction ledger (the blockchain)
Contribute to the network’s decentralization and resilience
Communicate and share information on the network
Being part of the consensus in a trustless fashion
Who needs to run a node?
Everyone can find a good reason to run a node! The benefits largely outweigh the costs and efforts to run it.
Simply jump in and join thousands of other bitcoiners. Together, we are the Bitcoin network.
Section n°3 – Miners
Miners secure the network and build blocks with transactions. They use electricity through ASIC machines to solve Bitcoin’s proof of work challenges.
Byzantine fault and double spending
Being a peer-to-peer network, Bitcoin needs a secure solution without a trusted third party to validate users’ transactions. The main problem here is avoiding double spending; that is, a bitcoin being used twice.
This old computer challenge is called the Byzantine fault, or Byzantine generals problem. Before Bitcoin, it had never been solved, so here we can all thank Satoshi Nakamoto, giving us a solution through Proof-of-Work (PoW).
The issue here is to make sure that information is honest and known to everyone at the same time. To this end, Bitcoin uses a “blockchain” timestamp server system that renders the information immutable once it is written into blocks.
By spending electricity to secure the network, miners prove that they used real and expensive resources when creating the block. Consequently, they have no incentive to lie or cheat, as it is more profitable to be honest. Moreover, an attacker trying to alter the Bitcoin blockchain would have to waste considerable resources, making the whole attempt unprofitable.
Understanding Proof-of-Work
Proof-of-Work (PoW) is the security consensus of the Bitcoin protocol. It is the rule keeping Bitcoin running and ensuring its robustness. PoW is a fundamental core and plays a crucial role in Bitcoin’s game theory.
Think of it as a giant lottery where everyone can participate. You have to find a specific number that will sign a valid block and the winner is rewarded with bitcoin. This number is very easy to check, but hard to find. Indeed, that easy verification is done through the SHA-256 hash function that is included in the mining algorithm. In order to find this number, participants (miners) will try billions of billions of possibilities like 1, 52, 2 648, 26 874 615, 153 448 541 318 631, etc.
If you have found the right number: jackpot! Otherwise, you keep looking. Specific ASICs machines, whose only role is to calculate billions of possibilities per second, are used by miners to optimize their number of attempts. The total rate of attempts is called the hashrate and permits measures of the Bitcoin protocol security. These machines require large amounts of power to run. PoW converts energy to money, connecting the physical and digital realms to form the first currency backed with energy.
So, ASICs are running and a winner will emerge every 10 minutes on average, signaling he has found a valid hash satisfying the difficulty threshold. The lucky winner will then sign the new block on the timestamp server and extend the blockchain. He gets his rewards and goes back to try his luck for the next block. This process has been continuously repeating for 13 years now and every 10 minutes, a winner confirms Bitcoin transactions while continuing to secure the past. Proudly making our Bitcoin blockchain more robust and secure.
Ajustement de la difficulté de minage
What can we find in a block?
The block header contains several things such as the date and time, the difficulty target, the previous block number, the version, and the Merkel root of the previous transactions.
The first transaction is always the coinbase; it includes the reward for the validator job. Then there are the validated transactions. The miner will choose the transactions that bring in the most revenue in fees and try to create a block maximizing his income, i.e. small transactions with a maximum fee.
To validate a block, you will have to include the result of the proof of work, i.e. the valid hash satisfying the difficulty threshold.
Section 4 – Mining and ecology
The mining industry is, by the protocol’s nature, extremely competitive. Miners can only rely on two variables to increase their profitability: the ASICs acquisition cost and the electricity price they can get to run them.
Incomes
Transaction fees are paid by network users when they send bitcoin. The price is determined by supply and demand in a free market. The fee is based on the transaction size.
Depending on the network congestion and your degree of urgency, you can decide to pay more or less fees.
Each new block is allocated new bitcoins freshly injected into the network. This is where Bitcoin’s inflation takes place, with new bitcoins being added every 10 minutes.
From 50 BTC per block in 2009, the reward is halved every 210,000 blocks. We call this mechanism a halving. For security reasons, a miner must wait for at least a hundred blocks before he can release his money.
The costs
ASICs (Application-Specific Integrated Circuit) computers are expensive and designed for an unique task: mining Bitcoin’s SHA-256 algorithm. These machines are very energy-intensive, noisy and heat up a lot. They must be deployed where electricity is cheap with suitable conditions.
The most important cost to the miners is their energy consumption. Having a huge impact on their profitability, miners will look for energy sources with a price close to 0.
– Renewables once the initial investment has been paid off (solar, wind, etc.)
– Stranded energy that cannot be exploited by locals (hydro surplus)
– Excess energy anticipating future consumption (power plant in Africa)
The need for rare, complex and expensive hardware to protect the network is part of Bitcoin’s game theory. An actor managing to get access to the required computing power to attack the network (51% attack) would be far more profitable just mining bitcoin instead of making his investment obsolete through such an attack.
Unlike Proof-of-Stake (PoS), new miners have a comparative advantage over older miners through the acquisition of new ASICs. It is therefore not automatically an advantage to be the first on the market. By measuring miners performance (using hashrate or kWh), we can see that it is no longer profitable to mine from your computer.
The miners’ game theory drives them to move to places that welcome the mining business. Miners are therefore highly flexible and will seek cheap power wherever it is available.
The environmental debate
The green debate issue arises from a lack of knowledge and objectivity from both sides. Nocoiners seek to defend their system at all costs and do not understand the inner workings of Bitcoin. On the other hand, Bitcoiners have a financial stake in Bitcoin’s success while they use the technology on a daily basis.
You’ll understand that this is a huge matter and there are many questions to consider! Be careful not to get lost.
ASICs impact
- What are the materials used in ASICs?
- ASICs being dedicated to Bitcoin’s SHA-256, what is their lifespan?
- Can they be recycled or used in any other way?
- Should we tolerate using rare metals in their production?
- ASICs heat up a lot; could we exploit the loss of energy for heating, agriculture, air cooling?
Traditional alternatives impact
- The Bitcoin carbon footprint is generally understood, but what about the gold carbon footprint (mining, transport, processing)?
- What is the amount of energy required to operate the legacy system? Servers, offices, employees, security?
- What is the amount of energy required to defend and operate an open and sound financial system?
- Can we stop, tax, or limit non-green mining to the same extent as we do for gold miners?
- Is there non-ethical bitcoin mining to the same extent that certain gold mines use child labor?
Money printing impact
- Is overconsumption a byproduct of cheap credit and endless money printing?
- Does overinvestment lead to depletion of natural resources?
- Is it ethical taking on debt for the future at the expense of present resources?
- Can we limit our carbon footprint by limiting credit?
- Can we achieve ecological transition on a planet with limited resources, but unlimited money?
Still, a misunderstood technology
- Can we really consider an energy per transaction cost, while miners continue the longest chain and add security to each new block no matter what?
- How can we take into account Lightning Network transactions in the ecological debate?
- Can current projections hold, as Segwit, Taproot and other solutions will constantly improve Bitcoin?
- When so few miners are willing to share their numbers to keep their competitive edge, can we really be objective without reliable data?
“I personally think that Bitcoin is a net positive for the environment in the long run.
The logic behind Bitcoin pushes for economically profitable exploitation of renewable or stranded energy. Bitcoin can enable an ecological boom through the free market and not through subsidies, therefore pushing R&D in this area and enabling innovation: a new green revolution.
Additionally, I don’t see how a society based on credit, debt, consumption and overinvestment could be ethically responsible for the limited resources of our planet. We need to rethink the economic model and have a long term vision. Planning on 15-30 years instead of 5, we need to stop expecting solutions from the same people who got us into this mess in the first place.
Bitcoin will continue to be attacked for its carbon footprint because the people in power have too much to lose from a Bitcoin global adoption. We need to fix the money in order to fix the world. We cannot achieve a green transition based on Keynesianism and fiat currencies. A sound money backed with energy is, in my opinion, a necessity for an advanced civilization.
This debate is obviously very complex, so I invite you to find out more on my website, my YouTube channel or in person over a drink.”