<p>From the <a href="https://bitcoin.org/bitcoin.pdf" rel="nofollow">original Bitcoin paper</a>:</p>

<blockquote>
  <p>... we implement the proof-of-work by incrementing a nonce in the block until a value is found that gives the block's hash the required zero bits. Once the CPU effort has been expended to make it satisfy the proof-of-work, the block <strong>cannot be changed without redoing the work</strong>. As later blocks are chained after it, the work to change the block would include redoing all the blocks after it.</p>
</blockquote>

CC BY-SA 3.0
2014-10-30T03:14:12.883Z
2015-03-24T11:42:47.503Z
2015-03-24T11:42:47.503Z
Nick ODell
<p>SHA256 is a <a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function" rel="nofollow">Cryptographic hash function</a>.<br>
Among other traits, it is</p>

<ul>
<li>infeasible to change the input of a CHF without changing the hash output</li>
<li>there is no discernible pattern between the hashes of two differing messages</li>
</ul>

<p>As the block hash is the product of applying SHA256 to the block data, and the transaction data is represented in the input through the Merkle Root, <strong>it is impossible to change even one bit of a block or transaction without starting over from scratch, and there is no headstart by working from a closely related input.</strong></p>

CC BY-SA 3.0
2015-03-24T10:17:03.930Z
2015-03-24T13:06:14.377Z
2015-03-24T13:06:14.377Z
Murch
<blockquote>
  <p>Once a miner has found a block, how easy it is for him to add or remove a tx included in that very block? </p>
</blockquote>

<p>It is impossible. The solved block depends on every byte of transaction data, nothing can be changed. It is important that it be this way. What if I could broadcast a solved block but leave out the transaction where I sent coins to someone else, essentially reverting my spend? That would make for an insecure system. </p>

<blockquote>
  <p>Would he have to solve the modified block from the scratch or is there a point he can resume the solving process?</p>
</blockquote>

<p>It is basically like starting over. This is mainly because of the merkle root in the block header. Think of it like a function that depends on every single byte of the transactions, and if any of the transactions change then the function output changes completely. </p>

<p>See this for more info on merkle trees in bitcoin: <a href="https://bitcoin.stackexchange.com/questions/10479/what-is-the-merkle-root">What is the Merkle root?</a></p>

<hr>

<p>EDIT: I wanted to add this mining analogy that I find useful.</p>

<p>Each hash that the miner computes has a chance to solve a block. Mining is basically like taking a video of yourself flipping 256 coins, trying to get a long string of heads. How long the string of heads needs to be is determined by how many other coin flippers you are competing with. If you get a long enough string of heads, you show the proof (video) and get the reward. Otherwise, you just try again. You essentially start over each time you do a new hash (so billions of times), and changing your block data doesn't make you any more or less unlikely to flip the coins successfully. </p>

<p>Notice how it takes a lot of work to flip the heads successfully (it would take you many tries, where each try is really easy), but very little work to verify that a video of coin flips is legitimate.</p>

CC BY-SA 3.0
2015-03-24T10:20:06.650Z
*"It is basically like starting over."* Actually, it is **indistinguishable** from starting over. ;)
Murch
CC BY-SA 3.0
2014-10-30T02:12:12.097Z
2015-03-24T05:04:35.073Z
2017-04-13T12:47:33.283Z
morsecoder
<p>Once a miner has found a block, how easy it is for him to add or remove a tx included in that very block? Would he have to solve the modified block from the scratch or is there a point he can resume the solving process? </p>

<merkle-tree><block-header><mining-technical-details>
How hard is it to alter a block after it was found?
Doug Peters
# How hard is it to alter a block after it was found?

(Asked by: username_0 on 2014-10-30)

Once a miner has found a block, how easy it is for him to add or remove a tx included in that very block? Would he have to solve the modified block from the scratch or is there a point he can resume the solving process?

**Tags:** merkle-tree, block-header, mining-technical-details


---

## 3 answers

### Answer by username_3 on 2014-10-30. Score: 7 | Accepted answer

> Once a miner has found a block, how easy it is for him to add or remove a tx included in that very block?

It is impossible. The solved block depends on every byte of transaction data, nothing can be changed. It is important that it be this way. What if I could broadcast a solved block but leave out the transaction where I sent coins to someone else, essentially reverting my spend? That would make for an insecure system.

> Would he have to solve the modified block from the scratch or is there a point he can resume the solving process?

It is basically like starting over. This is mainly because of the merkle root in the block header. Think of it like a function that depends on every single byte of the transactions, and if any of the transactions change then the function output changes completely.

See this for more info on merkle trees in bitcoin: [What is the Merkle root?](https://bitcoin.stackexchange.com/questions/10479/what-is-the-merkle-root)

---

EDIT: I wanted to add this mining analogy that I find useful.

Each hash that the miner computes has a chance to solve a block. Mining is basically like taking a video of yourself flipping 256 coins, trying to get a long string of heads. How long the string of heads needs to be is determined by how many other coin flippers you are competing with. If you get a long enough string of heads, you show the proof (video) and get the reward. Otherwise, you just try again. You essentially start over each time you do a new hash (so billions of times), and changing your block data doesn't make you any more or less unlikely to flip the coins successfully.

Notice how it takes a lot of work to flip the heads successfully (it would take you many tries, where each try is really easy), but very little work to verify that a video of coin flips is legitimate.

> **Comments:**
> **username_2**: *"It is basically like starting over."* Actually, it is **indistinguishable** from starting over. ;)  

---

### Answer by username_1 on 2014-10-30. Score: 4

From the [original Bitcoin paper](https://bitcoin.org/bitcoin.pdf):

> ... we implement the proof-of-work by incrementing a nonce in the block until a value is found that gives the block's hash the required zero bits. Once the CPU effort has been expended to make it satisfy the proof-of-work, the block **cannot be changed without redoing the work**. As later blocks are chained after it, the work to change the block would include redoing all the blocks after it.


---

### Answer by username_2 on 2015-03-24. Score: 1

SHA256 is a [Cryptographic hash function](http://en.wikipedia.org/wiki/Cryptographic_hash_function).  
Among other traits, it is

* infeasible to change the input of a CHF without changing the hash output
* there is no discernible pattern between the hashes of two differing messages

As the block hash is the product of applying SHA256 to the block data, and the transaction data is represented in the input through the Merkle Root, **it is impossible to change even one bit of a block or transaction without starting over from scratch, and there is no headstart by working from a closely related input.**


---

