I understand how transactions 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.
2 Answers
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.
-
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. Commented Feb 17, 2019 at 10:17
-
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 HCommented Feb 17, 2019 at 10:43
-
Also, blocks control the supply of money into the ledger and issue out the transaction fees to the miner who created the snapshot.– Mark HCommented Feb 17, 2019 at 10:45
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.
-
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. Commented Feb 17, 2019 at 10:19
-
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– MCCCSCommented Feb 17, 2019 at 10:32