区块链hash是什么意思,区块链中的hash算法
请查看相关英文文档
『一』What is the blockchain hash algorithm?
The hash algorithm is also called "hash" and is one of the four core technologies of the blockchain. . It is an algorithm that can calculate a fixed-length string (also called message digest) corresponding to a digital message. Since a piece of data has only one hash value, the hash algorithm can be used to check the integrity of the data. The use of hashing algorithms is very common in the application of fast search and encryption algorithms.
In the Internet age, although the distance between people is closer, the trust problem has become more serious. The technical architecture of existing third-party intermediary organizations is private and centralized. This model can never fundamentally solve the problems of mutual trust and value transfer. Therefore, blockchain technology will use a decentralized database architecture to complete data interaction trust endorsement and achieve a major step forward in global mutual trust. In this process, hashing algorithms play an important role.
The hash algorithm is a one-way cryptographic mechanism in the blockchain that ensures that transaction information is not tampered with. Blockchain uses a hashing algorithm to encrypt transactions in a transaction block and compress the information into a hash string consisting of a series of numbers and letters. The blockchain’s hash value uniquely and accurately identifies a block. When verifying the authenticity of a block, you only need to simply calculate the hash value of the block. If there is no change, it means that the information on the block has not been tampered with.
The Xueshuo Innovation Blockchain Technology Workstation under Lianqiao Education Online is the only "Smart Learning Factory 2020- Xueshuo Innovation Workstation" launched by the School Planning and Construction Development Center of the Ministry of Education of China. Approved "Blockchain Technology Professional" pilot workstation. The professional base is based on providing students with diversified growth paths, promoting the reform of the training model integrating professional degree research, production, and research, and building an applied and compound talent training system.
『二』What is the hash algorithm of the blockchain?
Heshu Software explains: The blockchain is encrypted using a hash algorithm. The hash algorithm is a single cryptographic mechanism in the blockchain that ensures that transaction information is not tampered with. After the hash algorithm receives a piece of plaintext, it converts it into a piece of hash data with a shorter length and a fixed number of digits in an irreversible way.
『三』What is the hash algorithm in blockchain technology
1.1. Introduction
Practitioners in the computer industry should be very familiar with the word hash. , Hashing can map data from one dimension to another. This mapping is usually achieved using a hash function. Usually, the industry uses y = hash(x) to represent it. This hash function implements operations on x to calculate a hash value y.
Characteristics of hash functions in blockchain:
Function parameters are string type;
Fixed size output;
Efficient calculation;
collision-free means that the probability of conflict is small: x != y => hash(x) != hash(y)
Hide the original information: For example, the verification of transactions between various nodes in the blockchain only requires verification of the information entropy of the transaction, without the need to verify the original information. The information is compared. There is no need to transmit the original data of the transaction between nodes, only the hash of the transaction. Common algorithms include SHA series and MD5 algorithms
1.2. Usage of hash< /p>
Hash is widely used in blockchain, one of which we call Hash Pointer
Hash pointer means that the value of the variable is calculated based on actual data and Points to the actual data location, that is, it can represent both the actual data content and the storage location of the actual data. The picture below is a schematic diagram of the Hash Pointer
『四』What is the hash algorithm?
The hash algorithm is a special function, regardless of the input No matter how long a string of characters is, you can get a fixed-length output value through this function. This is like an ID card number, which is always 18 digits and unique in the country. The output value of the hash algorithm is called the hash value.
Principle:
The hash algorithm has three characteristics, which give the blockchain the characteristics of tamper-proof and anonymity, and ensure that the entire blockchain System integrity.
The first characteristic is that it is one-way. For example, if you input a string of data, you can get a hash value through the hash algorithm, but there is no way to get the input string of data back through this hash value. This is one-way, and it is precisely based on this that the blockchain effectively protects the security of our information.
The second characteristic of the hash algorithm is its anti-tampering ability. For any input, even if it is a small change, the change in the hash value will be very large.
This characteristic of it plays a key role in the connection between blocks. Each block of the blockchain is marked by the hash value of the previous block. Unless someone can crack all the hashes on the entire chain, it is impossible to tamper with the data once it is recorded on the chain.
The third characteristic of the hash algorithm is its anti-collision capability. The so-called collision is to input two different data and finally get the same input.
Just like when we go shopping, collision means that most inputs can get a unique output. In the world of blockchain, the address of any transaction or account is completely generated based on the hash algorithm. This also ensures the uniqueness of the transaction or account address in the blockchain network.
No matter how much money is transferred or how many people are transferred to this transfer, it will only exist in the big ledger of the blockchain. It is like white blood cells in the human body. Not only is every part of the blockchain inseparable from it, but it also gives the blockchain various characteristics and protects the entire block.The security of the chain system.
『五』What is the hash algorithm?
The hash algorithm is: a special function. No matter how long a string of characters is input, a fixed value can be obtained through this function. The output value of the length is just like an ID number, which is always 18 digits and unique in the country.
The output value of the hash algorithm is called the hash value. The hashing algorithm, also known as "hash", is one of the four core technologies of the blockchain. It can calculate the fixed-length string corresponding to a digital message.
Principle:
The principle of the Hash algorithm is to map the value of the input space into the Hash space. Since the space of the Hash value is much smaller than the input space, And with the help of the drawer principle, it can be concluded that there must be situations where different inputs are mapped to the same output. If a Hash algorithm is good enough, then it will have a smaller probability of conflict. In other words, a good Hash algorithm will have a smaller probability of conflict. The Hash algorithm should have excellent anti-collision capabilities.
『Lu』 What is the hash value in the blockchain?
The blockchain uses a hash algorithm to encrypt the transaction information in a transaction block and compress the information. into a hash string consisting of a string of numbers and letters. Jinwowo Group analyzes the role of its hash algorithm as follows: the hash value of the blockchain can uniquely and accurately identify a block. Any node in the blockchain can receive the hash of this block through simple hash calculation. Hash value, the calculated hash value has not changed, which means that the information in the blockchain has not been tampered with.
『撒』 Hash algorithm in blockchain
Hash algorithm is the most important underlying technology in blockchain. It is a method used to identify transaction data and is unique. A cryptographic hash algorithm is a "fingerprint" of the data.
The cryptographic hash algorithm has 5 major characteristics:
1. It can quickly create hash values for any type of data.
2. Certainty. Hash algorithms always produce the same hash value for the same input data.
3. Pseudo randomness. When the input data is changed, the hash value returned by the hash algorithm changes unpredictably. It is impossible to predict the hash value based on the input data.
4. One-way function. It is not possible to recover the original input data based on the hash value. It is impossible to learn anything about the input data based on the hash value alone.
5. Anti-collision. The chances of different blocks of data producing the same hash value are slim.
『8』What is the hash value in the blockchain
Hash value is the process of converting an input string of any length into a password and producing a fixed output. The hash value is not a "password", we cannot retrieve the original data by decrypting the hash, it is a one-way encryption function.
Blockchain:
Blockchain is an information technology fielddomain terminology. In essence, it is a shared database, and the data or information stored in it has the characteristics of "unforgeable", "full traces left", "traceable", "open and transparent" and "collectively maintained". Based on these characteristics, blockchain technology has laid a solid foundation of "trust" and created a reliable "cooperation" mechanism, which has broad application prospects. On January 10, 2019, the Cyberspace Administration of China issued the "Blockchain Information Service Management Regulations".
『Nine』 Can the blockchain hash value be exposed?
Yes.
Hashing is the process of converting an input string of any length into a password and producing a fixed output. The hash value is not a "password", we cannot retrieve the original data by decrypting the hash, it is a one-way encryption function. In blockchain, each block has the hash value of the previous block, and the previous block is called the parent block of the current block, if considered the parent block has a current block.
It will have the hash value of the previous block which is the parent block. In a blockchain, each block has the hash of the previous block. When we change any data in the current block, the hash of the block will be changed, which will affect the previous block because it has the address of the previous block.
『Shi』What is hash
When it comes to hash, I believe most students will be familiar with it. The underlying principles behind the blockchain, a technology that was very popular before and is still very popular now. One of them is hash. The following is an explanation of the hash algorithm from several perspectives such as the principle and practical application of the hash algorithm.
1. What is Hash
Hash is also called hash, hash, and the corresponding English words are Hash. The basic principle is to convert input of arbitrary length into fixed-length output through the Hash algorithm. The rule of this mapping is the corresponding Hash algorithm, and the binary string after mapping the original data is the hash value. MD5 and SHA, which are often used in activity development, are both hash algorithms with a long history.
echo md5("This is a test copy");
//Output result:
In this example, this is a test copy which is the original value,
It is the Hash value obtained through the hash algorithm. The entire process of the Hash algorithm is the process of mapping the original arbitrary-length value space into a fixed-length value space.
2. Characteristics of Hash
What are the requirements for an excellent hash algorithm?
a) The original data cannot be deduced from the hash value in reverse direction
This can be clearly seen from the MD5 example above, there is no correspondence between the mapped data and the original data.
b). Small changes in the input data will get completely different hash values, and the same data will get the same value
echo md5("This is a test copy");// Output result: echo md5("This is two test copy");// Output result: You can see that we only changed one text, but the entire hash value was obtained There have been very big changes.
c), the execution efficiency of the hash algorithm must be efficient, and the hash value can be quickly calculated for long texts
d), the probability of conflict of the hash algorithm must be small
Due to the principle of hash It maps the values of the input space into the hash space, and the hash value space is much smaller than the input space. According to the drawer principle, there must be situations where different inputs are mapped to the same output. So as a good hash algorithm, the probability of such conflicts needs to be as small as possible