<p>The purpose of the blockchain is to prevent the double-spending of coins by ensuring that there can be at most one valid transaction which spends some known coins. The only way to ensure this is that validators must be aware of <em>all</em> valid transactions.</p>

<p>While it is possible that someone may <em>attempt</em> to double-spend some coins, only one of the transactions may make it into the chain of valid blocks - which serve as an immutable record of which transactions were accepted as the correct ones. They are immutable because even the change of a single bit in a transaction would alter its transaction id, which in turn would alter the block's merkle root, and in turn, would require that all subsequent blocks have their block hash recomputed, because they all refer to a hash of the previous blocks header, which contains its merkle root.</p>

<p>The way all validators agree on which chain is the correct chain is by always taking the chain with the most proof-of-work done on it. This is necessary to keep the ledger immutable, because it means that an attacker attempting to modify a transaction, and thus, needing to recompute the merkle root and the hashes of subsequent blocks, would be constantly playing catch-up with the longest chain, and if they have less hashing power than the other honest miners who are working on extending the longest chain, they will not possibly be able to catch up and generate the chain with the most proof-of-work.</p>

CC BY-SA 4.0
2019-02-17T10:17:37.817Z
I get this stuff, but you could accomplish this without a blockchain just using the plain transactions, so I still don't see why the blocks themselves are really necessary on top of the transactions. Wondering if you can explain more of that part of it.
Lance Pollard
CC BY-SA 4.0
2019-02-17T10:43:48.487Z
The blocks are synchronization checkpoints to ensure everybody is working on the correct ledger, and also are a timestamp server to ensure chronological transaction ordering.  Without the synchronization, different people might accept different transactions spending the same coin as valid and there would be no single view of the ledger, but every participant would have their own view at any time. A miner is effectively an arbitrator who determines which snapshot of the ledger is correct at a point in time, enabling others to throw away coin spends which did not make it into a snapshot first.
Mark H
CC BY-SA 4.0
2019-02-17T10:45:19.260Z
Also, blocks control the supply of money into the ledger and issue out the transaction fees to the miner who created the snapshot.
Mark H
CC BY-SA 4.0
2019-02-17T09:42:15.737Z
2019-02-17T09:47:57.247Z
2019-02-17T09:47:57.247Z
Mark H
<blockquote>
  <p>I understand how transactions are grouped into blocks. However, I don't understand why this is necessary in the first place.</p>
</blockquote>

<p>The goal of mining would be to make transactions immutable, and to reward honest ("cooperating") miners that don't reorganize the chain. When is it improbable for the chain to be reorganized? When none of the miners own no more than 50% of the network hash rate, and when the largest pools are expected not to form a cartel. Thus, a high number of mining pools is good for Bitcoin. To achieve that, small or medium scaled miners with enough hashrate must have no or little disadvantage. To put another way, while large scale miners have their own ISPs, relay networks, and maybe transatlantic cables (exaggeration) to deal with latency, latency is a huge problem for small-medium miners. If we wanted to eliminate small-medium miners (for no reason), there are two things we can change:</p>

<ul>
<li>Remove the block size limit. (affects the amount of data transferred at once)</li>
<li>Decrease the average 10 minute inter-block interval. (affects the frequency of transferring data)</li>
</ul>

<p>If every transaction was mined separately, small-medium miners would have a large rate of orphaning, and they would therefore go out of business.</p>

<p>But, IOTA and NANO treat each transaction as a separate block, which is something I don't know very well.</p>

CC BY-SA 4.0
2019-02-17T10:19:52.380Z
Not sure what you mean by "large rate of orphaning". Still don't really understand why the blocks are necessary on top of the transactions.
Lance Pollard
CC BY-SA 4.0
2019-02-17T10:32:59.093Z
An orphan block is a block that is replaced by another
, usually by a block that was just relayed before it was relayed. Blocks allow the nodes to standardise their knowledge. For example, if a merchant asks you to prove that you paid them "99% of all of the nodes received it. Why don't you believe me?" wouldn't be enough. With blocks, you can refer to transactions as "block 904, transcation 7". @LancePollard
MCCCS
CC BY-SA 4.0
2019-02-17T10:05:38.203Z
2019-02-17T10:05:38.203Z
MCCCS
<p>I understand how <a href="https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch10.asciidoc" rel="nofollow noreferrer">transactions</a> are grouped into blocks. However, I don't understand why this is necessary in the first place. If it's a mining thing, I don't see why the miners can't just update the transactions with some metadata and leave it at that. Then the blockchain would simply be a cache on top of the transactions. I don't see the real need for a block to exist if there are the transactions, other than it being a sort of cache.</p>

<transactions><blockchain>
Why the transactions are put into blocks in the first place
Lance Pollard
# Why the transactions are put into blocks in the first place

(Asked by: username_0 on 2019-02-17)

I understand how [transactions](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch10.asciidoc) are grouped into blocks. However, I don't understand why this is necessary in the first place. If it's a mining thing, I don't see why the miners can't just update the transactions with some metadata and leave it at that. Then the blockchain would simply be a cache on top of the transactions. I don't see the real need for a block to exist if there are the transactions, other than it being a sort of cache.

**Tags:** transactions, blockchain


---

## 2 answers

### Answer by username_1 on 2019-02-17. Score: 1 | Accepted answer

The purpose of the blockchain is to prevent the double-spending of coins by ensuring that there can be at most one valid transaction which spends some known coins. The only way to ensure this is that validators must be aware of *all* valid transactions.

While it is possible that someone may *attempt* to double-spend some coins, only one of the transactions may make it into the chain of valid blocks - which serve as an immutable record of which transactions were accepted as the correct ones. They are immutable because even the change of a single bit in a transaction would alter its transaction id, which in turn would alter the block's merkle root, and in turn, would require that all subsequent blocks have their block hash recomputed, because they all refer to a hash of the previous blocks header, which contains its merkle root.

The way all validators agree on which chain is the correct chain is by always taking the chain with the most proof-of-work done on it. This is necessary to keep the ledger immutable, because it means that an attacker attempting to modify a transaction, and thus, needing to recompute the merkle root and the hashes of subsequent blocks, would be constantly playing catch-up with the longest chain, and if they have less hashing power than the other honest miners who are working on extending the longest chain, they will not possibly be able to catch up and generate the chain with the most proof-of-work.

> **Comments:**
> **username_0**: I get this stuff, but you could accomplish this without a blockchain just using the plain transactions, so I still don't see why the blocks themselves are really necessary on top of the transactions. Wondering if you can explain more of that part of it.  
> **username_1**: The blocks are synchronization checkpoints to ensure everybody is working on the correct ledger, and also are a timestamp server to ensure chronological transaction ordering.  Without the synchronization, different people might accept different transactions spending the same coin as valid and there would be no single view of the ledger, but every participant would have their own view at any time. A miner is effectively an arbitrator who determines which snapshot of the ledger is correct at a point in time, enabling others to throw away coin spends which did not make it into a snapshot first.  
> **username_1**: Also, blocks control the supply of money into the ledger and issue out the transaction fees to the miner who created the snapshot.  

---

### Answer by username_2 on 2019-02-17. Score: 1

> I understand how transactions are grouped into blocks. However, I don't understand why this is necessary in the first place.

The goal of mining would be to make transactions immutable, and to reward honest ("cooperating") miners that don't reorganize the chain. When is it improbable for the chain to be reorganized? When none of the miners own no more than 50% of the network hash rate, and when the largest pools are expected not to form a cartel. Thus, a high number of mining pools is good for Bitcoin. To achieve that, small or medium scaled miners with enough hashrate must have no or little disadvantage. To put another way, while large scale miners have their own ISPs, relay networks, and maybe transatlantic cables (exaggeration) to deal with latency, latency is a huge problem for small-medium miners. If we wanted to eliminate small-medium miners (for no reason), there are two things we can change:

* Remove the block size limit. (affects the amount of data transferred at once)
* Decrease the average 10 minute inter-block interval. (affects the frequency of transferring data)

If every transaction was mined separately, small-medium miners would have a large rate of orphaning, and they would therefore go out of business.

But, IOTA and NANO treat each transaction as a separate block, which is something I don't know very well.

> **Comments:**
> **username_0**: Not sure what you mean by "large rate of orphaning". Still don't really understand why the blocks are necessary on top of the transactions.  
> **username_2**: An orphan block is a block that is replaced by another , usually by a block that was just relayed before it was relayed. Blocks allow the nodes to standardise their knowledge. For example, if a merchant asks you to prove that you paid them "99% of all of the nodes received it. Why don't you believe me?" wouldn't be enough. With blocks, you can refer to transactions as "block 904, transcation 7". @username_0  

---

