BLOCKCHAIN & WEB3 FUNDAMENTALS - Chapter 2, Exercise 1 Solution ========================================================== Why Weak Collision Resistance Would Break a Blockchain PROBLEM ------- Explain, using this chapter's own listed hash properties, why a blockchain would be insecure if its hash function had weak collision resistance - specifically, what an attacker could do with two different inputs that hash to the same output. SOLUTION -------- Collision resistance means it should be computationally infeasible to find two different inputs that produce the identical hash output. A blockchain leans on this property constantly - every block header includes the hash of its own transaction data, and every block also includes the hash of the previous block, chaining them together. If collision resistance were weak, an attacker could find two genuinely different sets of transaction data that both hash to the exact same digest. That opens a real, concrete attack: the attacker could get a block containing transaction set A accepted and confirmed by the network (paying for something, for example), and later substitute transaction set B - a different set of transactions - in its place, while the block's own recorded hash stays unchanged and still matches. Anyone checking the block's own hash afterward would see a valid-looking match and have no way to detect that the actual contents had been silently swapped. This directly undermines the whole point of the ledger: an append-only, tamper-evident record. If two different transaction histories can share one hash, the hash stops being reliable proof of exactly which transactions actually happened. ANSWER: Weak collision resistance would let an attacker substitute one set of transaction data for a completely different set while keeping the same recorded hash, defeating the tamper-evidence the whole chain depends on - which is exactly why real cryptographic hash functions like SHA-256 are specifically designed and chosen for strong collision resistance. ---- WHY THIS WORKS AS AN ANSWER This connects the abstract property (collision resistance) directly to the concrete, structural role hashing plays in a blockchain - linking blocks together and proving transaction data hasn't been altered - which is the actual reason this property matters here, not just an isolated cryptographic definition.