Storing the hash of every transaction in the block header could make the block header much larger than it currently is. Right now the whole header is 80 bytes, and the tx merkle root is 32 bytes of that. You can hash any number of transactions into a 32 byte merkle root, so it works very well as a cryptographically secure compression technique.
I can think of a few effects of larger block headers:
- SPV wallets would be more resource intensive to run, they would require much more storage and bandwidth. I think computing the merkle branch is probably rarely the hardware bottleneck to be considered when designing wallets.
- Miners would be incentivized to mine small blocks. This is because a larger blockheader would mean a larger input value for the SHA-256 hash function, so it would take longer to compute the hash. This is important: the fastest block hash a miner could compute would be one with no transactions in it (other than the coinbase).
You would be able to fit less transactions in a block, since more of the blockspace would be used by the header. A good implementation would not change the number of transactions you could fit in a block, see Pieter's comments below.
There are probably more, feel free to expand on this list.
The last argument does not hold. Just because the block header contains all txids does not make every store all of them. That's similar to how the Merkle tree itself is not stored anywhere, but implied by the transactions. – Pieter Wuille – 2018-05-15T16:20:00.063
@PieterWuille I'm not sure I follow. At the most basic evel: if the max block weight remains the same, and including txids instead of a merkle root makes the header larger, then that leaves less space in the body for transactions, no? I interpreted OPs question as 'why not just a naive implementation that lists all txids in a row' – chytrik – 2018-05-16T07:09:30.287
They could be part of the block header without storing them (in any situation where you're already storing the transactions too). We could do the same right now with just the root (as it too is implied by the transactiins), but for just 32 bytes it's not really worth it. – Pieter Wuille – 2018-05-16T07:29:25.960
I understand, thanks. I edited the answer to be more accurate. – chytrik – 2018-05-16T10:25:23.713