A few years ago, Bitcoin was born, and the technical and economic environment at that time did not pay enough attention to it, but now the value of Bitcoin is about 30,000 yuan. Why does its existence have so much value, and what is the significance of its existence as a digital currency?The reason why Bitcoin, as one of the many digital currencies, has so much value is that it uses a technology that can replace a third party as a trust authority, that is, blockchain technology. Nowadays, the prevalent payment of ***, the emergence of various third-party network payment institutions, the promotion of cashless culture, etc., have emerged payment security issues. Blockchain technology has begun to be taken seriously, especially by giant online shopping platforms such as JD.com and Alibaba.
Since the birth of online shopping, the most serious problem standing in front of people is the problem of trust. In order to solve this problem, JD.com proposed a self-operated strategy, hoping to solve the problem of customer trust through its own reputation. Ali tried to solve the problem through Alipay's third-party guarantee. However, these approaches do not address the root causes of the crisis of confidence. Therefore, there is the blockchain technology to be studied in this article, which is the technology used by the most popular Bitcoin at present. The following focuses on the explanation of blockchain technology.
To put it simply, blockchain is a distributed ledger technology. It uses cryptography to ensure that its data cannot be tampered with, and then uses a consensus algorithm to reach consensus on the new data.
1. Blockchain is a distributed database placed in a non-secure environment
First of all, it's a distributed, decentralized system. So, if there is a central server or node, it is not a blockchain. The nodes are all secure, non-malicious, and this is not a blockchain either. Similarly, from an application perspective, if your application has to use a central node (e.g., a supercomputer for deep learning) or doesn't need to consider the situation where the node is not secure (e.g., a sensor in a secure factory), then you don't need to consider blockchain technology.
As for the latter word "database", most mature blockchains are databases, for example, Bitcoin is a distributed ledger, and the ledger is actually data. Then, depending on the format of the data, it can be divided into three more types:
1. The data is completely irrelevant, just a consensus, and there is no valid or invalid distinction;
2. The data has certain logical structures, for example, in the ledger, a transaction actually has inputs and outputs in addition to the amount, which is connected to the previous transaction, and these data need to be verified by logic (for example, in the transaction, the node needs to verify whether the input transaction is valid);
3. The data has a Turing complete logic, and the verification needs to be calculated by the node using computing power, each transaction can have different outputs and states, each node should not only verify the authenticity of the transaction and the correctness of the input, but also read the value according to the logic in the transaction, check and then verify the results. Bitcoin's system is the second type, also known as the distributed ledgerEthereum is the third. The third can support smart contracts. To use Bitcoin, for example, it is a fully decentralized system;It is placed in a non-secure environment and does not require that all people who use Bitcoin are free from malicious intent.
2. The blockchain uses cryptography to ensure that the existing data cannot be tampered with
The two core points of this section are: cryptographic hash functions, and asymmetric encryption. Both are fundamental to cryptography (cryptography) Hash function: a function y=h (x) with the following properties: x makes it easy to calculate y;It is impossible to calculate x; with yIt is impossible to find another x with y such that h (x) = y;If x and x differ very little, h(x) and h(x) are completely uncorrelated. This thing is mainly used to verify the integrity of the information, and the hash value of the information is placed behind a message, which is very small, such as 256bit, and is easy to calculate. After receiving the message, the recipient calculates the hash value again, and compares the two to know whether the message has been corrected. If tampered with, even if it is only 1 digit bit, the entire hash value will be completely different. Due to the nature of the hash function, no one can forge another message with the same hash value, which means that it is completely impossible for the tampered data to pass the hash check.
Asymmetric encryption: This thing is very easy to understand - one-to-one symmetric encryption is to have a key, which can be understood as a safe key, you encrypt the message into ciphertext, no one can understand what it is, and then the same key decrypts the original message. Asymmetric encryption means that there are two keys, one is called the public key and the other is called the private key, and if you use one of them to encrypt, you can only use the other to decrypt it, and vice versa. Another important property is that if you are given ciphertext, plaintext and one of the keys, you still can't figure out what the other key is. The principle is basically based on difficult mathematical problems such as factorization and discrete logarithms, commonly used RSA, Diffihellman, and ECC (circular curves), which are used in Bitcoin. In addition to asymmetric encryption, which is used for information encryption, asymmetric encryption also has another purpose, which is authentication. Because usually we assume that a pair of public and private keys is public, and the private key is only owned by the person, so if a person has a corresponding private key, we can assume that he is himself. One of the most important applications is to digitally sign a message that the sender hashes and then encrypts it with a private key. Then the recipient first hashes the message, then decrypts the digital signature with the corresponding public key, and then compares the two hash values, if they are the same, it means that the message was sent by the person and has not been tampered with.
The blockchain writes transactions (data) in blocks: the first block is called the genesis block, and the content is arbitrary. Starting with the second block, the first part of each block has the hash of the previous block. In addition, every transaction (data) in the block has a digital signature of the initiator to ensure authenticity and legitimacy. As a result, any data in the previous block cannot be tampered with. This database is not static. The data in the database will increase, and each time the data is added, it is a block, so these blocks with different generation times are chained together in this form.
3. The blockchain uses a consensus algorithm to reach a consensus on the new data
The purpose of the consensus algorithm is to allow all nodes to reach consensus on the new block, that is, everyone must approve the new block. For a system with a center, it's very simple, and everyone agrees on what the center says, but in a decentralized system, especially when some nodes have malicious intentions, this thing is very complicated, and there is a corresponding problem in computer science called the "Byzantine General Problem" or "Byzantine Fault Tolerance" (BFT) Public chains, represented by Bitcoin, Ethereum and all currencies under consideration, all use Bitcoin consensus, and the consensus algorithm basically uses a proof-of-work mechanism, that is, mining, which has been explained clearly enough in other answers. The proof-of-work mechanism is all right, except for the cost of electricity. How much electricity does it cost?Bitcoin, it's about as big as a city with a million people. In addition, Ethereum's founders are particularly fond of proof-of-stake, and it seems that it will soon be put into use on a small scale (one in 100 blocks). But so far, there has been a wait-and-see attitude towards its reliability.
Private chains and consortium chains. IBM's Hyperledger-Fabric, and a whole bunch of others like TenderMint, and even R3Corda and Ripple, are represented by BFT consensus. In fact, there are many applications in this area, but the problem is that basically all applications still give people the feeling that they are still blockchains for the sake of blockchain, and there are basically no applications that really feel that this thing is so good that it is indispensable.
It is secure and does not have a large ledger, so it cannot be destroyed (not controlled by a computer), it cannot be cheated, and everyone has the same ledger, which can ensure that the ledger recording process is open and transparent.
The efficiency of national bookkeeping will also be improved, and there will be no centralized intermediaries, so that everything will run automatically through pre-set procedures, which can greatly reduce costs and improve efficiency.
To solve the problem of intermediary credit, two people cooperated before, if they did not trust each other, they had to rely on a third party, just like the transfer had to go through the bank. But through blockchain technology, people can transfer money between two parties without intermediaries, such as Bitcoin, which is one of the practical applications of blockchain.
Source: China Informatization.
Original title: Research on blockchain security technology based on network transactions.
Written by Jiao Feng.