Security

京东云BDS区块链数据服务
本文约4036字,阅读全文需要约16分钟
For the blockchain system, security can neither be roughly defined in the way of necessary and sufficient conditions, nor can it be evaluated independently of the scene requirements such as decentralization and scalability; this is also the most powerful

text

Jingdong Zhilian Cloud Pan Xizhi

In the last two issues, we talked about the "scalability" and "decentralization" in the "trilemma" of the blockchain public chain system. In this issue, we combined the security issues and challenges in the blockchain public chain system , and some practical cases, let’s talk about the finale topic of this series of articles: Security.

In the opinion of many people, for a system, security is a necessary condition, but not a sufficient condition; some even say that "decentralization" and "scalability" are "paradoxes" rather than " "Triple Paradox" is more precise, and only binary can explain the performance status of a blockchain public chain system. But is this really the case?

First of all, I would like to quote the description of security in the white paper of the BTC system to define the security of the blockchain public chain system in a scope: a consensus mechanism based on cryptography and proof of work (POW) , so that as long as the total computing power of malicious nodes in the entire system does not exceed 50%, the system can guarantee high-probability security, and fatal "double spending" (double spending) fraud will not occur.

It can be seen from this text that the security scope of the blockchain public chain system has two aspects, one is the security of the system itself (anti-crash mechanism), and the other is the data and transaction security of system participants (privacy protection).

A very important part of the difference between the blockchain public chain system and the centralized system is that "security" is a performance indicator in the system (guaranteed by technologies such as cryptography and consensus mechanisms), which can be based on the overall needs of the system. Flexible selection and even replacement during system iterations.

Therefore, in the author's opinion, for the blockchain system, security can neither be roughly defined in the way of necessary and sufficient conditions, nor can it be evaluated separately from the requirements of scenarios such as decentralization and scalability; The most attractive place in blockchain security technology.

image description

BTC system full node distribution map (data source: Jingdong Zhilian cloud BDS blockchain data service)

(1) Targeted attacks targeting the consensus mechanism: The consensus mechanism is the basis for maintaining the orderly operation of the blockchain system. Blockchain nodes that have not established a trust relationship with each other jointly verify the data written into the new block through the consensus mechanism. correctness of information. There are many consensus mechanisms used in the blockchain, including PoW, PoS, BFT, etc. (mentioned in the previous two articles). At present, the PoW, PoS and DPoS (Delegated Proof of Stake) mechanisms have undergone large-scale and long-term practice tests, and their development is relatively mature. However, in the long-term development and application of the blockchain consensus mechanism, a large number of targeted attack methods such as computing power attacks, fork attacks, and witch attacks have also been derived, resulting in consequences such as tampering of records on the chain, as shown in the figure below;

image description

(2) Embed malicious code into the block and use the distributed storage mechanism for rapid dissemination: The blockchain realizes the simultaneous recording and storage of data on all user sides by building an open source sharing protocol. Unlike traditional centralized databases that store data in one or several centers, in a blockchain system, all user sides may store a complete copy of data. Therefore, no single or multiple nodes are attacked. The data of the entire network has a devastating impact, which improves the fault tolerance of storage. However, this distributed storage mechanism also expands the security threat surface to a certain extent. The most typical is that malicious nodes can embed malicious codes such as viruses and Trojan horses in new blocks, and use the distributed mechanism to spontaneously spread to the entire network, waiting for opportunities to initiate Network attack, as shown in the figure below;

image description

Schematic diagram of malicious code attack using blockchain distributed storage mechanism

Therefore, although the technical advantages of blockchain such as tamper-proof, distributed storage, and user anonymity provide a lot of room for innovation in its development and application, the current application modes of blockchain technology in various fields are still in the stage of extensive exploration, and its in-depth The application still needs a long process of integration and development; in the "ICT Institute Blockchain Security White Paper", the security issues of blockchain technology in the application are described, and the summary is as follows:

image description

Security risks corresponding to the typical application architecture of blockchain

In the figure above, the security risks of the four levels are summarized as follows:

Storage layer: The main risk comes from environmental security threats, such as infrastructure security risks, network attack threats, data loss and leakage, etc., which will ultimately affect the reliability and integrity of blockchain data files and the security of stored data. Including the following three points: infrastructure security risk, cyber attack threat, data loss and leakage;

Protocol layer: The main risk comes from the design defects of the core mechanism (consensus mechanism, P2P network mechanism, cryptography technology). We have introduced these core mechanisms in the first two chapters. When the rule design of these core mechanisms is used by malicious nodes, then It is easy to damage the system's own security and transaction security, including the following three points: protocol loopholes, traffic attacks, and the threat of malicious nodes;

Extension layer: The main risk comes from security holes in the code implementation. Since the typical implementation of this layer is a smart contract (or programmable contract), the application of smart contracts started relatively late, and many developers still lack the understanding of smart contracts. The secure coding capability of the contract has resulted in a large number of security loopholes in the code, including the following two points: contract development loopholes and contract operation security;

In summary, the current measures to deal with the above risks are briefly summarized in the following figure:

image description

Blockchain Risk Response Framework

Here we list a few specific methods for reference:

(1) Increase the number of nodes participating in synchronization and verification: In the blockchain public chain system, the correctness and security of the public chain network depend on the endorsement of some nodes. For example, in Bitcoin or Ethereum, according to the agreement, when each miner digs out a block, it must ensure that each transaction in the new block and in each block in history is correct. That is to say, when Bitcoin miners produce a block, they endorse the correctness of all previous blocks; in EOS, super nodes endorse the correctness of blocks through signatures. We call it "nodes participating in the consensus" here. Therefore, if every confirmed transaction has been synchronized and verified by more participating consensus nodes (except for attackers), the overall security of the system can be improved.

(2) Increase the threshold for nodes to participate in the system: We mentioned in the previous article that lowering the threshold for user participation can improve the degree of decentralization of the system. Therefore, when the threshold for system participation is increased, the security and reliability of the system can be improved accordingly. Scalability; in some consensus mechanisms, ordinary users do not participate in the synchronization and verification of transactions, but select a small number of special nodes for consensus through some methods; at this time, we can assume that each participating node is ready Sufficient computer resources, such as better CPU, larger hard disk, and larger network bandwidth; at this time, there is no need to set the "minimum configuration requirements" very low; correspondingly, the overall security of the system will be higher.

(3) Attack response monitoring: Create a certain "transaction configuration file" in the blockchain, monitor transactions on a specific blockchain, and detect malicious attacks including 51% attacks and Sybil attacks.

In short, the challenge of the security design of the blockchain system is to ensure that the system cannot be destroyed by bad people; in an open blockchain system linked to economic interests, not only good people will join the system, but there will also be more bad people Attempts to gain profits by destroying the system; then, how to ensure the security of the system when there are bad people inside the system is not only a technical challenge of the security architecture in the traditional sense, but also a challenge of security mechanism design;

image description

Typical applications of blockchain in the field of network security

Finally, as shown in the figure above, let’s talk about how to use the characteristics of blockchain technology to strengthen the security of the traditional network security field.

Due to the distributed, point-to-point communication of the blockchain has the characteristics of easy connection and large collaboration, the anonymity based on hash encryption can also protect user privacy and prove uniqueness. Rich management rights, therefore, these technical characteristics make blockchain an effective means to solve network and data security storage, dissemination and management problems, in attack discovery and defense, security certification, secure domain name, trust infrastructure establishment, secure communication And data security storage has been actively explored.

Here are a few specific application cases of blockchain network security:

(1) Guardtime attack discovery and defense case: create a time stamp hash for the state of the data or system, and the root time stamp hash continuously monitors the state to find out whether the file, system or program is being accessed without authorization. It is currently used in a British nuclear power plant , flood control systems and other national critical infrastructure applications.

(3) Blockstack secure domain name: build the domain name infrastructure on the blockchain, establish domain name hash mapping, perform domain name registration, transfer and other operations at each network node, store the public-private key pair of the domain name owner and record the analysis The latter domain name disperses the original centralized domain name service. Since there is no centralized record that can be attacked or modified by hackers, it also prevents traditional attacks such as domain name hijacking and cache poisoning.

image description

The Core of Blockchain System Security: Consensus

As the end of this series of articles, the author believes that, no matter in terms of scalability, decentralization, or security, the core attribute of blockchain technology is the word "consensus"; because of the "consensus" With this attribute, a system can be transformed from a "manager" to an "organizer"; the nodes participating in the system construction work together to maintain the normal operation of a blockchain system, so that the goal of system autonomy can be achieved. It can also resist various external attacks to a large extent, and finally guarantees the overall security of the system.

The "impossible triangle" is not a conclusion drawn after strict demonstration, it is just a summary of the actual operation status of each public chain in the industry; the meaning of the impossible triangle is to tell the designer that in the blockchain system When designing the architecture, trade-offs must be made according to specific application scenarios, without spending too much energy on how to balance these three elements.

In addition, it needs to be emphasized that the Impossible Triangle is not a limitation, but it opens up the designer's thinking on the right path, allowing them to design a variety of systems under a variety of trade-offs.

Finally, I sincerely hope that this series of articles can help you to know and understand the blockchain technology and the actual value that the blockchain system can bring us from more perspectives.