Why does hash of new created block must meet certain requirements in blockchain?

1

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?

Pavel

Posted 2017-08-30T10:25:23.327

Reputation: 111

Answers

2

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.

Andrew Chow

Posted 2017-08-30T10:25:23.327

Reputation: 40 910

Thank you for your answer. But why is a certain number of hashes (work) required? Is this not just wasting of IT resources?Pavel 2017-08-30T14:14:15.740

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.Andrew Chow 2017-08-30T14:22:20.980

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.Pavel 2017-08-30T14:26:04.990

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.Andrew Chow 2017-08-30T14:35:54.813

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?Pavel 2017-08-30T14:45:08.807

Kind of. It isn't a minimum time but rather that in order to perform the amount of work required, an attacker would need to invest in a significant amount of mining hardware, so much so that it would be prohibitively expensive to do that.Andrew Chow 2017-08-30T15:00:45.623

Ok, thank you for detailed comments. I will wait a little, maybe someone will give another answer. Otherwise I will accept your answer.Pavel 2017-08-30T15:03:23.433