0

reference: https://www.youtube.com/watch?v=kE51N84hBxU

To check a block for integrity the nonce and the content are hashed together and then it is check if the numbers of zeros do match the number of zeros of the hash of the "guy" who mined the block.

Why do we not just compare the hashes after the mining, why do we only compare the number of zeros? I mean that does make little to no sense to me since comparing the complete hash does provide more security is no little to no much more effort.

1 Answers1

2

The number of leading zeros is how Proof of Work works. Assume that it does not matter how many zeros the hash has. Then it would be trivial to find a block, as you could just use ANY nonce and provide the block (and some resulting hash).

However, if the requirement is "the hash has to start with 10 zeros", you have to try a lot of nonces (and do a lot of hashing) before you get a hash that matches the requirement.

Every participant checks if the hash has the required number of leading zeros.

C-Otto
  • 5,615
  • 3
  • 29
  • 62
  • yeah but why not also compare the rest of the hash? He says bitcoin just looks if the leading zeros are the equivalent. This makes no sense. –  Jun 19 '17 at 16:54
  • Because there's no need. As long as you find ANY hash with a sufficient number of leading zeros, everyone is happy. Even if by mistake you come up with another hash which has enough zeros - which is extremely unlikely. – C-Otto Jun 19 '17 at 16:55
  • It's more unlikely to find exaclty the same hash with different content –  Jun 19 '17 at 16:56
  • That may be, but why do you care? – C-Otto Jun 19 '17 at 16:56
  • Because i watched the video and it makes no sense to not campare the rest of the hash. That's why I'm asking. –  Jun 19 '17 at 16:57
  • What would be the benefit of comparing the rest? Is the hash even communicated to the other nodes? Only the zeros matter. – C-Otto Jun 19 '17 at 16:58
  • The other nodes as far as I understand do check for integrity. There are much more combinations of then –  Jun 19 '17 at 16:59
  • 1
    Oh ok then I missunderstood that –  Jun 19 '17 at 17:00
  • but I guess integrity is also checked with the whole hash by nodes, am I right? Just to complete this –  Jun 19 '17 at 17:23