I am a very very beginner with blockchain. I've read a lot of articles and can't understand one thing. When data miner is creating new block, the hash of such block must meet certain requirements. As I understand this is the key difficulty for creating new block. However, as a programmer I know that it is very easy to create new hash. Can anyone explain what is the reason of such requirements?
1 Answer
The hash must be less than or equal to a certain target hash. This is to reduce the probability that any random hash you choose will be a valid hash with valid work. The whole point of this is to prove that you (as a miner) did, on average, a certain number of hashes (work) in order to find the block.
-
Thank you for your answer. But why is
a certain number of hashes (work)
required? Is this not just wasting of IT resources? Commented Aug 30, 2017 at 14:14 -
No, it is done to prove that you are consuming a certain number of resources and thus have something at risk in the game. You may consider it wasting resources, but it really is not as that is what secures the blockchain. In order for an attacker to change the blockchain, they must do the same amount of work (and thus consume the same or more resources) in order to change one block. More work (and thus more resources) are required to change older blocks. This makes changing history prohibitively expensive.– Ava Chow ♦Commented Aug 30, 2017 at 14:22
-
But if the hash of Block N is calculated on base of hash of Block N-1, does this not guarantee the security? And the hacker can also buy two-three servers and do the same work. Commented Aug 30, 2017 at 14:26
-
No, it does not. Block N can still be changed by performing the same amount of work done to make block N in the first place. In order to change block N and also change block N+1, you would need to do the same amount of work for block N and the same amount of work for block N+1, so you would need to do double the work. For each new block found that you want changed, you need to an additional amount of work for that block too, otherwise honest miners will outpace you and your fork of the blockchain will be rejected by everyone.– Ava Chow ♦Commented Aug 30, 2017 at 14:35
-
Do I understand right - these hash requirements guarantee that certain minimum time is (for example X hours) needed for generating hash and making race with hackers? For example, honest data miners are generating block N and the hacker wants to change block N-1, but hacker needs to be first to change block N-1 and create on base of block N-1 block N. However, it is considered that hacker never be the first, because honest data miners will generate one block faster then hacker two blocks. Am I right? Commented Aug 30, 2017 at 14:45