The blockchain mechanism of Bitcoin is actually a distributed event stream log, which records all Bitcoin transaction events. Bitcoin is a virtual currency. We know that we can set up a machine to mine Bitcoin, that is, get Bitcoin "for free", but this "free" is not really free. Your computer will pay the price of computing power and workload. In fact, your computer is participating in a global distributed system. Although the computer system is distributed, all Bitcoin transactions need to be recorded together. There are two ways to solve this recording problem: The first is the simplest way, which is to set up a central repository, and all transaction data is sent to this central repository. This is a common feature of database-centric software systems. The problem with this model is that there is a central database, and the Bitcoin system itself is distributed without any center. Therefore, this central database method is obviously not suitable for Bitcoin's accounting management method; The second is to use a distributed approach to complete the business model that requires centralized accounting management. In other words, Bitcoin transactions on servers around the world must be recorded in a unified ledger, but this unified ledger does not correspond to a central repository to save it, but each machine keeps a copy of the unified ledger. This is very similar to the read and write operations in a distributed system. Each machine can freely read the data in this unified ledger, but if you need to write the Bitcoin transaction data that occurred in your machine into this ledger, you need to have the write permission, which is actually similar to the power of log appending. We know that ordinary log append is to open the log file and append a new line to the last line of the file. The unified ledger is similar to this file. First, you need to find the last line of the ledger, just like when you are queuing, you need to be the last one in the line, but you don’t need to understand the whole line. You just need to identify who you need to follow, that is, who you are behind. A block is a data block with a unique identifier. The unique identifier, or primary key, is a 256-bit hash number generated using a consistent and unified algorithm across the network. Each block contains a header that points to the primary key hash number of the previous block, just like a foreign key in a data table points to the primary key of another table. In addition to the header, each block also has transaction content, which is the Bitcoin transaction data that has occurred. Multiple blocks are connected in series like this, relying on header information to point to another block, like a chain, which is called a blockchain. Obviously, this kind of blockchain is like a Stream, which is a stream of transaction events, just like the event log saves the transaction event stream. The blockchain is a "ledger" consisting of a series of transaction events. It is distributed, can be shared among different servers, and can be modified based on the consensus of the majority of participants (just like the distributed Paxos Raft algorithm). Once the transaction event data is added, it will never be deleted (the log can only be appended forever). The Bitcoin blockchain contains every transaction record that has occurred in the past for every Bitcoin. Therefore, if you have a background in Event Sourcing and distributed knowledge, and have a certain understanding of data consistency, it will be very easy to understand Bitcoin's blockchain. The most important core of blockchain is how to solve the situation of competitive data appending, that is to say: when multiple machines need to write transaction events at the same time, they must queue up. In terms of technical architecture, we use a centralized message system to queue write events, but in a completely distributed system, it is impossible to set up a centralized message system. Therefore, multiple concurrent machines need to compete. The Bitcoin blockchain is designed with a competitive accounting and incentive mechanism. Each computer competes for the right to write accounting with its own computing power, that is, computing power. The computer with high computing power has a high probability of winning the accounting. Once it obtains the accounting power, it can also get a certain amount of Bitcoin as a reward. The high computing power is measured and compared through public quantitative indicators such as workload. Bitcoin's blockchain mechanism is based on the natural law of freedom. Each server is like every living thing freely pursuing its own maximum benefit. Ultimately, the invisible hand forms a natural evolutionary ecosystem with positive feedback. The core idea of Bitcoin blockchain mechanism is distributed + event stream log, which can be applied more widely in business fields, such as digital publishing, music distribution and many other network application fields. Blockchain technology actually pronounces the death of traditional database technology. Even industries like finance do not need to use traditional central databases, so other industries can be imagined. |
<<: BTCC Li Qiyuan is optimistic about the future of Bitcoin
>>: Dongguan tried a pyramid scheme case using Bitcoin
Everyone's facial features are unique, which ...
Moles can be divided into broad and narrow meaning...
Wu said the author | miaohash Editor of this issu...
On Wednesday, Coinbase landed on Nasdaq as expect...
Source: The Economist, January 9, English edition...
The size of the Ethereum blockchain has already s...
You need to know these "little-known facts&q...
Andhra Pradesh, a state in southern India, has an...
Palmistry predicts your life destiny The lifeline...
Statement: This article is exclusively authorized...
As I write this memo Tuesday morning, Bitcoin has...
Have you ever carefully observed your philtrum wh...
Woman's face with three white eyes If a woman...
The retail giant has partnered with crypto ATM co...
Presumably every man wants to marry a woman who c...