If leading zeros is only bitcoin requirement, then what makes altering of data in blocks hard? Like now its easy to modify a block and generate new hash for every subsequent blocks since generating hash is not as costly compared to bitcoin requirement.

2 Answers 2


The leading zeroes is what makes altering block data hard. One of the things that makes a block valid is that it's hash is less than some predetermined value. For simplicity, this can be thought of as the hash has to have some predetermined number of leading zeroes. However making such a block meet that requirements is hard and being able to do so proves that you have done some amount of work, hence Proof of Work.

Making a block whose hash has enough leading zeroes is hard because the output of SHA256 Double (the hash function used in Bitcoin) is random. Given some input, you can't predict the output of SHA256d without running the data through it. So the only way to get some block data (the input) to have a hash with some number of leading zeroes is to hash it, see if it meets the criteria, and if it does not, change it and try again. This is what miners do, and the criteria restricts the range of possible valid hashes to such a small percentage of the entire range of possible hashes that it takes the entire network 10 minutes on average to find a hash that meets the criteria.

Iif you wanted to alter the data in a block, you would have to recompute the Proof of Work, i.e. you would need to find a block with your altered data that has a hash with the required number of leading zeroes. Keep in mind that it took the entire Bitcoin network 10 minutes on average to find the block you are changing, so it will probably take you longer than 10 minutes to find a replacement. Then if you want to change a block that has blocks on top of it, you would need to re-mine those blocks too. Otherwise your fork of the blockchain won't be considered the best blockchain as it is not the longest.

While generating a hash is fast, having to do it 25 sextillion (2.5 * 10^22) times on average to find a block is a lot of hashes and is going to take you quite some time.

  • Thanks @Andrew Chow, i understood everything you've said, but i think i wasn't as clear as i expected. I know that the leading zeros is what makes the altering hard, but happens with Bitcoin, as that's a Bitcoin requirement and not a Blockchain general requirement. So, on other blockchains platforms, that differs from Bitcoin, what makes the altering of blocks hard as there's no need to have leading zeros for the block's hash? Commented Jan 24, 2019 at 2:14
  • 1
    Most other blcockhains do the same thing or something similar, i.e. some value that is randomly produced has to be within some threshold.
    – Ava Chow
    Commented Jan 24, 2019 at 2:36
  • Somone once suggested that it would have been more aesthetically pleasing if the value was approaching pi such that the block hashes would starts with 314159265 and become an ever more precise approximation of pi as the difficulty increases. Commented Jan 24, 2019 at 8:47

Altering data in a Bitcoin is hard because it requires a lot of dedicated cost. The confirmation of a transaction or data implies that it is committed to the blockchain with a valid proof-of-work, which is a specific form of a cost-proof. Proof-of-Stake (opportunity cost), Proof-of-SpaceTime (memory) can all be reduced to dedicated cost-proofs.

Let's consider a censoring a specific transaction which already has several blocks of confirmation. In order to do so, one would need to invest capital to acquire 51% or more of the global hash-rate and begin mining a branch at a lower height than the confirmed target transaction.

At some point, this 51% miner will have created the longest chain and successfully reorged the target transaction out. The barrier to such behaviour is the amount of capital to acquire this hash-power.

This capital cost to acquire 51% depends on transaction fees. If fees (confirmation demand) are high, more miners will join the global pool, thereby increasing the cost to acquire 51% mining hash power thereafter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.