Fundamentals of how Bitcoin works
secondary title
Bitcoin can send transactions and include them in a public blockchain that acts as a ledger. Bitcoins have value, and we can be sure that the transactions included in the ledger are legitimate. Due to the size of the Bitcoin network, we can be sure that these transactions are not fraudulent. This article will explain how decentralized networks incentivize independent actors to organize and create legal transactions on the blockchain.
secondary title
decentralized software
A computer is made up of memory and processing power. Memory is stored information and processing power is the ability to convert input into output. Software consists of the rules a computer is told to follow. A computer takes input, applies the rules it is given, and produces output.
Bitcoin is also software, but its nature is different from what we are used to because it is decentralized. Most software we are familiar with uses a centralized network to function. Consider Facebook and how it works. When you log in to create an account, your information is uploaded to one of the many computers Facebook uses to store user information. Every time you post or comment, this information is added to your computer. If the CEO wants to delete or change your information, then he will call the person who manages the computer, give him your name, and tell him what to do with the information. All of this is possible because Facebook is a centralized company.
Most companies with which we are familiar operate in a centralized fashion. The CEO can make these changes with just a phone call, which allows the company to operate efficiently. In return for this efficiency, the company's stakeholders (employees, shareholders, and customers) must trust that the CEO is doing what is best for all of them. Roughly speaking, the CEO of a company can enact changes without the unanimous consent of stakeholders, which allows the company to respond flexibly in a highly competitive market.
The opposite is a decentralized group, where decisions are made through consensus among a group of participants. In its purest form, the system requires no trust in a central authority, as the wishes of stakeholders are always fulfilled. This process is inefficient but necessary for operations that are highly subject to moral hazard.
The age of computing has made decentralized systems possible, and the ability to transmit information at speeds close to the speed of light has made the requirement of decentralization less onerous. Software becomes the ideal medium for decentralization. With the advancement of computing technology, a new idea emerged, which can now be decentralized, but still operationally feasible.
The agreement works by running, the software is open source, everyone has a copy of the code, and they can change it in any way. But if one person changes their own code too much, they may not be able to interact with other people's code. Everyone is free to change their own code all they want, but the rules that follow are the ones that the majority of the network chooses to follow. Anyone who doesn't want to follow these rules can change their code, but that means they can only interact with other people who also made that change. Simply put, if someone wants to change the Bitcoin software, then they need to convince the majority of participants to do the same. If they can't, Bitcoin won't change.
secondary title
bitcoin network
Nodes participate in the network through three main functions: routing, verification, and mining. When a node hears a transaction, it verifies the transaction by checking whether the sender has enough bitcoins to spend, whether they have spent those bitcoins elsewhere, and whether their signature matches their address. trade. If all checks are successful, the node forwards the transaction to other nodes, but if not, it forgets about it. Mining nodes not only validate and route, but also add transactions to their storage pool and attempt to record their copy of the storage pool on the blockchain by solving a computational puzzle (proof of work).
secondary title
mining process
For a new block to be mined and included in the blockchain, a mining node must solve the proof-of-work (PoW) computational puzzle. The proof-of-work algorithm is solved by generating a hash of the block header entries below the difficulty target. Because the output of a hash function is random, the only way to generate a low enough number is to keep guessing. The difficulty target is used to increase or decrease the chances of a miner solving the proof-of-work algorithm. The lower the difficulty target, the harder it is to solve because the range of possible answers is smaller.
Review the previous block header:
The block header has a timestamp, difficulty target and nonce value.
block header hash =
Hash function (Merkle root + previous block hash + version + time stamp + difficulty target + nonce)
Miners compete to solve the proof-of-work computational puzzle by updating the nonce field until a block header hash is produced that is less than the difficulty target.
secondary title
Once miners find a solution, they immediately broadcast it to their peers (i.e. the nodes they are connected to). These nodes then verify that the solution is correct, and if so, broadcast the solution to their peers. The chart below shows that 95% of blockchains will realize this within about 40 seconds on average.
image description
Probability Density Function of Block Propagation Time
Nodes accept this new block, incorporating it into their copy of the blockchain. Miners accept this new block and start mining the next one, adding the latest block to their blockchain and starting the process all over again. This cycle occurs every 10 minutes on average, and the difficulty target will be automatically adjusted to ensure that this cycle is achieved.
Because the difficulty target is adjusted to find a block every 10 minutes on average, we know that miners are rewarded with a block reward for successfully mining a block on average every 10 minutes. Block rewards consist of fees paid by nodes on transactions, and coinbase transactions create more new bitcoins.
Block reward = coinbase transaction + block fee
In 2008, the coinbase transaction rewarded 50 bitcoins, and the rewards were halved every four years until the maximum supply of 21 million bitcoins was reached in 2140.
As soon as the next block is found, a chain becomes longer, and the nodes of the short chain switch to mining the longest chain. Nodes follow the longest chain rule, resolving all disagreements over time.
secondary title
Incentive Mechanism - Proof of Work (POW) Algorithm
An important question to answer: why not randomly pick some miners' blocks every 10 minutes? Why are we expending all this energy running computers to solve this problem?
We know that PoW creates digital scarcity, but it also serves another purpose - security. Blockchains are extended by those who solve algorithms. If a miner solves it, they can include those fraudulent transactions, but these fraudulent transactions will be rejected by other nodes because they do not pass verification. If a blockchain is to be extended with fraudulent transactions, it must be extended by like-minded miners, which would require greater than 50% of the computing power of the entire network. So the more expensive it is to mine, the harder it is for bad actors to do so.
Nor is it in the best interest of the bad actor to do so. In the words of Satoshi Nakamoto:
He should find it more beneficial to play by the rules that favor him getting more bitcoins than everyone else combined, rather than undermining the validity of the system and his own wealth.
The Proof of Work algorithm is like a test. Bitcoin gains credibility through the security of its network. Its security lies in the fact that only 21 million bitcoins are known for sure to exist. The cost of mining is what makes it certain. Securing the Bitcoin network means securing a trustless, decentralized medium of money free from moral hazard. The monetary system is the foundation of the economy, and in turn security is the most important.
secondary title
bitcoin rules

These rules exist in consensus because network participants are willing to accept them. In a fiat currency system, rules emerge not through consensus, but through fiat (the definition of the word fiat). We do not vote on monetary policy. Instead monetary policy is influenced by and controlled by politicians:

April 2019 meeting of the Federal Reserve Board of Governors
secondary title
People buy Bitcoin because of its superior monetary properties, which increase its price. Rising prices attract more miners, expanding the computing power of the network, making the network more secure and thus more valuable. This further increases the price over time. As the price of Bitcoin rises, it creates a positive feedback loop where participants believe it will continue to rise. This is the power of network effects applied to standards of value. This feedback loop is premised on the monetary properties of Bitcoin (determined by the rules), because without these properties, people would not speculate on Bitcoin in the first place.
secondary title
how the rules change
The Bitcoin software is called Bitcoin Core and can be downloaded at bitcoin.org. This is the most widely used bitcoin software, but there are other valid bitcoin software versions as well. Other versions must maintain a minimum level of similarity to Bitcoin Core in order to participate in the Bitcoin network. At this minimum level, a node needs to check the validity of transactions and blocks in the same way as other nodes. If it doesn't, the transactions/blocks it creates and forwards will likely not be accepted by other nodes, and vice versa.
In order to change the rules, consensus needs to be achieved among three main stakeholder groups:
You can see that each group has some form of power, but none has full control. Note that there is a small group of developers who can actually update the code (called commit permissions), while other members of the community propose changes publicly.
What if someone tries to control the small number of developers who have commit access? They have the power to create new software for community members to download voluntarily, but they cannot be forced to download it. All modifications to the software are vetted by community members, and since it is open source, any modifications will be discovered quickly.
Bitcoin rules are created by the community and implemented by developers with commit permissions. Nodes (miners) must download updated software for the network to accept it. And investors must continue to hold and buy bitcoin for the software change to matter.
Bitcoin rule changes require the consensus of major stakeholder groups.
Our fiat financial system is controlled by a highly centralized group. You can choose whether to abide by the democracy of the Bitcoin system, or the ever-changing rules of the current fiat currency system. This decision will become easier as more and more people adopt the Bitcoin system.
Original: Eric Yakes
Compilation: Bibabu


