In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
What is the basic concept and principle of blockchain? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Text
I. the essence and principle of block chain
Blockchain (Blockchain) is a technical solution that collectively maintains a reliable database through decentralization and de-trust.
What is decentralization? For example, if the company has a server, and all the data is stored on the server, or on the cloud server, then this is a centralized system. For example, the company accounts settlement, through the bank remittance and remittance, then the bank is to play such a central role. Decentralization is to eliminate the role of centralization, so some people may ask, without the server as a medium for storing data, how can data be stored and exchanged?
II. Operation of block chain (1) node
In the block chain system, the node is the basic unit of the block chain. In some blockchain systems, any device that joins the blockchain, such as mobile phones, PC, and electronic devices, can be a node.
Nodes are divided into authentication nodes and non-authentication nodes. The authentication node refers to some nodes that participate in the consensus, and the non-authentication node is the node without consensus permission. What is consensus?
(2) consensus algorithm
With nodes and consensus nodes, then there must be a set of algorithms, according to this algorithm to verify the legitimacy of transactions and prevent malicious transactions. Just like electing a president, everyone has the right to vote, so a candidate to be president must have a set of rules, whether to be president according to the person with the highest number of votes or the candidate with the highest number of votes in the state. This is a consensus algorithm. The president elected in accordance with this set of rules and regulations is fair and undeniable. Similarly, the blocks generated by consensus nodes through a set of consensus algorithms are unchangeable and irreversible. So once the data on the blockchain is generated and recorded, it cannot be modified. In this way, the legitimacy of the data can be guaranteed, and it is open and transparent.
Types of consensus algorithms: PBFT, PoW, Pos and so on. Bitcoin is based on the Pow (workload proof algorithm) consensus, which is calculated by computing power. PBFT is a Byzantine fault-tolerant algorithm. If there are 3N+1 nodes in the block chain, then the maximum number of malicious nodes cannot exceed N. Here we design a classical algorithm, the Byzantine General problem, which will not be explained in this article. At the beginning, the author used the noop algorithm, which is a set of "fake" consensus algorithm. Other consensus algorithms such as PoS (Proof of Stake, proof of interest), DPoS (Delegate Proof of Stake, proof of entrustment), Ripple (Raywave), etc.
(3) Block
When the consensus node passes unanimously according to a consensus algorithm, it will broadcast and notify all nodes on the block chain. After the broadcast is completed, a new block will be generated, and the block chain is composed of a block link.
The data structure of the chunk is shown in the figure above, including the Hash of the previous chunk, the Hash, timestamp and transaction-related data of the current chunk.
When a block is generated, it is permanently stored in the block chain, and all nodes have permission to access the data of the block, so that it is open and transparent, and will not tamper with the data because of malicious operations or other factors. To achieve the goal of mutual trust.
(4) chain code (chaincode)
Chain code is also called intelligent contract, when we initiate a transaction or query a transaction on the block chain, we need certain rules to trade. The smart contract is generally written by the programmer and then deployed to the block chain, and the corresponding transaction can be carried out according to the intelligent contract. It's like signing a contract between enterprises.
Chaincode can be written by go, nodejs, and so on. The author originally used go, wrote it and deployed it to IBM's fabric system. Provide query, invoke and other interfaces.
Third, the division of block chain.
According to the nature, block chain can be divided into public chain, private chain and alliance chain.
(1) Public chain
In the public chain, any individual can join, read, write and trade data, and the threshold of authority is relatively low. More famous public chain applications such as Bitcoin. Public chain has the characteristics of data disclosure and transparency, anonymity, low access threshold and so on. When the number of blocks on the public chain reaches a certain number, the speed of access slows down. This is also the drawback of the public chain.
(2) Private chain
Contrary to the public chain, the private chain is a non-"public" chain, which is generally used within the enterprise and requires authorization to join the node. Joined nodes generally have access to data, while write permissions are strictly controlled. Ant Financial Services Group, for example, is a well-known private chain application.
Private chain has the characteristics of fast transaction speed, good privacy, low transaction cost, high security and so on. The disadvantages are that a small number of nodes have permissions, data is easy to be manipulated, code is easy to be modified, and so on.
(3) Alliance chain
Alliance chain is a block chain managed by different institutions or organizations, which can be joined and withdrawn only after authorization, and each organization or organization manages one or more nodes. Each institution or organization has a physical organization. The alliance chain is suitable for transactions and settlement between organizations.
The more well-known ones are China Block chain Research Alliance (CBRA) and WeBank.
The answer to the question about the basic concept and principle of blockchain is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.