# What is blockchain
# Understanding Blockchain from Bitcoin
Let's start with a story Once upon a time, there was an ancient village where a group of ancient villagers lived. There was no bank in this village to save money or keep accounts for everyone. There is no village head who can be trusted by all villagers to maintain and record the financial transactions between villagers, that is, there are no intermediary institutions or individuals to keep accounts. So, the villagers came up with a method of keeping accounts together without the need for intermediary institutions or individuals.
For example, Zhang San needs to give Li Si 1000 yuan. Zhang San shouted loudly in the village, "Attention everyone, I transferred 1000 yuan to Li Si from Zhang San." The nearby villagers heard this and did two things: (1) Judging by the sound that it was Zhang San shouting, not someone else pretending to be Zhang San shouting, to prevent others from spending Zhang San's money; (2) Check if Zhang San has enough money. Each villager has a small ledger that records how much money each villager has. After confirming that Zhang San really has 1000 yuan, each villager will record it in their own ledger:“ ×××× year × month × On the day, Zhang San transferred 1000 yuan to Li Si In addition, these villagers passed the word of mouth and told Shiliba Village about Zhang San's transfer. When everyone knew about the transfer, they could collectively prove that "Zhang San transferred 1000 yuan to Li Si". In this way, a bookkeeping system that does not require a village head (central node) but allows all villagers to reach an agreement was born. This accounting system can be likened to the Bitcoin system we often refer to today.
The story does not end here, which raises three questions worth considering.
- Will the recorded accounts be tampered with later?
- What motivates villagers to help others keep accounts?
- With so many people keeping accounts, if the records are inconsistent, wouldn't it be bad? Who records them?
The Bitcoin system cleverly solves these three problems.
- Bitcoin adopts two strategies to ensure that the ledger cannot be tampered with: ① Everyone keeps accounts. Everyone maintains an account book, so even if someone changes their own account book, they have no right to modify the accounts of other villagers. Modifying their own account book is equivalent to "stealing the bell" and others will not approve Adopting a special ledger structure of "block+chain". In this ledger structure, each block stores the transactions occurred in a certain period of time. These blocks are connected together through a chain structural join to form a complete ledger recording all transactions. If the block content is modified, it will disrupt the chain structure of the entire blockchain, causing the chain to break, making it easy to detect. These two strategies ensure that the entire ledger is tamperproof from a global perspective.
- The previous article mentioned that everyone participates in bookkeeping, and people will definitely ask, 'Why should I help others with bookkeeping?'. This involves the incentive mechanism in the Bitcoin system. The villagers who participate in accounting are called "miners". Among these miners, the first person whose bookkeeping is recognized: ① will receive a reward, which is a number of Bitcoins, which is also the only source of Bitcoin issuance. This reward measure enables many miners to actively participate in bookkeeping; ② Whoever is recognized in a certain ledger will be copied separately by others to ensure that the ledger maintained by everyone is completely consistent. These two points ensure the automatic and safe operation of blockchain.
- Since there is an incentive, everyone will compete for bookkeeping and strive to make their bookkeeping recognized. How can we determine who will take the bookkeeping as the standard? In order to determine who recorded the account as the standard, the villagers came up with a fair solution: for each piece of account book (similar to a page on our actual account book), they found a difficult problem from the question bank and asked all the "miners" involved in the accounting to solve this problem. If anyone first solves the problem, the page/block will be based on the account they recorded. This process of solving difficult problems is called "mining", that is, the process of proof-of-work. It should be noted that the process of solving this difficult problem requires constant experimentation and is relatively difficult, but once the answer is found and sent to others, it is easy for them to verify.
Therefore, Bitcoin ensures the immutability of transactions through the distributed ledger of "blockchain", incentivizes the participation of "miners" through the issuance of Bitcoin, and solves the problem of accounting consistency through computational difficulties (miners mining). In this way, an automated system that can complete bookkeeping without relying on any intermediaries has been perfectly formed. As shown in Figure 1.9, the blockchain technology behind Bitcoin is characterized by its "blockchain" tamper proof ledger, multi-party participation, and consensus results.