Blockchain is a chain storage structure formed by blocks connected to each other according to the time sequence of their respective generation. , the block is the basic data storage unit in this structure.
What is blockchain? What are the characteristics of blockchain? Please refer to the "What is Blockchain" chapter.
As the basic structural unit in the blockchain structure, the block consists of the "block header" containing the identity information of the block itself and the "block body" containing the database information. Compared with the traditional database structure, the block body is similar to the specific content of each page of the database, and the block header is similar to the page number used to locate the location of the data.
The block header mainly contains the encrypted digest of all data in the previous block, the generation time of the block, and the encrypted digest of the block body.
The encrypted digest is generated through a one-way encryption algorithm commonly used in the blockchain field, which we generally call "hash algorithm" or "hash function". It works like taking a given piece of content and summarizing it into a summary. It is called a one-way encryption algorithm because we can easily generate a digest when we know all the data contained in the previous block. But if we only get a digest, it is very difficult to accurately calculate all the data of the previous block. We call the value generated by a hash algorithm for a given piece of data the "Hash Value" of this piece of data.
For a more in-depth understanding of the principles, technology and operation of hash algorithms, please refer to Investopedia
Encrypted through hash algorithms and then generated Blocks always need to rely on the previous block data to generate block headers, and the blockchain therefore realizes a chain structure of blocks connected end to end. At the same time, when a piece of data is recorded in a certain block, starting from the next block, it will be continuously combined with other data and encrypted into a new hash value, which will be recorded in subsequent blocks. Blockchain also makes data tampering more difficult in this way.
Do you still remember when we introduced the blockchain and said that "blocks are connected to each other according to the chronological order of their respective generation"? This statement is actually not accurate. Blocks are actually linked through hash algorithms and block header structures. However, since the block generated later in time always depends on the data of the block generated earlier, a chronological arrangement is indirectly formed.
In the field of blockchain, we generally refer to the previous block of a certain block, that is, the block encrypted by the hash algorithm contained in the block header of the block, as "Parent Block". When a certain blockchain has not yet generated the first block, subsequent blocks cannot be generated because there is no parent block. At this time, the founding team of the blockchain will generally generate the first block of the blockchain. This block does not contain the hash value of any parent block. We call this block the "genesis block" ( Genesis Block). The generation of the genesis block generally means that the blockchain has officially started running. The data in the genesis block will be encrypted and recorded in all subsequent blocks of the blockchain.
For example: On January 3, 2009, Satoshi Nakamoto generated the genesis block of the Bitcoin network on a server in Helsinki, Finland, marking the official birth of the Bitcoin network. Satoshi Nakamoto left a sentence on this block, "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks." The edge of the plan.)