How to construct blockchain
From the perspective of technology and architecture, I will tell you my understanding of blockchain in common language
what is blockchain? In a word, blockchain is a storage system. To be more specific, blockchain is a distributed storage system without an administrator and each node has all the data
What are the common storage systems like
first, how to ensure high availability
the common storage system usually uses "rendancy" to solve the problem of high availability. As shown in the figure above, if the data can be copied into several copies and rendant to multiple places, high availability can be guaranteed. The data in one place is hung, and there is data in other places. For example, the master-slave cluster of MySQL is the same principle, and the raid of disk is also the same principle
two points need to be emphasized in this place are: data rendancy often leads to consistency problems
1. For example, in the master-slave cluster of MySQL, there is actually a delay in reading and writing, which means there is a inconsistency in reading and writing in a short period of time. This is a side effect of data rendancy
The second point is that data rendancy often reces the efficiency of writing, because data synchronization also consumes resources. If you add two slave libraries, the write efficiency will be affected. The common storage system is to use rendancy to ensure the high availability of dataso the second question, ordinary storage system, can write more
the answer is yes, for example, take this graph as an example:
in fact, MySQL can do a master-slave synchronization of al masters, master-slave synchronization of al masters, two nodes can be written at the same time. If you want to do a multi room multi live data center, in fact, multi room multi live data synchronization. What we should emphasize here is that multi-point writing often leads to the consistency problem of writing conflicts. Take MySQL as an example, suppose that the attribute of a table is self incrementing ID, then the data in the database is 1234 now. If one of the nodes writes and inserts a piece of data, it may become 5, and then these 5 pieces of data are synchronized to another master node, Before synchronization, if another write node inserts a piece of data, a piece of data with self incrementing ID of 5 will be generated. Then, after the generation, synchronize to another node, and the synchronized data will conflict with the two local 5's after it arrives, which will lead to synchronization failure and write consistency conflict. This problem will occur in the case of multi-point writing
how to ensure consistency in multi-point writing
the reform "Swan class" gives you more technical work
blockchain is composed of a series of data blocks generated by cryptographic methods. Each block contains the hash value of the previous block, which is connected to the current block from the original block to form a blockchain.
Seeing some answers to the debate on the definition of blockchain, I suddenly realize that my answer to this explanation principle has always been directed at bitcoin. There is no specific and unique answer in the instry between the definition of blockchain. Here I first summarize the characteristics of "blockchain" according to the papers I read:
1; Hash chain & quot There are several nodes participating in the system operation (distributed)
3. Reach a consensus on the consistency of basic data (consensus agreement / algorithm) through a certain protocol or algorithm
since bitcoin is currently one of the most typical and influential applications of blockchain, it will be much easier to understand how bitcoin uses blockchain before understanding other forms of blockchain applications
among them, the data layer encapsulates the underlying data block and related data encryption and timestamp technologies; The network layer includes distributed networking mechanism, data transmission mechanism and data verification mechanism; The consensus layer mainly encapsulates all kinds of consensus algorithms of network nodes; The incentive layer integrates economic factors into the blockchain technology system, mainly including the issuance mechanism and distribution mechanism of economic incentives; The contract layer mainly encapsulates all kinds of scripts, algorithms and smart contracts, which is the basis of the programmable characteristics of blockchain; The application layer encapsulates various application scenarios and cases of blockchain. In this model, chain block structure based on timestamp, consensus mechanism of distributed nodes, economic incentive based on consensus computing power and flexible and programmable smart contract are the most representative innovations of blockchain technology.
blockchain developers should establish effective channels to collect the deficiencies of the current blockchain and make targeted improvements. This process is called improvement proposals: bitcoin isolation witness (composed of a series of BIPS) is a good example. Application layer developers can use IP process to feed back the problems found in the use process to developers, forming a virtuous circle. And IP process should not be limited to the technical field, but should go deep into the business layer
the Xueshuo innovation blockchain Technology Workstation of Lianqiao ecation online is the only approved "blockchain Technology Specialty" pilot workstation of "smart learning workshop 2020 Xueshuo innovation workstation" launched by the school planning, construction and development center of the Ministry of ecation of China. Based on providing diversified growth paths for students, the professional station promotes the reform of the training mode of the combination of professional degree research, proction, learning and research, and constructs the applied and compound talent training system.
blockchain is composed of a series of blocks generated by cryptographic algorithm. Each block is filled with transaction records, and the blocks are connected in sequence to form a chain structure, which is the blockchain ledger
taking bitcoin as an example, when miners generate new blocks, they need to calculate the new hash value and random number according to the hash value, new transaction block and random number of the previous block. In other words, each block is generated on the basis of the previous block data, which ensures the uniqueness of the blockchain data
because subtle changes in transaction records will completely change the result of hash value, miners can't cheat when competing for computing power. Each miner must wait until the previous block is generated before starting to calculate the qualified random number according to the data of the previous block, which ensures the fairness of mining.
Blockchain technology is not a single innovation technology, but the result of a variety of technology integration and innovation, its essence is a weak center, self-confident underlying architecture technology. Compared with the traditional Internet technology, its technical principle and model architecture is a major innovation. Here, we will analyze the basic technical model of blockchain
the structure of general blocks is divided into block head and block body
the block header contains the identification information of each block, and the most important information is the header hash value, which is completely consistent with the parent hash value of the next block, so as to realize the concatenation of two adjacent blocks and finally get an orderly connected blockchain. Through any block in the blockchain, all blocks before or after this block can be traced.
What kind of blockchain technology is popular recently? Blockchain technology is considered to be the brightest star in financial technology, and it may continue to develop in the future. It has many characteristics, including data distribution, data trust and collective consensus mechanism, and most importantly, openness, transparency, anonymity and privacy, According to the data in the blockchain, we can get some basic information of contemporary society
blockchain technology is such a safe and scientific database. It can be simply understood as an authoritative database, in which the basic content is true, verified and audited by others. In terms of financial technology, it is very easy to find some desired data, which is very good for business people