<p>The leading zeroes <em>is</em> 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.</p>

<p>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.</p>

<p>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.</p>

<p>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.</p>

CC BY-SA 4.0
2019-01-24T02:14:48.870Z
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?
Emerson Oliveira
CC BY-SA 4.0
2019-01-24T02:36:21.650Z
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
CC BY-SA 4.0
2019-01-24T08:47:29.170Z
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.
Thorkil Værge
CC BY-SA 4.0
2019-01-24T02:03:32.573Z
2019-01-24T02:09:23.500Z
2019-01-24T02:09:23.500Z
Ava Chow
<p><strong>Altering data in a Bitcoin is hard because it requires a lot of dedicated cost.</strong> 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.</p>

<p>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.</p>

<p>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.</p>

<p>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. </p>

CC BY-SA 4.0
2019-01-24T08:27:40.400Z
2019-01-24T08:27:40.400Z
James C.
<p>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.</p>

<blockchain><proof-of-work><consensus><proof-of-stake>
What exactly makes altering of data in non-bitcoin blocks hard?
Emerson Oliveira
# What exactly makes altering of data in non-bitcoin blocks hard?

(Asked by: username_0 on 2019-01-24)

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.

**Tags:** blockchain, proof-of-work, consensus, proof-of-stake


---

## 2 answers

### Answer by username_1 on 2019-01-24. Score: 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.

> **Comments:**
> **username_0**: 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?  
> **username_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.  
> **username_2**: 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.  

---

### Answer by username_3 on 2019-01-24. Score: 1

**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.


---

