Hash function and bitcoin
hash algorithm is a cryptographic algorithm that can only encrypt, but not decrypt. It can convert any length of information into a fixed length string
this string has two characteristics:
1. Even if the input value changes only a little, the output hash value will be very different
2. Only exactly the same input value can get exactly the same output value
3. There is no rule between the input value and the output value, so the input value cannot be calculated by the output value. In order to find the specified output value, we can only use enumeration method: constantly change the input value to find the output value that meets the conditions
hash algorithm ensures that the results of bitcoin mining can not be deced reversely. Therefore, the miner's continuous operation is essentially brutally cracking the correct input value. Whoever finds the first one will get the bitcoin reward.
generally, y = hash (x) is used in the instry to calculate a hash value y by calculating X.
1 - data layer: data block, chain structure and time stamp
2 - network layer: P2P network, propagation mechanism, verification mechanism
3 - consensus layer: pow, POS, dpos
4 - incentive layer: issuance mechanism, distribution mechanism
5 - contract layer: script code, algorithm mechanism, smart contract
6-application layer: encapsulates various application scenarios
in the future, jinwowo group will focus on promoting the legal circulation and commercial application of big data with blockchain technology.
Hash algorithm maps any length of binary value to a fixed length of smaller binary value, which is called hash value. Hash value is a unique and compact numerical representation of a piece of data. If you hash a piece of plaintext and change only one letter of the paragraph, subsequent hashes will proce different values. It is computationally impossible to find two different inputs with the same hash value
message authentication code (MAC) hash function is usually used with digital signature to sign data, while message detection code (MDC) hash function is used for data integrity
the basic information of bitcoin network is as follows:
all digital currencies that need to be mined have hash values, such as Laite coin, Ruitai coin, doggy coin, Weimeng coin, Diandian coin, Yuanbao coin, etc< br />
[comedy + compare h bar]<
grandson of the slippery ghost
[so this is introced by a friend = v = I haven't seen it]
black cat
[male master is a killer, and he was called the terminator of hell later because he was influenced by Shaye]
holy mark of the wind
[absolutely recommended!! The handsome male protagonist is the contractor, controlling the wind is the wind warlock, while the female owner is the famous fire warlock family. Then they quarrel when they meet, but they have very good feelings. They are both arrogant. But later, another person who lives in the male owner's memory appears. The male owner of the weak and weak shrimp suddenly knows that his family has the power to become a robber. Then turn around and turn into a robber. It's very handsome
goblin's tail
[keep pushing. Magic. The painting style is beautiful, the plot is better, it's just a little hot, but you're sure to like it!]
leaves... If it's not enough, then you go to QQ, I'm telling you, I've seen animation ~ give me 0.0
Hash function, also known as hash function and hash algorithm, is a method to create small digital "fingerprint" (also known as Digest) from any kind of data. What do you mean? That is to say, if you input data of any length and content, the hash function outputs a fixed length and fixed format result, which is similar to the fingerprint of the data you input. As long as the input changes, the fingerprint will change. Different content, the fingerprint obtained by hash function is different. This is the hash function
in distributed ledger, in order to ensure data integrity, hash value is used for verification. For example, a transaction or a page of ledger (that is, the concept of block) generates a summary after hashing, which means that the transaction information of the whole block cannot be tampered with (that is, the summary cannot be kept unchanged after tampering with the data)
the original definition or narrow sense of blockchain is in the form of block + chain, which is linked by hash. Each block may have many transactions, and the whole block can generate summary information through hash function, and then each block needs to record the summary information of the previous block, so that all blocks can be connected into a chain
if you change the data of a block in the history, it means that the block summary value (i.e. hash value) will change, then the hash of the previous block recorded in the next block will have to be modified accordingly, and so on. That is to say, if you want to modify the history, you need to start from that point, and then all records will have to be modified to ensure the legitimacy of the ledger, Hash function increases the difficulty of account book tampering
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
bitcoin itself is the proct of the development of cryptography, which is constructed by using the very important "one-way hash function" and digital signature technology in cryptography. Today, we will focus on five important characteristics of one-way hash function
hash function features:
one way hash function, also known as hash function
the first feature: the input can be of any length, and the output is a fixed length
the hash function does not need to know what the input information represents, nor does it matter how long the length of the information is, as long as the input hash function proces a fixed length bit value. For example, the well-known sha256 hash function, input any value out of 256 bits of 0 and 1. Input a "Romance of the Three Kingdoms" or just input a letter, out of 256 bits of data
the second feature: the speed of hash value calculation is relatively fast
this point is often ignored by people. It seems that people don't care about what they are used to. In fact, this point is equally important, because the calculation of one-way hash is very fast, in order to ensure the speed of encryption or verification
the third feature is collision resistance
x ≠ y, H (x) = H (y). The input space is much larger than the output space. For example, a 256 bit hash value means that the output space is 2 ^ 256, the input is infinite, and the output is fixed
however, at present, there is no good way to find out a value where H (x) is equal to the right< This is called brute force brute force, which is the source of the word "hash collision" in mining machine
hash anti-collision is used to ensure that the uploaded and downloaded data are the same, that is, the result of changing a little bit is much worse. For example, the information you input is a dream of Red Mansions (of course, the computer recognizes it as 0 and 1). Then you change a comma to a full stop in the fifth sentence on page 100 of the dream of Red Mansions, and the output hash value is completely different. This is a very important feature of hash function
but at present, there is no mathematical proof that this collision will not happen. MD5 is the best example. It was very safe before, but later found a solution