What is Bitcoin?
Bitcoin is an electronic currency or digital currency, which is a currency based on the principles of cryptography. This currency is different from the currency in the bank cards we usually use, and its birth process is full of legends.
The birth of Bitcoin
After the outbreak of the 2008 financial crisis, on November 1, 2008, a network geek with the pseudonym Satoshi Nakamoto published an article on the Internet. This article is called "White Paper",
and its full name is "Bitcoin: A Peer-to-Peer Electronic Cash System". In this white paper, Satoshi Nakamoto proposed an idea: to design a decentralized electronic accounting system.
Decentralized electronic accounting system
In traditional transactions, accounting is done by banks, and we trust banks because banks have national credit behind them.
However, Satoshi Nakamoto believes that we can account in a decentralized way, and everyone's account book is public, thus forming a decentralized electronic accounting system.
Example
Suppose there are four children, A, B, C, and D, who need to pay and account for transactions. For example, A pays 10 bitcoins to B, and this transaction needs to be broadcast to others.
After everyone updates the ledger, the next transaction is made. In this way, all transactions are packaged into a block, and the blocks are linked to form a blockchain.
A pays 10 bitcoins to B: A broadcasts the transaction information to B, C, and D.
B pays 5 bitcoins to C: B broadcasts the transaction information to A, C, and D.
C pays 2 bitcoins to D: C broadcasts the transaction information to A, B, and D.
After each transaction, everyone updates the ledger, and these transaction records are packaged into a block.
The formation of the blockchain
Each block is about one megabyte in size and can store about 4,000 transaction records. These blocks are linked in sequence to form a blockchain. As the system runs, several key issues need to be resolved:
Who is the bill based on: Due to network delays, the order of bills for different people may be different.
Why do we need to keep accounts: Why are participants willing to spend resources to keep accounts?
How to prevent counterfeiting and tampering: How to prevent forgery and tampering of transaction records?
How to prevent double payments: Prevent one person from paying the same bitcoin to two people at the same time.
How to keep confidentiality: How to ensure privacy of public transaction information?
Motivation for bookkeeping: Reward mechanism
There are two kinds of rewards for bookkeeping: handling fees and packaging rewards.
Every participant can keep accounts. Initially, a block is generated every ten minutes, and 50 bitcoins are rewarded. After four years, the reward is halved. The total amount of bitcoins is 21 million, which are gradually distributed in this way.
Determine whose bill is the standard
The blockchain system adopts the Proof of Work mechanism, that is, each participant must solve a difficult problem, and the first person to solve the problem will get the right to keep accounts and rewards. This process is called "mining".
Specific principles of mining
Mining is based on the SHA256 hash algorithm, which performs two SHA256 operations on a string, requiring the first n bits of the result to be 0. The problem-solving process requires trying different random numbers, and the amount of calculation is huge.
Characteristics of hash functions
The SHA256 algorithm converts any input into a 256-bit binary number. The forward calculation is easy, and the reverse calculation is extremely difficult. The mining process is to find a hash value that meets the conditions through continuous attempts.
Difficulty setting
The system adjusts the difficulty according to the computing power of the entire network, so that a block is generated every ten minutes. The difficulty is set to 0 for the first n bits. The larger the n value, the harder the problem.
How the Bitcoin system works
1. Proof of Work
The core of the Bitcoin system is the proof of work mechanism. Each miner (i.e., participant) needs to solve a complex math problem that cannot be solved by wisdom, but by a lot of calculations.
Specifically, the miner needs to find a random number so that the first n bits of the result obtained after two SHA256 hash operations of the block header containing this random number are 0.
2. Mining process
The mining process is to keep trying different random numbers until a hash value that meets the conditions is found. The miner who finds this hash value can add his block to the blockchain and get a Bitcoin reward.
3. Characteristics of the hash algorithm
The characteristics of the SHA256 hash algorithm are:
Any length of input data will generate a fixed-length 256-bit binary number.
Changing any point of the input data will result in a completely different output result.
Forward calculation is easy, and reverse calculation is extremely difficult.
4. Difficulty Adjustment
The Bitcoin system adjusts the mining difficulty every two weeks (2016 blocks), with the goal of maintaining an average of one new block every 10 minutes.
If the average time to generate a block in the first two weeks is less than 10 minutes per 10 minutes, the system will increase the difficulty; otherwise, it will reduce the difficulty.
Bitcoin Total Control
The total amount of Bitcoin is capped at 21 million, which is achieved through a halving mechanism every four years. In the initial stage, 50 bitcoins are rewarded every 10 minutes, which is reduced to 25 after four years, and 12.5 after another four years, and so on.
It is expected that all bitcoins will be mined around 2140.
Bitcoin Value
The value of Bitcoin comes from its decentralization, security, scarcity and wide acceptance. It does not rely on any central agency or government, and its value is entirely determined by market supply and demand.
At the same time, blockchain technology ensures that Bitcoin transactions are transparent and difficult to tamper with, making it a trustworthy electronic currency.
Summary
Bitcoin solves the trust and security issues in the traditional currency system through a decentralized accounting system
and proof-of-work mechanism. The mining process motivates participants to maintain the operation of the network and ensures the reliability and fairness of the system through complex mathematical operations.
The emergence of Bitcoin has not only changed people's perception of currency, but also promoted the development of blockchain technology and had a profound impact on the future of financial technology.